LISTMIDI->CROSS
Arguments: midifiles &optional legatime arpegtime releastime staccatime toltime [generic-function]
Transforms the outputs of MidiFiles into a pitch/duration Cross-Alphabet sequence.
input : a list of midi-info lists from mf-info boxes.
an integer or nil : maximum legato time, in ms. if nil : no time constraints for legato filter. an integer : minimum arpegio time, in ms. an integer or nil : maximum release synchro time, in ms. if nil : infinite release-synchro. an integer or nil : maximum staccato time, in ms. if nil : no time constraints for staccato filter. an integer : time tolerance of quantization, in percent.
output : a list of polyphonic slices.
The cross-alphabet sequence is a list containing sublists of the form : (... ((c1 c2 ... cn) d) ...)
where the ci are either 0 (empty canal) or a list of the form (p1 p2 ... pm)
where the pi are pitches in midicents
and d is a duration in ms.
Each of this sublist encodes a polyphonic slice, containing a set of canals - which are sets of superposed pitches -
and lasting for a certain duration. The concatenation of all these slices
is musically equal to the original midi sequence.
where the ci are either 0 (empty canal) or a list of the form (p1 p2 ... pm)
where the pi are pitches in midicents
and d is a duration in ms.
Each of this sublist encodes a polyphonic slice, containing a set of canals - which are sets of superposed pitches -
and lasting for a certain duration. The concatenation of all these slices
is musically equal to the original midi sequence.
This representation captures the essentials of the polyphonic/rythmic structure of
the midifile. It is thus convenient to be given as input to the LZify function
if you want to build a statistical model of a polyphonic piece from a midifile.
If you use then LZgenerate or its variants to generate an improvisation of the piece, you'll get again
a pitch/duration cross-alphabet sequence. Then you'll need a function such as cross-
to put your data back into a musical form.
the midifile. It is thus convenient to be given as input to the LZify function
if you want to build a statistical model of a polyphonic piece from a midifile.
If you use then LZgenerate or its variants to generate an improvisation of the piece, you'll get again
a pitch/duration cross-alphabet sequence. Then you'll need a function such as cross-
to put your data back into a musical form.
Filters are designed to simplify the alphabet of symbols and the dictionnary of patterns :
- Each time a new note is activated, the legato filter inspects the continuation of the sequence
until the release of this note or until <legatime> msec. Any note that has been activated before
the new note and that is released during the inspected part will then be released just when the
new note is activated. Therefore, this filter discards intermediate states where two juxtaposed
notes are superimposed during a very short time.
the new note and that is released during the inspected part will then be released just when the
new note is activated. Therefore, this filter discards intermediate states where two juxtaposed
notes are superimposed during a very short time.
- Each time a new note is activated, the arpeggio filter inspects the continuation of the sequence
until <arpegtime> msec. Any note that was due to be activated during the inspected part will in
fact be activated just when the former note is activated. Thus, this filter synchronizes arpeggios.
fact be activated just when the former note is activated. Thus, this filter synchronizes arpeggios.
- Each time a note is released, the release synchro filter synchronizes all the following releases
- until the activation of a new note or until <releastime> msec - at the date of the first release.
Thus, this filter synchronizes note releases.
- The staccato filter removes each release period, between two played periods, that lasts less than
<staccatime> msec.
Finally, the duration of each symbol is quantified with the help of an OMKant Library function :
make-regular. This function accepts one particular parameter, here <toltime>, which specifies the
percentage of error that is tolerated during the quantization.
make-regular. This function accepts one particular parameter, here <toltime>, which specifies the
percentage of error that is tolerated during the quantization.