Sha256: 5eb8dd5fc864c1a5b1c9c8eeeb52eaa8fd765166f7c8513345d964293b20aa45

Contents?: true

Size: 1.87 KB

Versions: 6

Compression:

Stored size: 1.87 KB

Contents

require 'music-transcription'
require 'yaml'

include Music::Transcription
include Pitches

score = Score.new(
  Meter.new(4,"1/4".to_r),
  120,
  program: Program.new([ 0...4.0, 0...4.0 ]),
  parts: {
    1 => Part.new(
      Dynamics::MF,
      notes: [
        Note::DottedQuarter.new([C2]),
        Note::Quarter.new([Eb2]),
        Note.new("5/16".to_r,[F2]),
        Note.new("1/16".to_r, [Eb2]),
        # 1.0
        Note::Eighth.new,
        Note::Quarter.new([C2]),
        Note::Quarter.new([Eb2]),
        Note::DottedQuarter.new,
        # 2.0
        Note::DottedQuarter.new([C2]),
        Note::Quarter.new([Eb2]),
        Note.new("5/16".to_r,[F2]),
        Note.new("1/16".to_r, [Eb2]),
        # 3.0
        Note::Eighth.new,
        Note::Quarter.new([C2]),
        Note::Quarter.new([Eb2]),
      ]
    ), 
    2 => Part.new(
      Dynamics::MF,
      notes: [
        # 0.0
        Note::Eighth.new,
        Note::Eighth.new([Bb3]),
        Note::Eighth.new([Bb3]),
        Note::Eighth.new([Bb3]),
        Note::Eighth.new([Bb3]),
        Note::Quarter.new([C4]),
        Note::Quarter.new([A3]),
        Note::Eighth.new([G3]),
        Note::Eighth.new([F3]),
        Note.new("5/16".to_r, [G3], links: { G3 => Link::Slur.new(F3) }),
        Note.new("1/16".to_r, [F3], links: { F3 => Link::Slur.new(E3) }),
        Note::Eighth.new([E3]),
        Note::Eighth.new,
        # 2.0
        Note::Eighth.new,
        Note::Eighth.new([Bb3]),
        Note::Eighth.new([Bb3]),
        Note::Eighth.new([Bb3]),
        Note::Eighth.new([Bb3]),
        Note::Quarter.new([C4]),
        Note::Eighth.new([A3]),
        Note::Eighth.new([E4]),
        Note::Eighth.new([E4], links: { E4 => Link::Slur.new(D4) }),
        Note::Eighth.new([D4], links: { D4 => Link::Slur.new(C4) }),
        Note::Eighth.new([C4]),
      ]
    )
  }
)

File.open("song1.yml", "w") do |file|
  file.write score.to_yaml
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
music-transcription-0.8.1 examples/make_song1.rb
music-transcription-0.8.0 examples/make_song1.rb
music-transcription-0.7.3 examples/make_song1.rb
music-transcription-0.7.2 examples/make_song1.rb
music-transcription-0.7.1 examples/make_song1.rb
music-transcription-0.7.0 examples/make_song1.rb