lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Has anyone in this group ever worked on the midi internals?


From: Michael Welsh Duggan
Subject: Re: Has anyone in this group ever worked on the midi internals?
Date: Sun, 03 Apr 2016 01:49:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.91 (gnu/linux)

"Redwood (Daniel)" <address@hidden> writes:

> It looks like the primary work was done by Jan over 10 years
> ago. Since then, the changes seem such that no architectural
> understanding was required.
>
> Jan, are you available to advise? My goal is add in more details from
> the score to the midi output. This would include what articulate.ly
> does and more and better. That’s the goal.
>
> I see these files:
>
> ./lily/midi-stream.cc
> ./lily/include/midi-stream.hh
> ./lily/include/midi-item.hh
> ./lily/include/midi-chunk.hh
> ./lily/include/midi-walker.hh
> ./lily/midi-control-function-performer.cc
> ./lily/midi-walker.cc
> ./lily/midi-item.cc
> ./lily/.midi-chunk.cc.swp
> ./lily/midi-chunk.cc
> ./scm/midi.scm
> ./python/midi.c
> ./ly/midi-init.ly
>
> Along with many supporting midi scripts and so on. From what I can see
> every level of source, from .ly to .scm to .cc is involved (but that
> may be true of everything in lilypond). I’m an experienced C++
> programmer, with a dabbling knowledge of Lisp, and a user’s knowledge
> of .ly.
>
> There’s a lot to penetrate. I’m trying to get a sense of the flow of
> events, and some advice would mean a lot. Perhaps Jan no longer
> recalls the architecture for midi?

It's been years since I last looked at the midi code.  (I looked at it
in depth one time to try to add a fix for handling when the same note is
played twice with different durations with the same instrument {happens
all the time in piano scores}.)  You will want to add to your list all
of the files that begin with audio as well.  The other files you want to
look at is performers.  Specifically, as the printed output of lilypond
is done with engravers, the audio output is done with performers.

Performer contexts can be found in ly/performer-init.ly.  Performers and
engravers are both translators.  There are people on this list who can
explain better than I can (from the engraver perspective) how
translators work.

The Score_performer creates Audio_columns, and fills them with
Audio_items.  Audio_items include dynamics, keys, notes, instruments,
etc.  The Midi_walker (called from Audio_staff::output) walks through
the audio_items and processes them to produce a Midi_track (See
midi-chunk). 

Hopefully some part of this will help you get started.

-- 
Michael Welsh Duggan
(address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]