I'm looking for a method/function which changes the velocity only for notes that are repeating.
In other words, if I have a sequence like this:
'(c4 eb4 g4 ab4 ab4 ab4 d4 eb4) I would like to be able to create a crescendo/decrescendo or set a custom velocity for just the Ab notes.
In the past I've customised a Pattern Matching function from Stephane to change the velocity for specific note lengths:
(defun velocity-map-omn (map omn &key (otherwise '-)) (do-verbose ("velocity-map-omn") (let ((plist (disassemble-omn omn))) (setf (getf plist :velocity) (pattern-map map (getf plist :length) :otherwise otherwise :swallow t)) (apply 'make-omn plist)))) And I think this should be very close to what I want, however, I have no idea how to tell OM to process repeating notes only.
Is there anyone who already has a function like this or can steer me in the right direction? Hope this makes sense, any help is very welcome!
is there an RESPELL-function which would change sharps into flats and flats into sharps for single pitch-values? enharmonic changes....
(enharmonic 'cs4) => db4 (enharmonic 'db4) => cs4
but there is an other solution for an EQUALP* whicht is "independent" from pitch-name (enharmonic)... but a function like ENHARMONIC or EQUALP* could be useful (for pattern-match etc)...
(defun equalp* (a b) (equal (pitch-to-midi a) (pitch-to-midi b))) (equalp* 'cs4 'db4) => t
there is an EQUALP in the system (but not documented), and works like that
(equalp 'cs4 'db4) => nil (equalp 'cs4 'cs4) => t :
;;; CHANGE-TIME-STRUCTURES ;;; works okay, but not exactly precise because of rhy-to-integer, which is not very easy in some cases ;;; this function changes basic-rhy-structures (if it's all the time perhaps in x/32) ;;; to other/changing sections. the lengths/rests will be rounded like in LENGTH-RATIONAL-QUANTIZE ;;; rhy+span => '((32 2) (44 7)) => means in 32 three values, in 44 seven values (defun change-time-structure (omnseq rhy+span &key (basic-rhy 32) (round 1/4)) (let* ((intseq (loop for i in (omn :length (flatten omnseq)) collect (* i basic-rhy))) (rhyseq (mapcar #'car rhy+span)) (spanseq (mapcar #'cadr rhy+span)) (divided-intseq (gen-divide spanseq intseq))) (length-rational-quantize (flatten (gen-length divided-intseq rhyseq)) :round round))) (change-time-structure '(2/44 -2/44 3/44 5/44 6/44) '((32 2) (20 2) (28 3)) :basic-rhy 44) => (1/16 -1/16 -1/8 3/20 1/4 -1/10 3/14 -1/28) (change-time-structure '(2/32 -2/32 3/32 5/32 6/32) '((20 2) (44 2) (28 3)) :basic-rhy 32) => (1/10 -1/10 -1/20 3/44 5/44 -3/44 3/14 -1/28)
could be done better -> go for it 🙂