public class Cwn_to_midi extends Object
Score_cwn
object.
Usage: construct an instance and call writeToTrack(Iterator,int,Track)
.
Modifier and Type | Field and Description |
---|---|
protected Rational |
RAT_ticksPerRationalOne
ticksPerRationalOne as a Rational. |
protected int |
repetition_articulation_gap |
protected Score_cwn |
score
The Score_cwn (corresponding to a tscore PART), which is rendered by
the subsequent calls to
writeToTrack(Iterator,int,Track) . |
protected Sequence |
sequence
The one and only midi sequence object filled successively by this converter.
|
protected int |
ticksPerRationalOne
How many "midi ticks" fall into one CWN "whole note", which corresponds to the
Rational duration "1/1".
|
Constructor and Description |
---|
Cwn_to_midi(Score_cwn score,
int ticksPerRationalOne)
Usage: construct an instance with one Score_cwn, then
for each voice call
createTrack() and
writeToTrack(Iterator,int,Track) . |
Modifier and Type | Method and Description |
---|---|
Track |
createTrack()
Return a newly constructed midi Track object in the (overall) midi Sequence object
of this converter.
|
Sequence |
getSequence()
Return the one and only Sequence object of this converter.
|
static void |
main(String[] args)
Test method, translates input file "arg[0]" to midi output file "arg[1]".
|
void |
writeToTrack(Iterator<Event> data,
int channelNumber,
Track track)
Encode the sequence of events as given by "data" into the
midi Track object given by "track".
|
protected final int ticksPerRationalOne
protected final Rational RAT_ticksPerRationalOne
ticksPerRationalOne
as a Rational.protected final Sequence sequence
createTrack()
and will be filled by
writeToTrack(Iterator,int,Track)
.protected final Score_cwn score
writeToTrack(Iterator,int,Track)
.protected int repetition_articulation_gap
public Cwn_to_midi(Score_cwn score, int ticksPerRationalOne) throws InvalidMidiDataException
createTrack()
and
writeToTrack(Iterator,int,Track)
.
The final result is retrieved by getSequence()
.InvalidMidiDataException
public void writeToTrack(Iterator<Event> data, int channelNumber, Track track) throws InvalidMidiDataException
IF Sequence.getDivisionType() = PPQ = Pulse Per Quarter
THEN all timing info is given in "notation time". The effectice physical
time results from the current "musical tempo", which is "quarters per second" or sim.
ATTENTION assume "Hold" events are normalized.
FIXME artikulation: verkürzung / legato-erkennung etc. fehlt
InvalidMidiDataException
public Track createTrack()
public Sequence getSequence()
Track
objects. It can be written to a
disk file as a whole (by MidiSystem.write(Sequence,int,File)
),
or be given to some Midi player software as input data, etc.public static void main(String[] args) throws InvalidMidiDataException
InvalidMidiDataException