Sha256: 5b3c3a4daea76ea825f6e83c19e7ae3079ff360fce166808b71357fc50d0c3f4
Contents?: true
Size: 891 Bytes
Versions: 2
Compression:
Stored size: 891 Bytes
Contents
require 'music-transcription' require 'yaml' include Music::Transcription include Pitches include Articulations include Meters include Parsing score = Score.new(FOUR_FOUR,120) do |s| s.program = Program.new([0...2, 0...2,2...4,0...2]) s.parts["lead"] = Part.new(Dynamics::MF) do |p| riff = "/6Bb3 /4 /12Db4= /6Db4= /36Db4 /36Eb4 /36Db4 /6Ab3 /12Db4 \ /6Bb3 /4 /12Db4= /4Db4= /8=Db4 /8C4".to_notes p.notes = riff + riff.map {|n| n.transpose(2) } end s.parts["bass"] = Part.new(Dynamics::MP) do |p| riff = "/6Bb2 /4 /3Ab2 /6F2 /12Ab2 \ /6Bb2 /4 /3Ab2 /4Ab2".to_notes p.notes = riff + riff.map {|n| n.transpose(2) } 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
music-transcription-0.20.0 | examples/hip.rb |
music-transcription-0.19.0 | examples/hip.rb |