Package eu.bandm.music.top
Class Cwn_to_midi
java.lang.Object
eu.bandm.music.top.Cwn_to_midi
Creates a simple midi file output, based on the javax.sound.midi runtime classes
for one tscore "PART" component of one
FIXME Still missing:
Score_cwn
object.
Usage: construct an instance and call writeToTrack(Iterator,int,Track)
.
FIXME Still missing:
- articulation
- intensity
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Rational
ticksPerRationalOne
as a Rational.protected int
protected final Score_cwn
The Score_cwn (corresponding to a tscore PART), which is rendered by the subsequent calls towriteToTrack(Iterator,int,Track)
.protected final Sequence
The one and only midi sequence object filled successively by this converter.protected final int
How many "midi ticks" fall into one CWN "whole note", which corresponds to the Rational duration "1/1". -
Constructor Summary
ConstructorDescriptionCwn_to_midi
(Score_cwn score, int ticksPerRationalOne) Usage: construct an instance with one Score_cwn, then for each voice callcreateTrack()
andwriteToTrack(Iterator,int,Track)
. -
Method Summary
Modifier and TypeMethodDescriptionReturn a newly constructed midi Track object in the (overall) midi Sequence object of this converter.Return the one and only Sequence object of this converter.static void
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".
-
Field Details
-
ticksPerRationalOne
protected final int ticksPerRationalOneHow many "midi ticks" fall into one CWN "whole note", which corresponds to the Rational duration "1/1". -
RAT_ticksPerRationalOne
ticksPerRationalOne
as a Rational. -
sequence
The one and only midi sequence object filled successively by this converter. Is constructed when this converter is constructed, and holds all the Track objects which will be constructed bycreateTrack()
and will be filled bywriteToTrack(Iterator,int,Track)
. -
score
The Score_cwn (corresponding to a tscore PART), which is rendered by the subsequent calls towriteToTrack(Iterator,int,Track)
. -
repetition_articulation_gap
protected int repetition_articulation_gap
-
-
Constructor Details
-
Cwn_to_midi
Usage: construct an instance with one Score_cwn, then for each voice callcreateTrack()
andwriteToTrack(Iterator,int,Track)
. The final result is retrieved bygetSequence()
.- Throws:
InvalidMidiDataException
-
-
Method Details
-
writeToTrack
public void writeToTrack(Iterator<Event> data, int channelNumber, Track track) throws InvalidMidiDataException Encode the sequence of events as given by "data" into the midi Track object given by "track".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
- Throws:
InvalidMidiDataException
-
createTrack
Return a newly constructed midi Track object in the (overall) midi Sequence object of this converter. -
getSequence
Return the one and only Sequence object of this converter. In this, all cwn data will be encoded in singleTrack
objects. It can be written to a disk file as a whole (byMidiSystem.write(Sequence,int,File)
), or be given to some Midi player software as input data, etc. -
main
Test method, translates input file "arg[0]" to midi output file "arg[1]".- Throws:
InvalidMidiDataException
-