Panola implements a subset of the midi specification language mispel in supercollider. Mispel is a domain specific language implemented in python 3 for expressive midi generation See https://github.com/shimpe/expremigen
Mispel elements that are not supported in this supercollider version include: - passing animation options (tweening) for the animated properties - specifying multiple tracks in one string - specifying midi control change messages (e.g. animating pitchbend over time with much finer time resolution than the note events)
A Panola notation string specifies a phrase of notes. Notenames can be a, b, c, d, e, f, g. Optional note modifiers can be # for a sharp, x for a double sharp, - for a flat and -- for a double flat. Notenames also include an optional octave number. The following are all examples of valid notes:
a4, b-3, d, gx2, f#1, d--1
If you do not specify an octave number, the last specified one is reused.
Optionally one can append an underscore with an (inverse) duration value to a note, e.g. a_4 is a quarter note, whereas a_8 is an eighth note. These are not to be confused with a4 and a8 which are a-notes in the fourth and eighth octave respectively.
If you do not specify a duration value, the last specified one is reused.
The duration value can optionally be extended with dots. Each dot adds half the duration to the specified duration. E.g. a_4 lasts for 1 quarter note (=2 eighth notes), whereas a_4. lasts for 1.5 quarter notes (3 eighth notes). Number of dots is remembered until a new duration is specified.
After the dots one can optionally specify a multiplier and a divider. These can be used to specify tuplets. E.g. "a4_8*2/3 b c5 d c b4 " specifies 6 notes that together form two triplets of eighth notes. Multiplier and divider are remembered until a new duration is specified.
Notes can be grouped using angular brackets to make chords. The properties of the first note in the chord are used for the complete chord. Properties attached to the second and later notes in the chord (other than octave number and note modifier) are ignored. The following makes a chord of four notes:
"<c4 e4 g c5>"
After the dots one can optionally specify additional properties. Currently the following properties are supported: vol (volume), tempo (tempo), lag (lag), pdur (played duration, aka legato). Properties come in two variants: animated and fixed. An animated property will vary over the course of time until a new value for the property is specified. Animated properties are created by including their values in curly brackets {}. A fixed property remains fixed over the course of time until a new value for the property is specified. A fixed property is specified by enclosing its value in square brackets [].
E.g. here's an example of a crescendo (becoming louder):
"c4\\vol{0.3} d e f g a b c5\\vol{0.9}"
In the above example, the c4 starts at volume 0.3 and the phrase ends at volume 0.9. The volumes of the notes in between gruadually rise so as to get a crescendo. Note: for now only linear animation is supported.
If on the other hand we would have written:
"c4\\vol[0.3] d e f g a b c5\\vol[0.9]"
Then the volume of the notes c4 to b would have remained constant at 0.3, and c5 would have suddenly had volume 0.9.
Note, as of v0.0.9, Panola also supports using the "@" sign instead of a backslash for indicating properties. So you could also write
"c4@vol[0.3] d e f g a b c5@vol[0.9]"
Panola allows you to interpret an valid Panola string by extracting information from it, either as a complete Pbind. You can ask .asPbind which returns a Pbind that is suitable for use with the supercollider server, or you can ask it to .asMidiPbind, which returns a Pbind that can communicate with external software/hardware synthesizers over MIDI.
or, more flexibly, by extracting individual information patterns:
In addition to these predefined properties, you can also use any user defined pattern, e.g.
creates a new Panola instance
notation |
a string containing a valid panola notation string |
octave_default |
which octave to use if not explicitly specified (default=4) |
dur_default |
which duration to use if not explicitly specified (default=quarter note) |
modifier_default |
which note modifier to use if not explicitly specified (default=none) |
mult_default |
extra multiplier used to specify tuplets (default=1) |
div_default |
extra divider used to specify tuplets (default=1) |
vol_default |
volume value to use if not explicitly specified (default=0.5) |
playdur_default |
legato value to use if not explicitly specified (default=0.9) |
lag_default |
lag value to use if not explicitly specified(default=0) |
tempo_default |
tempo value to use if not explicitly specified(default=80 bpm) |
an object from which several patterns can be asked
returns all info in the score as a pattern. All properties are turned into Pbind keys
instrument |
the instrument to use in the Pbind |
include_custom_properties |
a boolean indicating if only the standard fields (tempo, lag, midinote, duration, pdur) should be included, or if all user defined properties should be included as well |
custom_property_defaults |
a Dictionary containing default values for properties. These defaults are used as long as no value for the property is specified in the Panola specification. If you provide a default value for a key, but you never reference the key in the Panola string, it will not be part of the Pbind that results from calling asPbind. |
translate_std_keys |
if true (default), key "vol" is translated to \amp and key "pdur" is translated to \legato and key "tempo" is correctly scaled to be used in a TempoClock |
a Pbind of \type \note
returns the info in the score as a pattern that produces midi noteOn/noteOff events. This can be used with external devices.
midiOut |
this is an instance of a MIDIOut, already connected to an external software/hardware synth |
channel |
midi channel (default:0) on which to send the noteOn/noteOff events |
include_custom_properties |
a boolean indicating if only the standard fields (tempo, lag, midinote, duration, pdur) should be included, or if all user defined properties should be included as well. In case of midi events, these extra keys most likely will not have any effect. |
custom_property_default |
a Dictionary containing default values for properties. These defaults are used as long as no value for the property is specified in the Panola specification. If you provide a default value for a key, but you never reference the key in the Panola string, it will not be part of the Pbind that results from calling asPbind. |
translate_std_keys |
if true (default), key "vol" is translated to \amp and key "pdur" is translated to \legato and key "tempo" is correctly scaled to be used in a TempoClock |
a Pbind of \type \midi
returns the info in the score as a Pmono
instrument |
the instrument to use in the Pmono |
include_custom_properties |
a boolean indicating if only the standard fields (tempo, lag, midinote, duration, pdur) should be included, or if all user defined properties should be included as well |
custom_property_defaults |
a Dictionary containing default values for properties. These defaults are used as long as no value for the property is specified in the Panola specification. If you provide a default value for a key, but you never reference the key in the Panola string, it will not be part of the Pmono that results from calling asPmono. |
translate_std_keys |
if true (default), key "vol" is translated to \amp and key "pdur" is translated to \legato and key "tempo" is correctly scaled to be used in a TempoClock |
a Pmono of \type \note
returns the info in the score as a PmonoArtic
instrument |
the instrument to use in the PmonoArtic |
include_custom_properties |
a boolean indicating if only the standard fields (tempo, lag, midinote, duration, pdur) should be included, or if all user defined properties should be included as well |
custom_property_defaults |
a Dictionary containing default values for properties. These defaults are used as long as no value for the property is specified in the Panola specification. If you provide a default value for a key, but you never reference the key in the Panola string, it will not be part of the PmonoArtic that results from calling asPmonoArtic. |
translate_std_keys |
if true (default), key "vol" is translated to \amp and key "pdur" is translated to \legato and key "tempo" is correctly scaled to be used in a TempoClock |
a PmonoArtic of \type \note
default note modifier
returns default note modifier in use
volumePattern
returns a pattern generating the required volume entries
internal data structure containing parse tree of the panola notation string
internal data structure containing parse tree of the panola notation string
internal helper method to parse the panola notation
notation |
string containing valid panola notation |
octave_default |
wich octave to use by default (4, unless specified differently during .new) |
dur_default |
which duration to use by default (1/4, unless specified differently during .new) |
modifier_default |
which modifier to use by default (none) |
mult_default |
which rhythm multiplier to use by default (1) |
div_default |
which rhythm divider to use by default (1) |
vol_default |
which volume to use by default (0.5) |
playdur_default |
which legato setting to use by default (0.9) |
lag_default |
which lag to use by default (0) |
tempo_default |
which tempo to use by default (80 bpm) |
nothing of interest
default legato value (0.9)
returns default legato value in use
internal helper method to create notename to midi number lookup table
nothing
default duration divider (1)
default duration divider
default octave (4)
default octave
default number of dots (0)
default number of dots
default tempo (80 bpm)
default tempo
default lag (0)
default lag
pattern generating the successive durations to realize the notation
pattern generating the successive durations to realize the notation
returns a pattern describing the values of a custom property through the score
customstring |
this is the name of the property you're extracting from the score |
default |
this is the default value for the property |
a pattern
internal helper method for turning animated properties into pattern
prop_name |
string describing name of property in panola notation |
default_type |
type to use if no type specified |
default_propval |
value to use if no property value specified |
pattern generating the property values needed to realize the notation string
pattern generating the successive legato values to realize the notation
pattern generating the successive legato values to realize the notation
default duration multiplier value
default duration multiplier value
default duration
default duration
pattern generating the successive lag values to realize the pattern
pattern generating the successive lag values to realize the pattern
default volume
default volume
pattern generating the successsive midi notes to realize the pattern
pattern generating the successsive midi notes to realize the pattern
pattern generating the successive notated notes to realize the pattern (mostly useful for display purposes)
pattern generating the successive notated notes to realize the pattern
pattern generating the successive notated durations to realize the pattern (mostly useful for display purposes)
pattern generating the successive notated durations to realize the pattern
pattern generating the successsive tempo values to realize the pattern
pattern generating the successsive tempo values to realize the pattern
internal lookup table
lookup table to transform note names into midinotes
initialization of internal data structures + parsing of notation string
notation |
panola string with notation |
octave_default |
default octave |
dur_default |
default duration |
modifier_default |
default modifier |
mult_default |
default multiplier |
div_default |
default divider |
vol_default |
default volume |
playdur_default |
default legato |
lag_default |
default lag |
tempo_default |
default tempo |
internally initialized Panola instance
Using Panola without pattern:
Using Panola in a pattern
Multiple voices: first part of J.S. Bach's bwv784 2-voice invention 13
Driving a synth using custom properties
Complete piece in 4 voices being sent to a Prophet Rev 2 hardware synthesizer. This makes use of the ScProphetRev2 quark for talking to a Dave Smith Instruments prophet Rev2, available from https://github.com/shimpe/sc-prophet-rev2.You can of course use your own initialized MIDIOut object instead.