public class Cwn_to_sig extends Object
Score_cwn
object.
Given a file name stem like "XXX" it generates one binary file with name "XXX_VVV.sig" and
one logically identical text file "XXX_VVV.sig.text" for each voice named "VVV".
If there are more than one "PART" in the original file, the names will be
"XXX_PPP_VVV.sig" and "XXX_PPP_VVV.sig.text".
The data is a table = a sequence of tuple, with the following format:
CURRENTLY the .sig file can be played by TestMonodic
(cf Score_hkn_sig_v00)
Modifier and Type | Field and Description |
---|---|
protected float |
articulation_minpause_msec
Minimal pause in milliseconds between adjacent events with different pitch.
|
protected float |
articulation_minpause_percent
Minimal pause between adjacent events with different pitch, in percent of the
duration of the earlier of both.
|
(package private) float |
currentFreq
Local register to let a PAUSE carry on the frequency of the preceding sound.
|
static float |
default_articulation_minpause_msec
Minimal pause in milliseconds between adjacent events with different pitch.
|
static float |
default_articulation_minpause_percent
Minimal pause between adjacent events with different pitch, in percent of the
duration of the earlier of both.
|
static float |
default_repetition_articulation_minpause_msec
Minimal pause in milliseconds between adjacent events with the same pitch.
|
static float |
default_repetition_articulation_minpause_percent
Minimal pause between adjacent events with the same pitch, in percent of the
duration of the earlier of both.
|
protected int |
eventNumber
The current event numberwhen the conversion process steps through the score.
|
protected String |
filenamestem
The prefix of the names of the generated files.
|
static float |
FINAL_SILENCE_MSEC
Length of a pause appended to each score.
|
protected String |
generationDate
Calendaric date of generation, to be integrated into comment.
|
static float |
HALFTONE
Frequency factor of a halftone in equal distance tempered tuning.
|
protected BigDecimal |
measureNumber
The current mesaure number when the conversion process steps through the score.
|
static Tempo |
mm60
Default tempo 1/4=60
|
protected float |
msec_per_whole
Gives the current tempo when the conversion process steps through the score.
|
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> |
msg
Drain of all generated messages.
|
static String |
NOTONE
Name printed for the pitch in table lines reralizing a pause = no sound.
|
protected File |
outDir
Where to put the result files.
|
protected float |
repetition_articulation_minpause_msec
Minimal pause in milliseconds between adjacent events with the same pitch.
|
protected float |
repetition_articulation_minpause_percent
Minimal pause between adjacent events with the same pitch, in percent of the
duration of the earlier of both.
|
protected Score_cwn |
score
The score to convert.
|
static String |
sig_text_column_header
Comment in the first line of the text file, containing the column headerss.
|
static String |
sig_text_eof
Last line in the text file
|
static String |
sig_text_header
Initial comment for text file.
|
Constructor and Description |
---|
Cwn_to_sig(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg,
Score_cwn score,
String filenamestem,
File outDir)
Convert one Score_cwn instance into a binray files to be played by a sig sequencer
plus its text variant.
|
Modifier and Type | Method and Description |
---|---|
void |
convert()
Execute the conversion.
|
(package private) void |
convertOneVoice(Vox voice)
Create a new binary and a new text file and write to both the event data of the
voice object.
|
static void |
main(String[] args)
Test method, translates input file "arg[0]" to sig output files
in directory "arg[1"].
|
protected float |
note_duration_to_msec(RationalDuration.DottedBaseDuration db)
Convert a CWN duration to msecs, according to the current tempo.
|
static float |
pitch_to_sig(OctaveRegister oct,
FunctionalPitchModOctave p)
Convert functional pitch into frequency value according to equal distance tempered tuning.
|
static float |
pitch_to_sig(PitchAndOctave<OctaveRegister,FunctionalPitchModOctave> ap)
Convert functional pitch into frequency value according to equal distance tempered tuning.
|
protected float |
rat_to_msec(Rational duration)
Convert a CWN duration to msecs, according to the current tempo.
|
protected void |
setMM(int mm)
Set the tempo as the count of CWN "1/4" note durations per physical/calendaric minute.
|
protected void |
setMM(Tempo tempo)
Set the tempo.
|
(package private) void |
writeEvent(Event e,
float msec_start,
@Opt Event next_e,
float next_msec_start,
int trigger,
PrintWriter txt,
DataOutputStream dos)
Write one event (sound or pause) to the two output files.
|
(package private) void |
writePause(float dura,
int trigger,
PrintWriter txt,
DataOutputStream dos)
Write a pause which is characterized by a "gate==0".
|
(package private) void |
writeSound(float ontime,
float offtime,
String pitchname,
int trigger,
int intensity,
PrintWriter txt,
DataOutputStream dos)
Write a sounding event, with pitch, weight, etc.
|
protected final MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg
protected final Score_cwn score
protected final String filenamestem
protected final File outDir
protected String generationDate
protected float msec_per_whole
public static final float default_articulation_minpause_msec
public static final float default_articulation_minpause_percent
protected float articulation_minpause_msec
protected float articulation_minpause_percent
public static final float default_repetition_articulation_minpause_msec
public static final float default_repetition_articulation_minpause_percent
protected float repetition_articulation_minpause_msec
protected float repetition_articulation_minpause_percent
protected BigDecimal measureNumber
protected int eventNumber
public static float FINAL_SILENCE_MSEC
public static final String sig_text_header
public static final String sig_text_column_header
public static final String sig_text_eof
public static Tempo mm60
public static final float HALFTONE
public static final String NOTONE
float currentFreq
public Cwn_to_sig(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Score_cwn score, String filenamestem, File outDir)
msg
- drain of all messagesscore
- the data to convertfilenamestem
- the stem to generate the names of the output filesoutDir
- where to generate the output filesprotected void setMM(int mm)
protected void setMM(Tempo tempo)
protected float note_duration_to_msec(RationalDuration.DottedBaseDuration db)
protected float rat_to_msec(Rational duration)
public static float pitch_to_sig(PitchAndOctave<OctaveRegister,FunctionalPitchModOctave> ap)
public static float pitch_to_sig(OctaveRegister oct, FunctionalPitchModOctave p)
public void convert()
convertOneVoice(Vox)
for every voice contained in the Score_cwn.
(For the one and only metric voice this will do nothing.)
If the score data does not contain tempo information,mm60
will be
used.void writePause(float dura, int trigger, PrintWriter txt, DataOutputStream dos) throws IOException
IOException
void writeSound(float ontime, float offtime, String pitchname, int trigger, int intensity, PrintWriter txt, DataOutputStream dos) throws IOException
IOException
void writeEvent(Event e, float msec_start, @Opt @Opt Event next_e, float next_msec_start, int trigger, PrintWriter txt, DataOutputStream dos) throws IOException
IOException
void convertOneVoice(Vox voice)
public static void main(String[] args)