Stephane Boussuge Posted March 19, 2017 Share Posted March 19, 2017 Hi, Here is a short example of OMN deconstruction/reconstruction technique useful when you want to do functions for working directly with omn. ;; Example of function application based on binary-list. (flatten (do-section '(0 1 0) '(chord-interval-add '(4) x) (mclist '(c4 d4 e4)))) ;;; Function example to search for '1/4 length and process the corresponding ;;; pitch for add Major 3rd interval when '1/4 is found. ;;; It is also a good example of deconstruction/reconstruction of OMN ;;; inside a function (defun add-3rd-quarter (omn) (let ((plist (disassemble-omn omn))) (setf (getf plist :pitch) (flatten (do-section (binary-invert (gen-binary-remove '1/4 (getf plist :length))) '(chord-interval-add '(4) x) (mclist (getf plist :pitch))))) (apply 'make-omn plist))) (add-3rd-quarter '(e c4 p d4 q e4 f stacc e f4 p a4 q g4 f stacc)) => (e c4 p d4 q e4gs4 f stacc e f4 p a4 q g4b4 f stacc) SB. Quote Link to comment Share on other sites More sharing options...
AM Posted March 19, 2017 Share Posted March 19, 2017 an other solution... same result... greetings andré ;;; by using SINGLE-EVENTS -> my preferred tool (defun alt-add-3rd-quarter (omn-list) (loop for i in (single-events omn-list) when (equal (first i) 'q) append (omn-replace :pitch (chord-interval-add '(4) (list (second i))) i) else append i)) (alt-add-3rd-quarter '(e c4 p d4 q e4 f stacc e f4 p a4 q g4 f stacc)) => (e c4 p e d4 p q e4gs4 f stacc e f4 p e a4 p q g4b4 f stacc) Stephane Boussuge 1 Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted March 19, 2017 Author Share Posted March 19, 2017 Great example with single-events ! Thank you André ! S. Quote Link to comment Share on other sites More sharing options...
opmo Posted March 19, 2017 Share Posted March 19, 2017 Yes, with SINGLE-EVENTS we can work on every parameter. Quote Link to comment Share on other sites More sharing options...
AM Posted March 19, 2017 Share Posted March 19, 2017 my wish for SINGLE-EVENTS would be to add user-defined "informations" to an event -> like voice-number, oder instrument, or.... Quote Link to comment Share on other sites More sharing options...
opmo Posted March 19, 2017 Share Posted March 19, 2017 The new implementation of voices will allow to do that. Stephane Boussuge and AM 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.