Jump to content
Sign in to follow this  

Disassembling incomplete OMN expressions?

Recommended Posts

Dear Janusz,


Opusmodus is already flexible enough to notate incomplete OMN forms like the following, even though the pitch is missing.


'(h mp pizz)


Because this expression is no complete OMN, omn-formp returns nil.


(omn-formp '(h mp pizz))

=> nil


However, it would be useful to still be able to disassemble this expression. Currently disassemble-omn returns an error, because the pitch is missing. However, if such expression can even be notated, then why not allowing to also disassemble it as follows.


(disassemble-omn '(h c4 mp pizz))

; desired output -- currently error is caused

=> (:length (1/2) :velocity (mp) :articulation (pizz)) 

; alternative -- likely default pitch needed for consistency

=> (:length (1/2) :pitch (c4) :velocity (mp) :articulation (pizz)) 


I am asking for this, because that would allow to implement functions that can build up OMN forms incrementally (as an alternative to make-omn), increasing flexibility. Here is an example of a not yet existing function demonstrating what I am talking about. It would complement the function edit-omn I was proposing earlier today.


(add-omn :pitch '(g4 a4)
         '((q f pizz) (h arco)))

=> ((q g4 f pizz) (h a4 arco)))


What do you think?






Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this