mapping attributes to Note Length

Recommended Posts

Hello,

I am trying to assign articulations (attributes) to certain note lengths

my attempt:

```(setf omn '((q e3 p -q s a4) (s f3 mp -s) (e g3 mf)))
(setf rh (omn :length omn))
;=> ((1/4 -1/4 1/16) (1/16 -1/16) (1/8))

;; how is it possible to convert the ratios to omn-notation?:
(setf rhomn '((q -q s) (s -s) (e)))

(setf aq '(ord)
as '(stacc)
ae '(spicc)
a-q '(-)
a-s '(-))

(setf art (assemble-section 'a (flatten rhomn)))

;;I don't understand how to handle the rests

(setf pch (omn :pitch omn))
(setf vel (omn :velocity omn))

(make-omn :length rh
:pitch pch
:velocity vel
:articulation art)
; => ((q e3 p ord - s a4 ord) (s f3 mp -) (e g3 mf stacc))```

Which method can I use to achieve the correct assignment of the attributes to the specific note lengths, in order to obtain this result?

`((q e3 p ord -q s a4 stacc ) (s f3 mp stacc -s) (e g3 mf spicc))`

Thank you very much for any help or advice you can give me,
best wishes
AO

Share on other sites

One solution would be:

```(setf omn '((q e3 p -q s a4) (s f3 mp -s) (e g3 mf)))

(setf dictum '((:any q :apply ord)
(:any e :apply spicc)
(:any s :apply stacc)))

(dictum dictum omn)
=> ((q e3 p ord - s a4 stacc) (s f3 mp stacc -) (e g3 mf spicc))```

Share on other sites

Another solution is also possible with the function length-map:

```(setf omn '((q e3 p -q s a4) (s f3 mp -s) (e g3 mf)))

(setf out (length-map '((q ord)(s stacc)(e spicc)) omn))
=> ((q e3 p ord - s a4 stacc) (s f3 mp stacc -) (e g3 mf spicc))```

best wishes

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
• Browser

• Video Gallery

• Lessons