|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jmsl.score.Note
public class Note
Note
A Note is a Playable object with dur/note/amp/hold info as well as graphic info.
JMSL Notation Project
Constructor Summary | |
---|---|
Note(int coreDur,
int tuplet,
int dots,
int accInfo)
|
|
Note(Track track,
double dur,
double pitch,
double vel,
double hold)
Constructor specifies playable info. |
Method Summary | |
---|---|
static java.lang.String |
accToString(int acc)
|
Note |
addInterval(double pitch)
Add an interval to this Note. |
Note |
addInterval(Note newNote)
add newNote as interval to this Note. |
void |
clearIntervals()
|
static Note |
cloneNote(Note n)
Make an exact copy of a Note. |
static void |
copyProperties(Note fromNote,
Note toNote)
Copy properties from one Note to another. |
static java.lang.String |
dynamicToString(int dynamic)
|
boolean |
endOf8va()
|
boolean |
endOf8vb()
|
boolean |
endOfCresc()
|
boolean |
endOfDecresc()
|
static boolean |
firstNoteOfLine(Note note)
|
boolean |
get8vaIn()
|
boolean |
get8vaOut()
|
boolean |
get8vbIn()
|
boolean |
get8vbOut()
|
int |
getAcc()
|
boolean |
getAccHidden()
|
int |
getAccPref()
Indicates Note's spelling preferences if it requires an accidental |
boolean |
getAltEnharmonicSpelling()
Flag determines if note uses alternate enharmonic spelling (ex E#, F##, Cb, Fbb, etc). |
boolean |
getBeamedOut()
|
int |
getCoreDuration()
Synonynmous with getNoteDur() |
boolean |
getCrescIn()
|
boolean |
getCrescOut()
|
double[] |
getData()
|
double |
getData(int dimension)
|
double[] |
getDataCopy()
Convenience method, shorthand for getData() and System.arraycopy() |
boolean |
getDecrescIn()
|
boolean |
getDecrescOut()
|
DimensionNameSpace |
getDimensionNameSpace()
|
double[] |
getDoubleArray()
synonym with getData() |
java.awt.Point |
getDrawingAnchor()
anchor is the horizontal note location |
double |
getDurationData()
|
int |
getDynamic()
|
Note |
getHandle()
|
static Note |
getHighest(Note n)
Assuming this Note is a chord, find the Note with the highest pitch. |
double |
getHoldData()
|
static int |
getIndexOfCoreDuration(double duration)
input: duration like 0.25 |
java.util.Vector |
getIntervals()
|
int |
getLevel()
|
static Note |
getLowest(Note n)
Assuming this Note is a chord, find the Note with the lowest pitch. |
int |
getMark()
|
int |
getMeasureIndex()
|
int |
getNoteDur()
|
double |
getNoteDurationAsPerformanceTime()
|
static double |
getNoteDurationAsPerformanceTime(int durConst)
|
int |
getNoteHeadType()
|
int |
getNoteIndex()
|
int |
getNumDots()
|
int |
getNumTails()
|
boolean |
getOverflow()
|
double[] |
getPerformanceData()
translate internal performance data based on expressive properties. |
double[] |
getPerformanceDataCopy()
translate internal performance data based on expressive properties. |
double |
getPitchData()
|
static Note |
getRoot(Note n)
Assuming this Note is a chord, find the Note with the lowest pitch. |
Score |
getScore()
|
boolean |
getSelected()
|
boolean |
getSlurredIn()
|
boolean |
getSlurredOut()
|
static Note[] |
getSortedChord(Note n)
Get an array containing this Note's intervals and handle in sorted order |
int |
getStaffIndex()
|
int |
getStemInfo()
Get stem info 0=no stem, 1=stem up, 2= stem down |
java.lang.String |
getText()
|
int |
getTextOffsetX()
horizontal text displacement |
int |
getTextOffsetY()
vertical text displacement |
boolean |
getTiedIn()
|
boolean |
getTiedOut()
|
Track |
getTrack()
|
int |
getTuplet()
|
double |
getVelData()
|
boolean |
isBeamable()
|
boolean |
isChord()
|
boolean |
isInterval()
|
boolean |
isMonoNote()
|
boolean |
isRest()
|
static boolean |
lastNoteOfLine(Note note)
|
static void |
main(java.lang.String[] args)
|
static java.lang.String |
markToString(int mark)
|
Note |
nextNote()
|
static boolean |
performExpressionMarks()
|
double |
play(double playTime,
Composable parent,
Instrument ins)
play() is called by MusicList. |
Note |
prevNote()
|
void |
removeInterval(Note n)
|
void |
render(java.awt.Graphics g,
double zoom)
|
void |
replaceDrawingAnchor(java.awt.Point p)
anchor is the horizontal note location |
static void |
resortChord(Note n)
make root == handle == lowest pitched note, sort the vector of intervals low to high |
void |
set8vaOut(boolean flag)
Set 8va out flag on Note. |
void |
set8vbOut(boolean flag)
Set 8vb out flag on Note. |
void |
setAcc(int acc)
Set accidental info 0=none, 1=sharp, 2=flat, 3=natural |
void |
setAccHidden(boolean flag)
Set accidental hidden flag 0,1 |
void |
setAccPref(int pref)
Set preferred accidental spelling: Note.ACC_PREFER_SHARP or Note.ACC_PREFER_FLAT. |
void |
setAltEnharmonicSpelling(boolean flag)
Set flag determines if note uses alternate enharmonic spelling (ex E#, F##, Cb, Fbb, etc). |
void |
setBeamedOut(boolean f)
set the beamed out flag for this note and all intervals and handle |
void |
setBeamedOutNoLoop(boolean f)
|
void |
setCrescOut(boolean flag)
Set crescendo out flag on Note. |
void |
setData(double[] data)
|
void |
setData(double dur,
double midinote,
double vel,
double hold)
set four dimensional double[] data |
void |
setData(int dimension,
double value)
Set the value of one element of the double[] array held by this Note. |
void |
setDecrescOut(boolean flag)
Set decrescendo out flag on Note. |
void |
setDimensionNameSpace(DimensionNameSpace d)
|
void |
setDoubleArray(double[] dar)
Hand Note an entirely new array of data. |
void |
setDrawingAnchor(java.awt.Point p)
anchor is the horizontal note location |
void |
setDurationData(double dur)
set performable duration, where 1.0=quarter note |
void |
setDynamic(int dynamic)
set dynamic marking for this note |
void |
setHandle(Note p)
|
void |
setHoldData(double hold)
set performable duration of hold, where 1.0 = quarter note |
static void |
setIntervalsToTrackOfHandle(Note note)
|
void |
setLevel(int l)
set the vertical placement of note on staff |
void |
setMark(int mark)
Set mark where int is one of the following: |
void |
setMeasureIndex(int m)
Use with caution! Only retrievable with getMeasureIndex() if this note has no track or staff |
void |
setNoteDur(int d)
Set note duration to constants 0..8 standing for WHOLE, HALF, QUARTER,... |
void |
setNoteHeadType(int noteheadType)
Set to Note.NOTEHEAD_BLACK or Note.NOTEHEAD_WHITE, or new constants for X, diamond, etc |
void |
setNumDots(int n)
Set number of dots following this note, 0, 1, or 2 |
void |
setNumTails(int n)
Deprecated. does nothing. getNumTails() is now calculated from core duration |
void |
setOverflow(boolean f)
true if this note is at the end of a track whose total durations exceeds the measure's timesig's duration. |
static void |
setPerformExpressionMarks(boolean flag)
if true, staccato, accent staccato, and tenuto marks will affect hold time on a Note |
void |
setPitchData(double pitch)
set performable pitch 1..127. |
void |
setSelected(boolean flag)
Set selected flag on Note (if user drew a rectangle that included this Note, for ex.) |
void |
setSlurredOut(boolean flag)
Set slur out flag on Note |
void |
setStaffIndex(int s)
Use with caution! Only retrievable with getStaffIndex() if this note has no track or staff |
void |
setStemInfo(int stem)
Set stem info 0=no stem, 1=stem up, 2= stem down |
void |
setText(java.lang.String s)
Set text to display by this note |
void |
setTextOffsetX(int xoffset)
horizontal text displacement |
void |
setTextOffsetY(int yoffset)
vertical text displacement |
void |
setTiedOut(boolean flag)
Set tied out flag on Note |
void |
setTrack(Track track)
|
void |
setTuplet(int n)
Set the tuplet value (3 for triplet, 5 for quintuplet, etc, up to 31 |
void |
setVelData(double vel)
set performable amplitude data (0..1) |
boolean |
startOf8va()
|
boolean |
startOf8vb()
|
boolean |
startOfCresc()
|
boolean |
startOfDecresc()
|
java.lang.String |
toString()
|
static double |
tupletDur(int n,
double dur)
Calculate duration of n-tuplet, given n and its non-tuplet duration. |
void |
writeXML(java.io.PrintWriter out)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static boolean DBUG
public static final int MARK_NONE
public static final int MARK_ACCENT
public static final int MARK_STACCATO
public static final int MARK_TENUTO
public static final int MARK_WEDGE
public static final int MARK_ACCENT_STACCATO
public static final int MARK_ACCENT_TENUTO
public static final int MARK_WEDGE_STACCATO
public static final int MARK_FERMATA
public static final int MARK_HARMONIC
public static final int MARK_TRILL
public static final int MARK_TRILL_FLAT
public static final int MARK_TRILL_SHARP
public static final int MARK_TRILL_NATURAL
public static final int MARK_MORDANT
public static final int MARK_INVERTED_MORDANT
public static final int STEM_NONE
public static final int STEM_UP
public static final int STEM_DOWN
public static final int ACC_NONE
public static final int ACC_SHARP
public static final int ACC_FLAT
public static final int ACC_NATURAL
public static final int ACC_DOUBLE_FLAT
public static final int ACC_DOUBLE_SHARP
public static final int ACC_QUARTERTONE_FLAT
public static final int ACC_THREEQUARTERTONE_FLAT
public static final int ACC_QUARTERTONE_SHARP
public static final int ACC_THREEQUARTERTONE_SHARP
public static final int ACC_PREFER_SHARP
public static final int ACC_PREFER_FLAT
public static final int ACC_NO_PREFERENCE
public static final int WHOLE
public static final int HALF
public static final int QUARTER
public static final int EIGHTH
public static final int SIXTEENTH
public static final int THIRTYSECOND
public static final int SIXTYFOURTH
public static final int ONEHUNDREDTWENTYEIGHTH
public static final int TWOHUNDREDFIFTYSIXTH
public static final double[] coreDurations
public static final java.lang.String[] coreDurationNames
public static final int NOTEHEAD_BLACK
public static final int NOTEHEAD_WHITE
public static final int NOTEHEAD_X
public static final int NOTEHEAD_X_OVAL
public static final int NOTEHEAD_X_DIAMOND
public static final int NOTEHEAD_WHITE_DIAMOND
public static final int NOTEHEAD_BLACK_DIAMOND
public static final int NOTEHEAD_WHITE_TRIANGLE
public static final int NOTEHEAD_BLACK_TRIANGLE
public static final int NOTEHEAD_WHITE_INVERTEDTRIANGLE
public static final int NOTEHEAD_BLACK_INVERTEDTRIANGLE
public static final int NOTEHEAD_BREVE
public static final int NOTEHEAD_SLASH
public static final int NOTEHEAD_RESERVED_1
public static final int NOTEHEAD_RESERVED_2
public static final java.lang.String[] noteheadNames
public static final int DYNAMIC_NONE
public static final int DYNAMIC_PPP
public static final int DYNAMIC_PP
public static final int DYNAMIC_P
public static final int DYNAMIC_MP
public static final int DYNAMIC_MF
public static final int DYNAMIC_F
public static final int DYNAMIC_FF
public static final int DYNAMIC_FFF
public static final java.lang.String copyright
Constructor Detail |
---|
public Note(Track track, double dur, double pitch, double vel, double hold)
public Note(int coreDur, int tuplet, int dots, int accInfo)
Method Detail |
---|
public static Note cloneNote(Note n)
public static void copyProperties(Note fromNote, Note toNote)
fromNote
- toNote
- public static void setIntervalsToTrackOfHandle(Note note)
public boolean isChord()
public boolean isInterval()
public boolean isMonoNote()
public Note addInterval(double pitch)
public Note addInterval(Note newNote)
public void removeInterval(Note n)
public void clearIntervals()
public void setHandle(Note p)
public Note getHandle()
public java.util.Vector getIntervals()
public int getNoteIndex()
public Note nextNote()
public Note prevNote()
public boolean isRest()
public boolean isBeamable()
public double getDurationData()
public double getPitchData()
public double getVelData()
public double getHoldData()
public void setDurationData(double dur)
public void setPitchData(double pitch)
public void setVelData(double vel)
public void setHoldData(double hold)
public void setData(double dur, double midinote, double vel, double hold)
public void setSelected(boolean flag)
public boolean getSelected()
public int getStemInfo()
public void setStemInfo(int stem)
public void setOverflow(boolean f)
public boolean getOverflow()
public static double getNoteDurationAsPerformanceTime(int durConst)
public double getNoteDurationAsPerformanceTime()
public static int getIndexOfCoreDuration(double duration)
public int getNoteDur()
public int getCoreDuration()
public void setNoteDur(int d)
public void setNoteHeadType(int noteheadType)
public int getNoteHeadType()
public int getAcc()
public void setAcc(int acc)
public int getAccPref()
public void setAccPref(int pref)
public boolean getAccHidden()
public void setAccHidden(boolean flag)
public boolean getAltEnharmonicSpelling()
public void setAltEnharmonicSpelling(boolean flag)
public static java.lang.String accToString(int acc)
public int getNumDots()
public void setNumDots(int n)
public boolean getBeamedOut()
public int getDynamic()
DYNAMICS: DYNAMIC_NONE ; DYNAMIC_PPP ; DYNAMIC_PP ; DYNAMIC_P ; DYNAMIC_MP ; DYNAMIC_MF ; DYNAMIC_F ; DYNAMIC_FF ; DYNAMIC_FFF ;
public void setDynamic(int dynamic)
DYNAMICS: DYNAMIC_NONE ; DYNAMIC_PPP ; DYNAMIC_PP ; DYNAMIC_P ; DYNAMIC_MP ; DYNAMIC_MF ; DYNAMIC_F ; DYNAMIC_FF ; DYNAMIC_FFF ;
public void setMark(int mark)
MARK_NONE MARK_ACCENT MARK_STACCATO MARK_TENUTO MARK_WEDGE MARK_ACCENT_STACCATO MARK_ACCENT_TENUTO MARK_WEDGE_STACCATO MARK_FERMATA MARK_HARMONIC MARK_TRILL MARK_TRILL_FLAT MARK_TRILL_SHARP MARK_NATURAL MARK_MORDANT MARK_INVERTED_MORDANT
public int getMark()
public static java.lang.String dynamicToString(int dynamic)
public static java.lang.String markToString(int mark)
public void setBeamedOut(boolean f)
public void setBeamedOutNoLoop(boolean f)
public void setTiedOut(boolean flag)
public boolean getTiedOut()
public void setSlurredOut(boolean flag)
public boolean getSlurredOut()
public void setCrescOut(boolean flag)
public void setDecrescOut(boolean flag)
public boolean getCrescOut()
public boolean getDecrescOut()
public void set8vaOut(boolean flag)
public void set8vbOut(boolean flag)
public boolean get8vaOut()
public boolean get8vbOut()
public boolean startOf8va()
public boolean endOf8va()
public boolean startOf8vb()
public boolean endOf8vb()
public boolean getTiedIn()
public boolean getCrescIn()
public boolean getDecrescIn()
public boolean startOfCresc()
public boolean endOfCresc()
public boolean startOfDecresc()
public boolean endOfDecresc()
public boolean getSlurredIn()
public boolean get8vaIn()
public boolean get8vbIn()
public void setLevel(int l)
public int getLevel()
public void setDrawingAnchor(java.awt.Point p)
public void replaceDrawingAnchor(java.awt.Point p)
public java.awt.Point getDrawingAnchor()
public void setNumTails(int n)
public int getNumTails()
public void setStaffIndex(int s)
public int getStaffIndex()
public void setMeasureIndex(int m)
public int getMeasureIndex()
public int getTuplet()
public void setTuplet(int n)
public Track getTrack()
public Score getScore()
public void setTrack(Track track)
public double[] getData()
public double[] getDataCopy()
public void setData(double[] data)
public void setData(int dimension, double value)
public double getData(int dimension)
public static boolean performExpressionMarks()
public static void setPerformExpressionMarks(boolean flag)
public double[] getPerformanceData()
public double[] getPerformanceDataCopy()
public double play(double playTime, Composable parent, Instrument ins)
InstrumentPlayable
play
in interface InstrumentPlayable
public java.lang.String toString()
toString
in class java.lang.Object
public void render(java.awt.Graphics g, double zoom)
public static double tupletDur(int n, double dur)
public static void resortChord(Note n)
public static Note[] getSortedChord(Note n)
public static Note getRoot(Note n)
public static Note getHighest(Note n)
public static Note getLowest(Note n)
public void writeXML(java.io.PrintWriter out) throws java.io.IOException
writeXML
in interface XMLWritable
java.io.IOException
public void setDimensionNameSpace(DimensionNameSpace d)
setDimensionNameSpace
in interface DimensionNameSpaceEditable
public DimensionNameSpace getDimensionNameSpace()
getDimensionNameSpace
in interface DimensionNameSpaceEditable
public double[] getDoubleArray()
getDoubleArray
in interface DimensionNameSpaceEditable
public void setDoubleArray(double[] dar)
setDoubleArray
in interface DimensionNameSpaceEditable
public static boolean firstNoteOfLine(Note note)
public static boolean lastNoteOfLine(Note note)
public void setText(java.lang.String s)
public java.lang.String getText()
public void setTextOffsetX(int xoffset)
public int getTextOffsetX()
public void setTextOffsetY(int yoffset)
public int getTextOffsetY()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |