public class NoteFileWriter
extends java.lang.Object
NoteFileWriter
is used to generate note files, as used by
Temperley's model. These are files of the format:
Note 0 1000 60
Where that line would represent a middle C which starts at time 0 and ends at time 1000 (measured in milliseconds). The resulting output will be shifted such that any anacrusis is now built into the file. That is, the first measure is extended with rests so that it becomes a full measure.It does not actually write this out to a File. Rather, it returns the String via it's toString method. Thus, it can be used to either write to a File or to print out to std out, like so:
System.out.println(new NoteFileWriter(tt, nlg));
Modifier and Type | Field and Description |
---|---|
private NoteListGenerator |
nlg
The NoteListGenerator which contains the notes we want to write out.
|
private int |
offsetLength
The offset to add to each note, in milliseconds, to adjust for the anacrusis.
|
Constructor and Description |
---|
NoteFileWriter(TimeTracker tt,
NoteListGenerator nlg)
Create a new NoteFileWriter with the given TimeTracker and NoteListGenerator.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString() |
private int offsetLength
private NoteListGenerator nlg
public NoteFileWriter(TimeTracker tt, NoteListGenerator nlg)
tt
- The TimeTracker to use to get the correct anacrusis offsetLength
.nlg
- The NoteListGenerator containing the notes we want to write out.