Skip to content
View in the app

A better way to browse. Learn more.

Learn more

tied quarters with triplets

Featured Replies

Hello,

can anyone help me to get rid of the tied quarters (see in score) in context with triplets and merge them to single lengths?

Thanks in advance,

Achim

;; view with cmd-1
(progn
 (init-seed 123)
 (setf events 80)
 (setf data (half-sine events 1))
 (setf map (gen-tendency events (gen-integer 6 16)))
 (setf lengths (quantize (vector-map map data) '(1 2 3 4)))
 )
; end of progn

How about this:

(defun length-change-keep-pos (percent-list omn-sequence)

"Altera a duração das notas por um percentual sem mudar sua posição no tempo."

(let* (;; 1. Desmonta para isolar comprimentos (suporta OMN completo ou apenas ritmos) [5]

(lengths (if (listp (car omn-sequence))

(getf (disassemble-omn omn-sequence) :length)

omn-sequence))

;; 2. Agrupa notas com suas pausas subsequentes (unidades posicionais) [3]

(slots (length-legato (flatten lengths)))

(num-events (length slots))

;; 3. Alinha a lista de percentuais ao número de eventos [4]

(pct-list (gen-trim num-events (if (listp percent-list) percent-list (list percent-list)))))

(loop for slot in slots

for pct in pct-list

append (let* ((abs-slot (abs slot))

;; 4. Calcula a nova duração da nota baseada no percentual

(new-note-len (* abs-slot (/ pct 100)))

;; 5. Calcula o silêncio necessário para manter a posição original

(remainder (- abs-slot new-note-len)))

(cond

;; Se for uma pausa original no slot (legato de pausas)

((minusp slot) (list slot))

;; Se o percentual preencher o slot exatamente

((zerop remainder) (list new-note-len))

;; Se a nota encurtou: nota + pausa compensatória

((plusp remainder) (list new-note-len (* -1 remainder)))

;; Se a nota aumentou (ex: 200%): absorve o espaço do slot

(t (list new-note-len)))))))

(length-change-keep-pos '(25 50 100) '(w w h h q h))

(1/4 -3/4 1/2 -1/2 1/2 1/8 -3/8 1/8 -1/8 1/2)

(length-change-keep-pos '(100) '(h -h h -h q -q q -q e -e))

(1 1 1/2 1/2 1/4)

(length-change-keep-pos '(25 25 25 50 50 50 ) '(3h 3h 3h 3h 3h 3h))

(1/24 -1/8 1/24 -1/8 1/24 -1/8 1/12 -1/12 1/12 -1/12 1/12 -1/12)

(length-change-keep-pos '(25 50 500) '(w w h h q h))

(1/4 -3/4 1/2 -1/2 5/2 1/8 -3/8 1/8 -1/8 5/2)

  • Author

Dear Julio,
I am not quite sure, what this function is doing - my Portuguese is not the best 😉.
I don't want to change anything, just to change the notation from e.g. 3 tied quarters to 1 dotted half - that is only happening when there are triplets in this measure.
Best, Achim

Dear Achim

The function is just length augmentation or diminution while preserving the original time points. It just augments or diminishes each of lengths but keeping the time locations of each note. It just ocurred to me, but maybe it´s not exactly what are you searching. All the best ! Julio

Create an account or sign in to comment

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.