Function summary | |
---|---|
max-velocity | velocities &key (type :float) |
min-velocity | velocities &key (type :float) |
simplify-dynamics | notation &key (flat t) |
velocity-add | offset velocities &key (simplify t) |
velocity-apply | fun velocities &key (type :float) |
velocity-fenvs | lengths &rest dynamics-fenvs |
velocity-fenvs2 | sequence dynamics-fenvs &key (omn t) |
velocity-smooth | alfa velocities &key (simplify t) |
velocity-transform | fun args &key (simplify t) |
_simplify-dynamics | dynamics &key (flat t) |
_velocity-add | offset velocities &key (simplify t) |
_velocity-smooth | alfa velocities &key (simplify t) |
Generates dynamics markers (velocities) for OMN `lengths'. Dynamics for each phrase (notes between rests) are defined by their own fenv (if fewer fenvs are defined, they are circled through). Returns a sublist for each phrase.
lengths: OMN `lengths' (list or list of list)
each dynamics-fenv has the form (<min-vel> <max-vel> &rest points), where `min-vel' and `max-vel' are dynamic indicators like pp or f, and points are pairs of linear fenv points.
(velocity-fenvs '((1/4 1/8 1/8) (1/4 -1/4) (1/4 1/4) (1/4 -1/4)) '(pp mp (0 0) (0.7 1) (1 0))) => ((pp< p< > pp) (pp< > pp))
Generates dynamics markers (velocities) for OMN `lengths'. Dynamics for each phrase (notes between rests) are defined by their own fenv (if fewer fenvs are defined, they are circled through). Returns a sublist for each phrase.
lengths (list): OMN length values or OMN sequence, can be nested
dynamics-fenvs: One dynamics-fenv or list of them. Each dynamics-fenv has the form (<min-vel> <max-vel> &rest points), where `min-vel' and `max-vel' are dynamic indicators like pp or f, and points are pairs of linear fenv points.
omn (Boolean): whether to return a plain velocity list or OMN expression
(velocity-fenvs '((1/4 1/8 1/8) (1/4 -1/4) (1/4 1/4) (1/4 -1/4)) '(pp mp (0 0) (0.7 1) (1 0))) => ((pp< p< > pp) (pp< > pp))
BUG: not working yet
Removes intermediate textual dynamic indicators from longer hairpins (e.g., generated by velocity-to-dynamic or gen-dynamic).
notation: list of OMN dynamics values in multiple formats (can be nested)
flat (default T): whether or not to simplify dynamics across sublists.
(simplify-dynamics '(pppp< < ppp< pp< < p< < mp< mf< < f< < ff> > mf> mp> p> ppp> pppp)) => (pppp< < < < < < < < < < < < ff> > > > > > pppp)
(simplify-dynamics '((pppp< < ppp< pp< < p< <) (mp< mf< < f< < ff> > mf> mp> p> ppp> pppp))) => ((pppp< < < < < < <) (< < < < < ff> > > > > > pppp))
(simplify-dynamics '((pppp< < ppp< pp< < p< <) (mp< mf< < f< < ff> > mf> mp> p> ppp> pppp)) :flat nil) => ((pppp< < < < < < <) (mp< < < < < ff> > > > > > pppp))
using omn input
(simplify-dynamics '((e c4 p< d4 < e4 mf< f4 < g4 f))) => ((e c4 p< d4 < e4 < f4 < g4 f))
processing MIDI velocity integers
(simplify-dynamics '((10 20 30 40) (50 60 50 30))) => ((pppp < < <) (< mp > ppp))
processing floats
(simplify-dynamics '((0.1 0.2 0.3 0.4) (0.5 0.6 0.5 0.3))) => ((pppp < < <) (< f > pp))
This is not correct -- various problems.
(simplify-dynamics '((h c4 f> pp<) (q c4 f> mf> p> pp<) (h c4 f> pp<) (q c4 f> p> pp c4) (h c4 f> pp<) (q c4 f> mf> p> pp<)))
Applies a numeric function `fun' to a list of symbolic velocity values `velocities', which are translated into floats in the background.
(velocity-apply #'min '(p mf pp ff) :type :symbol) =>pp
Higher-order function for transforming velocities by processing them as an Openmodus vector in the background.
fun: a function expecting a vector and possibly more arguments.
args: the arguments for `fun'. Velocities should be explicitly transformed into numeric values. Example args value: (get-velocity '(mf> > > > > pp))
simplify: whether or not to simplify cresc. and dim. in the result with simplify-dynamics.
(velocity-transform #'vector-add (list (get-velocity '(mf> > > > > pp)) '(0.1)))
Adds an offset to a list of OMN velocities. Quasi the dynamics equivalent of pitch transposition.
offset: an offset added to `velocities', can be numeric (between 0 and 1) or a velocity symbol (e.g., pp), and also a list of either.
velocities: list of velocities, can be nested.
simplify: whether or not to simplify cresc. and dim. in the result with simplify-dynamics.
(velocity-add 0.1 '(mf> > > > > pp)) => (f> > > > > p)
(velocity-add 'pppp '(mf> > > > > pp)) => (f> > > > > p)
(velocity-add 0.1 '((mf> > >) (> > pp))) => ((f> > >) (> > p))
(velocity-add '(0.1 0.2 0.3 0.4 0.5 0.6) '(mf> > > > > pp)) => (f< < < < < ffff)
omn input
(velocity-add 0.15 '((e c4 p< d4 < e4 mf< f4 < g4 f))) => ((e c4 mf< d4 < e4 < f4 < g4 fff))
Smoothes velocity values.
alfa: parameter controlling the degree of exponential smoothing (usually 0 < alpha < 1).
velocities: list of velocities, can be nested.
simplify: whether or not to simplify cresc. and dim. in the result with simplify-dynamics.
(velocity-smooth 0.7 '((ppp p mf ff p< < <) (fff> > f><p ff mf p ppp))) => ((ppp< < < mp< < mp< <) (f< ff> > < ff> > mp))
(velocity-smooth 0.2 '((ppp p mf ff p< < <) (fff> > f><p ff mf p ppp))) => ((ppp< < < < < < <) (< mf mf mf mf mf mf))