Sha256: c2cd5ece4b4e7e502039523b5e60f33fcc1012db9ae37e154ef0af4be3b2d7fb
Contents?: true
Size: 751 Bytes
Versions: 1
Compression:
Stored size: 751 Bytes
Contents
require 'music-transcription' require 'yaml' include Music::Transcription include Pitches include Meters include Parsing score = Score.new(FOUR_FOUR, 120) do |s| s.program = Program.new([0...4.0, 0...4.0 ]) s.parts[1] = Part.new(Dynamics::MF) do |p| p.notes = notes("1C4 1Bb3 1Ab3 /2G3 /2Bb3") end s.parts[2] = Part.new(Dynamics::MF) do |p| p.notes = notes("3/8E5 1D5 1C5 5/8C5 /2C5 /2D5") end s.parts[3] = Part.new(Dynamics::MF) do |p| p.notes = notes("/8 /4G5 /2F5 /4 /4F5 /2Eb5 /4 /4Eb5 /2Eb5 /8 /2Eb5 /2F5") end end name = File.basename(__FILE__,".rb") File.open("#{name}.yml", "w") do |file| file.write score.to_yaml end File.open("#{name}_packed.yml", "w") do |file| file.write score.pack.to_yaml end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
music-transcription-0.17.1 | examples/song2.rb |