Package org.ptolemy.machineImprovisation
Class MusicSpecs
- java.lang.Object
-
- org.ptolemy.machineImprovisation.MusicSpecs
-
public class MusicSpecs extends java.lang.ObjectA static class that contains musical specifications.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Ilge Akkaya
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (ilgea)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREST_SYMBOLRest symbol.static java.lang.StringTERMINATION_CHORDSymbol for the termination chord.static intTERMINATION_NOTE_KEYMIDI key for the termination note.static java.lang.StringTERMINATION_NOTE_SYMBOLSymbol for the termination note.
-
Constructor Summary
Constructors Constructor Description MusicSpecs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.ListgetChordPitches(java.lang.String chord, boolean useScale)Get a list of notes contained by the chord.static java.util.HashMapgetChordTones(java.util.List<java.lang.String> chords)Get the chord tones contained by the given chords.static java.lang.StringtranslateKeyToLetterNote(double key, boolean addOctave)Translate a MIDI key to its equivalent letter note representation.static inttranslateLetterToKeyIndex(java.lang.String keyLetter)Translate a letter note to MIDI key.static inttranslateNoteToKey(java.lang.String note)Translate a letter note to MIDI key.
-
-
-
Field Detail
-
TERMINATION_CHORD
public static final java.lang.String TERMINATION_CHORD
Symbol for the termination chord.- See Also:
- Constant Field Values
-
TERMINATION_NOTE_SYMBOL
public static final java.lang.String TERMINATION_NOTE_SYMBOL
Symbol for the termination note.- See Also:
- Constant Field Values
-
REST_SYMBOL
public static final java.lang.String REST_SYMBOL
Rest symbol.- See Also:
- Constant Field Values
-
TERMINATION_NOTE_KEY
public static final int TERMINATION_NOTE_KEY
MIDI key for the termination note.- See Also:
- Constant Field Values
-
-
Method Detail
-
getChordTones
public static java.util.HashMap getChordTones(java.util.List<java.lang.String> chords)
Get the chord tones contained by the given chords.- Parameters:
chords- The list of chords- Returns:
- a map of pitches contained by the specified list of chords
-
getChordPitches
public static java.util.List getChordPitches(java.lang.String chord, boolean useScale)Get a list of notes contained by the chord.- Parameters:
chord- The chord nameuseScale- A boolean specifying whether scale notes should be included- Returns:
- a List of notes
-
translateKeyToLetterNote
public static java.lang.String translateKeyToLetterNote(double key, boolean addOctave)Translate a MIDI key to its equivalent letter note representation.- Parameters:
key- MIDI key indexaddOctave- boolean -- if true indicates that octave information should be output- Returns:
- letter note representation of note
-
translateNoteToKey
public static int translateNoteToKey(java.lang.String note)
Translate a letter note to MIDI key.- Parameters:
note- a letter note- Returns:
- the MIDI key index
-
translateLetterToKeyIndex
public static int translateLetterToKeyIndex(java.lang.String keyLetter)
Translate a letter note to MIDI key.- Parameters:
keyLetter- a letter note- Returns:
- the MIDI key index in base 12
-
-