Skip to content
View in the app

A better way to browse. Learn more.

Opusmodus

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

rewrite-pit function

Featured Replies

Hey, Opusmoders

Here is one more function in the style of the previous one (rewrite-dyn). This time to rewrite pitches.

(defun rewrite-pit (expressao-omn pitch-list)

"Substitui as alturas de uma expressão OMN por uma lista customizada,

fazendo a repetição cíclica se a lista for menor que o número de notas."

(let* ((dis (disassemble-omn expressao-omn)) ;; Desmonta a expressão [3, 6]

(pitches (getf dis :pitch)) ;; Extrai alturas atuais

(lengths (getf dis :length)) ;; Extrai durações (inclui rests) [7]

(velocities (getf dis :velocity)) ;; Extrai dinâmicas [8]

(articulations (getf dis :articulation)) ;; Extrai articulações/ties [9, 10]

;; 1. Mapeia a quantidade de notas em cada sublista/compasso

(counts (mapcar #'length pitches)) ;; [2, 5]

;; 2. Calcula o total de eventos de nota para o preenchimento

(total-notes (apply #'+ (flatten counts))) ;; [2, 11]

;; 3. Gera a lista de novas alturas repetindo o padrão do usuário

(flat-pitches (gen-trim total-notes pitch-list)) ;; [2, 4]

;; 4. Redistribui as alturas na estrutura de sublistas original

(structured-pitches (gen-divide counts flat-pitches))) ;; [2, 5]

;; 5. Remonta o objeto OMN completo preservando os demais parâmetros

(make-omn :pitch structured-pitches

:length lengths

:velocity velocities

:articulation articulations))) ;; [2, 3]

;;USE

(setf expressao-omn '((s eb4 d4 e a4 -s s eb4 tie) (h eb4 a4 -s eb4 d4 -s tie)

(e. d4 a4 eb4 d4)

(-q e f4 s c5 qs fs4)))

Using both rewrite-dyn and rewrite-pit

(rewrite-pit expressao-omn '(c4 e4 d4 c4 c4))

(rewrite-dyn (rewrite-pit expressao-omn '(c4 e4 d4 c4 c4)) '(ff > p p< ff> pp ff p p< ff p mf ppp p < ff))

Best !!

Julio Herrlein

Create an account or sign in to comment


Copyright © 2014-2026 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy

Account

Navigation

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.