|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.e1.mxdublin.DublinHelper
public class DublinHelper
Sets of helpers utilities for building note/chord/time values from strings and bridging python/java with pd/max.
| Field Summary | |
|---|---|
static Hashtable<String,int[]> |
chords
Chords definition to used with DublinHelper.chord(String chord). |
static Hashtable<String,int[]> |
scales
Scales definitions to be used with chord progressions. |
| Constructor Summary | |
|---|---|
DublinHelper()
|
|
| Method Summary | |
|---|---|
static PyObject |
atom2py(Atom atom)
Transform a atom to a python object. |
static PyObject |
atoms2py(Atom[] atoms)
Transform a list of atoms to a python sequence. |
static Object |
choice(Object[] obj)
Returns a random object from the list. |
static int[] |
chord(String chord)
Build a chord definition from a string. |
static String |
note2trkr(int midiValue)
Returns the string value (tracker format) of a midi note value |
static String |
prettyTm(int tm)
Returns a string representation of the trail position in quarter note. |
static String |
prettyTm(int tm,
int base)
Returns a string representation of the trail position in quarter note |
static int[] |
prog(String def)
Build a chord definition based on the harmonic progression from a scale. |
static int[] |
progInterval(String degree)
Returns the interval used based on a chord progression degree. |
static Atom |
py2atom(PyObject obj)
Transform a python object into an atom. |
static Atom[] |
py2atoms(PyObject obj)
Transform a python sequence into atoms. |
static float[] |
range(float start,
float end,
float step)
Returns a list containing an arithmetic progression of floats. |
static float |
rnd()
Random number generator, returns something between 0.0 and 1.0. |
static int |
tm2int(String tm)
Translate a time reference in string format into a int in ppq. |
static int[] |
tm2list(String list)
Transform a list of time in a single string to a array of int in ppq: |
static int |
trkr2note(String note)
Parse a note in tracker format to midi format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static Hashtable<String,int[]> chords
DublinHelper.chords.put("M", new int[] {0, 4, 7});
See http://www.looknohands.com/chordhouse/piano for chord name reference
public static Hashtable<String,int[]> scales
| Constructor Detail |
|---|
public DublinHelper()
| Method Detail |
|---|
public static Atom py2atom(PyObject obj)
obj - the python object
public static Atom[] py2atoms(PyObject obj)
obj - the python object
public static PyObject atom2py(Atom atom)
atom - the atom to cast
public static PyObject atoms2py(Atom[] atoms)
atoms - the atoms to cast
public static int[] tm2list(String list)
"1:1.5:2.1/2" -> [ 480, 720, 1200 ]
list - the list in string format
public static int tm2int(String tm)
tm - reference in string format
public static int trkr2note(String note)
"C-1" -> 13, "C#1" -> 14, etc...
note - the tracker note in string
public static String note2trkr(int midiValue)
13 -> "C-1", 14 -> "C#1", etc...
midiValue - the midi note value note
public static int[] chord(String chord)
chord - the chord name ex:E-2:M7<1 or G#3:M:-1
public static int[] progInterval(String degree)
degree - the degree of the chord to returns
public static int[] prog(String def)
Example
DublinHelper.prog("C-5:5:-1")
DublinHelper.prog("A-5m:3:1)
def - chord degree definition
public static float rnd()
public static Object choice(Object[] obj)
public static float[] range(float start,
float end,
float step)
start - where the range startend - when the range should stop (and not putting this value)step - to number of step between each iteration
public static String prettyTm(int tm,
int base)
tm - the position of the trailbase - denominator to divide the quarter note
public static String prettyTm(int tm)
tm - the position of the trail
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||