examples/make_missed_connection.rb in music-transcription-0.10.0 vs examples/make_missed_connection.rb in music-transcription-0.11.0
- old
+ new
@@ -2,65 +2,20 @@
require 'yaml'
include Music::Transcription
include Pitches
include Articulations
+include Meters
+include Parsing
-score = Score.new(
- Meter.new(4,"1/4".to_r),
- 120,
- program: Program.new([0...8.0]),
- parts: {
- "bass" => Part.new(
- Dynamics::MF,
- notes: [
- # 0.0
- Note::quarter([Eb2]),
- Note::quarter,
- Note::quarter([Bb2]),
- Note::quarter,
- Note::quarter([Eb2]),
- Note::eighth,
- Note::eighth([B2]),
- Note::quarter([Bb2]),
- Note::quarter([Ab2]),
-
- # 2.0
- Note::quarter([Eb2]),
- Note::quarter,
- Note::quarter([Bb2]),
- Note::quarter,
- Note::quarter([Eb2]),
- Note::eighth,
- Note::eighth([B2]),
- Note::quarter([Bb2]),
- Note::quarter([Ab2]),
-
- # 4.0
- Note::quarter([Bb2]),
- Note::eighth,
- Note::eighth([F3], articulation: SLUR),
- Note::half([F3]),
- Note::quarter([Bb2]),
- Note::eighth,
- Note::eighth([F3], articulation: SLUR),
- Note::half([F3]),
-
- # 6.0
- Note::quarter([B2]),
- Note::eighth,
- Note::eighth([Gb3], articulation: SLUR),
- Note::half([Gb3]),
- Note::quarter([B2]),
- Note::eighth,
- Note::eighth([Gb3], articulation: SLUR),
- Note::half([Gb3]),
-
- #8.0
- ]
- )
- }
-)
+score = Score.new(FOUR_FOUR, 120) do |s|
+ s.program = Program.new([0..2,0..6])
+ s.parts["bass"] = Part.new(Dynamics::MF) do |p|
+ p.notes = notes("/4Eb2 /4 /4Bb2 /4 /4Eb2 /8 /8B2 /4Bb2 /4Ab2")
+ p.notes += notes("/4Bb2 /8 /8F3= /2F3 /4Bb2 /8 /8F3= /2F3")
+ p.notes += notes("/4B2 /8 /8Gb3= /2Gb3 /8 /8Gb3= /2Gb3")
+ end
+end
File.open("missed_connection.yml", "w") do |file|
file.write score.to_yaml
end