|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jmsl.score.NoteFactory
public class NoteFactory
NoteFactory
Feed in a double duration and get out a Note. Durations this handles include WHOLE, QUARTER ...
64th, 128th, as well as their single dotted versions, and their 3, 5, 7, and 11 tuplets
JMSL Notation Project
Field Summary | |
---|---|
static java.lang.String |
copyright
|
static int |
LEVEL_OF_MIDDLE_C
|
static int |
MIDDLE_C
|
Constructor Summary | |
---|---|
NoteFactory()
|
Method Summary | |
---|---|
static void |
calcAndSetDurationData(Note note,
int coreDur,
int tuplet,
int dots)
Calc duration based on a core duration 0..7, tuplet, and # dots |
static void |
calcAndSetNoteHeadStemTailInfo(Note note,
int coreDur)
Based on the core duration 0..8, set the notehead type, stem info and number of tails for a note . |
static int |
calcLevel(Staff staff,
double pitch)
calculate the level on the staff for pitch and staff. |
static double |
findClosestDur(double dur)
compare dur argument to each duration in NoteHashTable's keys. |
static java.util.Hashtable |
getNoteHashTable()
|
static void |
init()
Builds HashTable of double precision durations mapped to notes. |
static boolean |
isIntervalWithoutAccidental(int interval)
|
static boolean |
isMultiTrack(Note note)
|
static void |
main(java.lang.String[] args)
|
static Note |
makeNote(DimensionNameSpace dns,
double[] data)
Clone a new note with closest duration. |
static Note |
makeNote(double dur)
Clone and return a new Note whose duration matches the argument. |
static Note |
makeNote(double[] data)
Clone a new note with closest duration. |
static Note |
makeNote(double dur,
double midipitch,
double vel,
double hold)
|
static Note |
makeNote(int coreDuration,
double pitch,
int tuplet,
int numDots)
Make a Note |
static Note |
makeNote(int coreDur,
int tuplet,
int dots,
int accInfo,
int level,
Clef clef)
Build a note based on duration, tuplet, #dots, level on staff, and accidental. |
static boolean |
noteExistsForDuration(double dur)
|
static void |
setLevelPitch(Note note,
double pitch)
Major workhorse. |
static double |
truncPrecision(double value)
truncate precision of arg to 5 decimal places. |
static void |
update(Note note)
Given a Note, update its properties based on its pitch and duration data, one or both of which might have changed algoruthmically. |
static void |
updateFromDur(Note note)
Given a Note, update its properties based on its double duration data. |
static void |
updateFromPitch(Note note)
Given a Note, calc and set the level on the staff where it should be drawn based on its pitch. |
static boolean |
useQuarterToneAccidentals()
if true, pitches equal to int+0.5 will be assigned a quarter tone accidental |
static void |
useQuarterToneAccidentals(boolean useQuarterToneAccidentals)
if true, pitches equal to int+0.5 will be assigned a quarter tone accidental |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MIDDLE_C
public static final int LEVEL_OF_MIDDLE_C
public static final java.lang.String copyright
Constructor Detail |
---|
public NoteFactory()
Method Detail |
---|
public static void init()
public static double truncPrecision(double value)
public static boolean isIntervalWithoutAccidental(int interval)
public static void calcAndSetDurationData(Note note, int coreDur, int tuplet, int dots)
public static java.util.Hashtable getNoteHashTable()
public static Note makeNote(double dur)
public static Note makeNote(double[] data)
public static Note makeNote(DimensionNameSpace dns, double[] data)
public static Note makeNote(double dur, double midipitch, double vel, double hold)
public static Note makeNote(int coreDuration, double pitch, int tuplet, int numDots)
coreDuration
- is an index 0..7 standing for WHOLE, HALF, QUARTER, EIGHTH, 16TH, 32ND, 64, 128THpitch
- is midi style, where 60 == middle Ctuplet
- is an int where 3 is triplet for examplenumDots
- is 0, 1, or 2
public static boolean noteExistsForDuration(double dur)
public static double findClosestDur(double dur)
public static void update(Note note)
public static void updateFromDur(Note note)
public static Note makeNote(int coreDur, int tuplet, int dots, int accInfo, int level, Clef clef)
public static void updateFromPitch(Note note)
public static int calcLevel(Staff staff, double pitch)
public static void setLevelPitch(Note note, double pitch)
public static boolean isMultiTrack(Note note)
public static void calcAndSetNoteHeadStemTailInfo(Note note, int coreDur)
public static void main(java.lang.String[] args)
public static boolean useQuarterToneAccidentals()
public static void useQuarterToneAccidentals(boolean useQuarterToneAccidentals)
useQuarterToneAccidentals
- The useQuarterToneAccidentals to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |