Basic data structures for holding symbolic music information.
Basic SMucK note object carrying information about the note's onset, duration, pitch, and velocity. To be used in score importing, generating, editing, and playback.
ezNote()
Default constructor, creates a note with onset 0, duration 1, pitch 60, and velocity 1.0.
ezNote(float onset, float beats, float pitch, float velocity)
Constructor for ezNote specifying onset, beats, pitch, and velocity.
ezNote(string sm_input)
Constructor for ezNote using a SMucKish input string.
float beats()
Get the duration of the note in beats.
float beats(float value)
Set the duration of the note in beats.
ezNote copy()
Return a copy of the ezNote.
float[] data()
Get the user-defined data associated with the note.
float[] data(float[] value)
Set the user-defined data associated with the note, using a float array.
float data(int index)
Get the user-defined data associated with the note, using an index.
float data(int index, float value)
Set the user-defined data associated with the note, using an index.
int isRest()
Return whether the note is a rest.
int isRest(int value)
Set whether the note is a rest.
float onset()
Get the onset of the note in beats, relative to the start of the measure.
float onset(float value)
Set the onset of the note in beats, relative to the start of the measure.
float pitch()
Get the pitch of the note as a MIDI note number.
float pitch(float value)
Set the pitch of the note as a MIDI note number.
void print()
Print the note parameters.
string text()
Get the text annotation associated with the note.
string text(string value)
Set the text annotation associated with the note.
float velocity()
Get the velocity of the note.
float velocity(float value)
Set the velocity of the note.
[ top ]
SMucK measure object. An ezMeasure object contains one or more ezNotes. Note contents can be set using the SMucKish input syntax.
ezMeasure()
Default constructor, creates an empty measure.
ezMeasure(string input)
Create an ezMeasure from a SMucKish input string.
void add(ezNote note)
Add an ezNote to the measure.
void add(ezNote[] notes)
Add an array of ezNotes to the measure.
float beats()
Get the length of the measure in beats.
ezMeasure copy()
Return a copy of the ezMeasure.
ezNote[] notes()
Get the notes in the measure as an ezNote array.
ezNote[] notes(ezNote[] notes)
Set the notes of the measure using an ezNote array.
float[][] pitches()
Get the pitches of the notes in the measure as a 2D array of MIDI note numbers.
float[][] pitches(string input)
Set the pitches of the notes in the measure, using a SMucKish input string.
float[][] pitches(string[] input)
Set the pitches of the notes in the measure, using an array of SMucKish string tokens.
float[][] pitches(float[][] input)
Set the pitches of the notes in the measure directly from a 2D array of MIDI note numbers.
void print()
Print the parameters for each note in the measure.
void rest()
Set all notes to rests.
float[] rhythms()
Get the rhythms of the notes in the measure as an array of floats.
float[] rhythms(string input)
Set the rhythms of the notes in the measure, using a SMucKish input string.
float[] rhythms(string[] input)
Set the rhythms of the notes in the measure, using an array of SMucKish string tokens.
float[] rhythms(float[] input)
Set the rhythms of the notes in the measure directly from an array of floats.
void sort()
Sort the notes array in place by onset time.
float[] velocities()
Get the velocities of the notes in the measure as an array of floats.
float[] velocities(string input)
Set the velocities of the notes in the measure, using a SMucKish input string.
float[] velocities(string[] input)
Set the velocities of the notes in the measure, using an array of SMucKish string tokens.
float[] velocities(float[] input)
Set the velocities of the notes in the measure directly from an array of floats.
[ top ]
SMucK part object. An ezPart object contains one or more ezMeasures. Measure contents can be set using the SMucKish input syntax, or when importing a MIDI file into an ezScore object.
ezPart()
Default constructor, creates an empty part.
ezPart(string input)
Create an ezPart from a SMucKish input string.
ezPart(string[] input)
Create an ezPart from an array of SMucKish input strings.
ezPart(ezMeasure[] new_measures)
Create an ezPart from an array of ezMeasure objects.
void add(ezMeasure measure)
Add an ezMeasure to the part.
void add(ezMeasure[] new_measures)
Add an array of ezMeasures to the part.
ezPart copy()
Return a copy of the ezPart.
ezPart copy(int index, int length)
Return a copy of the ezPart that has a subset of the measures.
void duplicate(int index, int length, int n)
Duplicate a range of measures n times.
void duplicate(int index, int n)
Duplicate a measure n times.
void erase(int index)
Erase an ezMeasure from the part at a given index.
void erase(int index, int length)
Erase a range of ezMeasures from the part.
void insert(int index, ezMeasure new_measure)
Insert an ezMeasure into the part at a given index.
void insert(int index, string input)
Insert an ezMeasure into the part at a given index, using a SMucKish input string.
void insert(int index, ezMeasure[] new_measures)
Insert an array of ezMeasures into the part at a given index.
void insert(int index, string[] inputs)
Insert an array of ezMeasures into the part at a given index, using an array of SMucKish input strings.
ezMeasure[] measures()
Get the measures in the part, as an ezMeasure array.
ezMeasure[] measures(ezMeasure[] measures)
Set the measures in the part, using an ezMeasure array.
void print()
Print the part.
void replace(int index, ezMeasure new_measure)
Replace an ezMeasure in the part at a given index with a new ezMeasure.
void replace(int index, string input)
Replace an ezMeasure in the part at a given index with a new ezMeasure, using a SMucKish input string.
void replace(int index, ezMeasure[] new_measures)
Replace a range of ezMeasures in the part with an array of new ezMeasures.
void replace(int index, int length, ezMeasure[] new_measures)
Replace a range of ezMeasures in the part with an array of new ezMeasures.
void replace(int index, int length, string[] inputs)
Replace a range of ezMeasures in the part with new ezMeasures, using an array of SMucKish input strings.
void replace(int index, string[] inputs)
Replace a range of ezMeasures in the part with new ezMeasures, using an array of SMucKish input strings.
void rest(int index)
Turn all notes in a measure at a given index into rests.
void rest(int index, int length)
Turn all notes in a range of measures into rests.
[ top ]
SMucK score object. An ezScore object contains one or more ezParts. Score contents can be set using the SMucKish input syntax, or by importing a MIDI file. ezScore objects can be passed to an ezScorePlayer object for playback.
ezScore()
Default constructor, creates an empty score.
ezScore(string input)
Create an ezScore from a SMucKish input string or MIDI file. If the input argument is a MIDI filename (ending in .mid), the MIDI file is imported. Otherwise, the input string is interpreted as a SMucKish input string.
ezScore(string input, float bpm)
Create an ezScore from a SMucKish input string or MIDI file, with a specified BPM.
ezScore(ezPart[] new_parts)
Create an ezScore from an array of ezPart objects.
void add(ezPart part)
Add an ezPart to the score.
void add(string input)
Add an ezPart to the score, using a SMucKish input string.
void add(ezPart[] new_parts)
Add multiple ezParts to the score, using an array of ezParts.
void add(string[] inputs)
Add multiple ezParts to the score, using an array of SMucKish strings.
float beats()
Get the end of the score in beats (the last note's release point)
float bpm(float value)
Set the tempo in BPM (beats per minute) for the score.
float bpm()
Get the tempo in BPM (beats per minute) for the score.
dur duration()
Get the duration of the score in milliseconds.
int maxPolyphony(int part)
Get the maximum polyphony for a given part.
ezPart[] parts()
Get the parts for the score as an ezPart array.
ezPart[] parts(ezPart[] parts)
Set the parts for the score, using an ezPart array.
void read(string filename)
Read a MIDI file into the ezScore object.
[ top ]