Not the kind of solution you wanted, but you can generate ordinary midi 
output with \midi { } like:

\version "2.25.1"

\score {
  \new Staff {
    \new Voice \with {
    } {
      \clef treble \key c \major \time 4/4
      c'4 d'4 e'4 f'4 |
      g'4 a'4 g'2 |
    }
  }
  \midi { }
}

and then examine the resulting midi file, e.g. with:

 https://aspodata.se/git/musik/bin/midi.pl

and get:

$ midi.pl tt.midi 
MIDI::Opus->new({
  'format' => 1,
  'ticks'  => 384,
  'tracks' => [   # 2 tracks...

    # Track #0 ...
    MIDI::Track->new({
      'type' => 'MTrk',
      'events' => [  # 5 events.
        ['text_event', 0, 'creator: '],
        ['text_event', 0, 'LilyPond 2.25.1               '],
        ['time_signature', 0, 4, 2, 24, 8],
        ['set_tempo', 0, 1000000],
        ['end_track', 3072],
      ]
    }),
    
    # Track #1 ...
    MIDI::Track->new({
      'type' => 'MTrk',
      'events' => [  # 16 events.
        ['key_signature', 0, 0, 0],
        ['note_on', 0, 0, 60, 90],
        ['note_on', 384, 0, 60, 0],
        ['note_on', 0, 0, 62, 90],
        ['note_on', 384, 0, 62, 0],
        ['note_on', 0, 0, 64, 90],
        ['note_on', 384, 0, 64, 0],
        ['note_on', 0, 0, 65, 90],
        ['note_on', 384, 0, 65, 0],
        ['note_on', 0, 0, 67, 90],
        ['note_on', 384, 0, 67, 0],
        ['note_on', 0, 0, 69, 90],
        ['note_on', 384, 0, 69, 0],
        ['note_on', 0, 0, 67, 90],
        ['note_on', 768, 0, 67, 0],
        ['end_track', 0],
      ]
    }),
    
  ]
});

If that is ok, you can change that program to give you the output you
want.

Regards,
/Karl Hammar



Reply via email to