Search the Community
Showing results for tags 'velocity'.
Found 4 results
Hi, I have a list of 30 midi-velocities that I want to map to 30 pitches, how can I do that without converting the velocities into symbols? Is that possible in OM (it is not for human players but for virtual instruments)? (setf vel '(1 5 10 14 19 23 27 32 36 41 44 50 53 57 62 66 71 75 79 84 88 93 97 102 105 109 114 118 123 127)) converted to symbols it looks like: (ppppp ppppp pppp pppp pppp ppp ppp pp pp pp p p mp mp mp mf mf f f f ff ff fff fff fff ffff ffff ffff fffff fffff) which is not as 'smooth' as I want it..but make-omn seems to handle only velocity-symbol or am I missing something? thanks for help!
It is nice to have velocity transformation functions like velocity-variant and friends, but I would like to go further. How about being able to easily increasing or decreasing the overall volume (basically a dynamics/velocity transposition), or to smoothen dynamics differences in order to create dynamics variations in the composition process? Here are two examples. (velocity-add 0.1 '(mf> > > > > pp)) => (f> > > > > p) (velocity-smooth 0.7 '((ppp p mf ff p< < <) (fff> > f><p ff mf p ppp))) => ((ppp< < < mp< < mp< <) (f< ff> > < ff> > mp)) Below is an implementation of these functions. Further functions like this can now easily be implemented with velocity-transform. The principle idea is to transform OMN velocities into a numeric OMN vector (list), and do whatever transformation you want to do on that vector, and finally to transform the result back into OMN velocities. The details are explained in the comment string of the functions below. Note that these definitions depend on my function simplify-dynamics. Best, Torsten (defun velocity-transform (fun args &key (simplify T)) "Higher-order function for transforming velocities by processing them as an Openmodus vector in the background. Args fun: a function expecting a vector and possibly more arguments. args: the arguments for `fun'. Velocities should be explicitly transformed into numeric values. Example: (get-velocity '(mf> > > > > pp)) simplify (default T): whether or not to simplify cresc. and dim. in the result with simplify-dynamics. Example (velocity-transform #'vector-add (list (get-velocity '(mf> > > > > pp)) '(0.1)))" (let* ((vel-vector (apply fun args)) (result (velocity-to-dynamic (vector-to-velocity (apply #'min vel-vector) (apply #'max vel-vector) vel-vector)))) (if simplify (simplify-dynamics result) result))) (defun velocity-add (offset velocities &key (simplify T)) "Adds an offset to a list of OMN velocities. Quasi the dynamics equivalent of pitch transposition. Args 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. Examples (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) " (span velocities (velocity-transform #'vector-add (list (get-velocity (flatten velocities)) (if (listp offset) (mapcar #'get-velocity offset) (list (get-velocity offset)))) :simplify simplify))) (defun velocity-smooth (alfa velocities &key (simplify T)) "Smoothes velocity values. Args alfa: parameter controlling the degree of exponential smoothing (usually 0 < alpha < 1). velocities: list of velocities, can be nested. Example (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))" (span velocities (velocity-transform #'vector-smooth (list alfa (get-velocity (flatten velocities))) :simplify simplify)))
Dear Janusz, The richness of the dynamics symbols in OMN is great. In terms of hair pins, what we already have are the plain hair pins < and > as well as symbols that end with a hairpin, e.g., p<, or f> – besides all those one-note dynamics. Nevertheless, perhaps this set could be slightly extended even further (now I am getting greedy :) If we want to express that some crescendo or diminuendo, which started on an earlier note, continues until the end of the current note, then we would need symbols that we don't have yet, like the following, <p, <f, >p, >f, i.e., symbols that start with a hairpin. Would you agree that these would be useful to add (in the medium or long term)? With such additional symbols, also some already existing dynamics transformations could also be implemented more consistently. For example, currently velocity-variant and friends works as follows. (velocity-variant '(mf> > > > > pp) :variant 'r) => (pp < < < < mf<) A more consistent result would be the following, but the symbol <mf is not supported yet. (pp < < < < <mf) Thanks! Best, Torsten
New: One Note Dynamic Crescendo-Diminuendo <ppppp> <pppp> <ppp> <pp> <p> <mp> <mf> <f> <ff> <fff> <ffff> <fffff> Diminuendo-Crescendo >ppppp< >pppp< >ppp< >pp< >p< >mp< >mf< >f< >ff< >fff< >ffff< >fffff< Crescendo ppppp<pppp ppppp<ppp ppppp<pp ppppp<p ppppp<mp ppppp<mf ppppp<f ppppp<ff ppppp<fff ppppp<ffff ppppp<fffff pppp<ppp pppp<pp pppp<p pppp<mp pppp<mf pppp<f pppp<ff pppp<fff pppp<ffff pppp<fffff ppp<pp ppp<p ppp<mp ppp<mf ppp<f ppp<ff ppp<fff ppp<ffff ppp<fffff pp<p pp<mp pp<mf pp<f pp<ff pp<fff pp<ffff pp<fffff p<mp p<mf p<f p<ff p<fff p<ffff p<fffff mp<mf mp<f mp<ff mp<fff mp<ffff mp<fffff mf<f mf<ff mf<fff mf<ffff mf<fffff f<ff f<fff f<ffff f<fffff ff<fff ff<ffff ff<fffff fff<ffff fff<fffff ffff<fffff Diminuendo fffff>ffff fffff>fff fffff>ff fffff>f fffff>mf fffff>mp fffff>p fffff>pp fffff>ppp fffff>pppp fffff>ppppp ffff>fff ffff>ff ffff>f ffff>mf ffff>mp ffff>p ffff>pp ffff>ppp ffff>pppp ffff>ppppp fff>ff fff>f fff>mf fff>mp fff>p fff>pp fff>ppp fff>pppp fff>ppppp ff>f ff>mf ff>mp ff>p ff>pp ff>ppp ff>pppp ff>ppppp f>mf f>mp f>p f>pp f>ppp f>pppp f>ppppp mf>mp mf>p mf>pp mf>ppp mf>pppp mf>ppppp mp>p mp>pp mp>ppp mp>pppp mp>ppppp p>pp p>ppp p>pppp p>ppppp pp>ppp pp>pppp pp>ppppp ppp>pppp ppp>ppppp pppp>ppppp