JulioHerrlein Posted August 19 Share Posted August 19 Dear All, I was trying some old codes and this started to bug... The length-map :repeat keyword no longer works... what´s happening ? I have a lot of files using this... (setf v1mat-a (make-omn :length rv1 :pitch pit-chmd1 ;repitch1 :span :length :velocity (length-map len-map2 rv1 :otherwise '(mf) :repeat t ) :articulation (length-map len-map1 rv1 :otherwise '(ord) :repeat t ))) Error: Unexpected keyword :repeat which is not one of (:otherwise :rnd :group :section :exclude :seed). 1 (continue) Ignore the unknown keyword :repeat. 2 (abort) Return to top loop level 0. Quote Link to comment Share on other sites More sharing options...
opmo Posted August 20 Share Posted August 20 Please check the new document. JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted August 21 Author Share Posted August 21 Thanks, but I found no mention about the :repeat keyword in the length-map doc. Quote Link to comment Share on other sites More sharing options...
opmo Posted August 21 Share Posted August 21 :group t JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted August 22 Author Share Posted August 22 Dear Janusz, I don´t know what´s wrong here (setf repitch2 '((e4 g4 c5) (db4 cs5 gs4 f4) (fs4) nil nil (ab4 bb4 g4 gs4) (b3 d5 fs4) (eb4 bb4) (d4) nil (c4 a4 d5 b4) (b3) nil (a3) (d4) (fs4) (bb3 c5))) (setf rv2 '((1/8 1/16 1/16) (1/16 1/16 1/16 1/16) (1/4) (-1/4) (-1/4) (1/16 1/16 1/16 1/16) (1/16 1/16 1/8) (-1/8 1/16 1/16) (1/4) (-1/4) (1/16 1/16 1/16 1/16) (1/4) (-1/4) (1/4) (1/4) (1/4) (1/8 1/8) (1/16 1/8 1/16) (1/16 1/16 1/8) (1/8 1/16 1/16) (1/16 1/8 1/16) (1/8 1/8) (1/16 1/8 1/16) (1/16 1/16 1/8) (1/8 1/16 1/16) (1/16 3/16) (1/4) (1/4) (1/4) (1/16 3/16) (1/4) (1/4) (1/8 1/8) (1/4) (1/4) (1/4) (1/8 1/8) (1/8 1/8) (1/16 1/8 1/16) (1/16 1/16 1/8) (1/8 1/16 1/16) (1/16 1/8 1/16) (1/8 1/8) (1/16 1/8 1/16) (1/16 1/16 1/8) (1/8 1/16 1/16) (1/4) (1/4) (1/16 1/8 1/16) (1/4) (1/4) (1/4) (3/16 1/16) (1/16 1/8 1/16) (1/16 1/16 1/8) (1/8 1/16 1/16) (1/16 1/8 1/16) (1/8 1/8) (1/16 1/8 1/16) (1/16 1/16 1/8) (1/8 1/16 1/16) (1/4) (-1/4) (-1/4))) (setf len-map1 '((e (stacc)) (s (ord)) (h (long)) (h. (long)) (w (long)))) (setf len-map2 '((e (list (rnd-pick (mf f)))) (s (mf)) (e. (mf)) (h (p<f)) (h. (p<f)) (w (P<f>p))(wq (P<f>p))(wh (P<f>p))(wh. (P<f>p))(ww (P<f>p)))) (setf v2mat-a (make-omn :length rv2 :pitch repitch2 :span :length :velocity (length-map len-map2 rv2 :otherwise '(mf) :group t) :articulation (length-map len-map1 rv2 :otherwise '(ord) :group t))) The result comes with many instances of the word "list" ((e e4 list stacc s g4 mf ord c5 ord) (s db4 mf ord cs5 ord gs4 ord f4 ord) (q fs4 mf ord) (-q) (-q) (s ab4 mf ord bb4 ord g4 ord gs4 ord) (s b3 mf ord d5 ord e fs4 list stacc) (-e s eb4 mf ord bb4 ord) (q d4 mf ord) (-q) (s c4 mf ord a4 ord d5 ord b4 ord) (q b3 mf ord) (-q) (q a3 mf ord) (q d4 mf ord) (q fs4 mf ord) (e bb3 list stacc c5 stacc) (s e4 mf ord e g4 list stacc s c5 mf ord) (s db4 mf ord cs5 ord e gs4 list stacc) (e fs4 list stacc s mf ord fs4 ord) (s ab4 mf ord e bb4 list stacc s g4 mf ord) (e b3 list stacc d5 stacc) (s eb4 mf ord e bb4 list stacc s eb4 mf ord) (s d4 mf ord d4 ord e list stacc) (e c4 list stacc s a4 mf ord d5 ord) (s b3 mf ord e. ord) (q a3 mf ord) (q d4 mf ord) (q fs4 mf ord) (s bb3 mf ord e. c5 ord) (q e4 mf ord) (q db4 mf ord) (e fs4 list stacc fs4 stacc) (q ab4 mf ord) (q b3 mf ord) (q eb4 mf ord) (e d4 list stacc d4 stacc) (e c4 list stacc a4 stacc) (s b3 mf ord e list stacc s mf ord) (s a3 mf ord a3 ord e list stacc) (e d4 list stacc s mf ord d4 ord) (s fs4 mf ord e list stacc s mf ord) (e bb3 list stacc c5 stacc) (s e4 mf ord e g4 list stacc s c5 mf ord) (s db4 mf ord cs5 ord e gs4 list stacc) (e fs4 list stacc s mf ord fs4 ord) (q ab4 mf ord) (q b3 mf ord) (s eb4 mf ord e bb4 list stacc s eb4 mf ord) (q d4 mf ord) (q c4 mf ord) (q b3 mf ord) (e. a3 mf ord s ord) (s d4 mf ord e list stacc s mf ord) (s fs4 mf ord fs4 ord e list stacc) (e bb3 list stacc s c5 mf ord bb3 ord) (s e4 mf ord e g4 list stacc s c5 mf ord) (e db4 list stacc cs5 stacc) (s fs4 mf ord e list stacc s mf ord) (s ab4 mf ord bb4 ord e g4 list stacc) (e b3 list stacc s d5 mf ord fs4 ord) (q eb4 mf ord) (-q) (-q)) Wich leads to this error in the snippet call OM 54 > audition-musicxml-omn-snippet Error: OMN Parse Error: fail 1 (abort) Return to top loop level 0. Type for backtrace or :c <option number> to proceed. Type :bug-form "<subject>" for a bug report template or :? for other options. BEst Quote Link to comment Share on other sites More sharing options...
jesele Posted August 22 Share Posted August 22 Hi Julio. You could try this macro type code. Jesper (setf len-map2 `((e ,(list (rnd-pick '(mf f)))) (s (mf)) (e. (mf)) (h (p<f)) (h. (p<f)) (w (P<f>p))(wq (P<f>p))(wh (P<f>p))(wh. (P<f>p))(ww (P<f>p)))) See under Backquote and comma Macros LISPCOOKBOOK.GITHUB.IO A collection of examples of using Common Lisp JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
jesele Posted August 23 Share Posted August 23 Not sure if I can explain this properly but here's a try. The problem has nothing to do with the length-map You are quoting a function, mixing a function and values in a list. An unquoted list is expecting a function mostly (mf f) does not work because there is no function named mf '(mf f) quoted on the other hand returns it (list (rnd-pick '(mf f))) is a function which needs '(mf f) to be quoted as above and returns the result of the function mf or f '(list (rnd-pick (mf f))) quoted vill just return the function without evaluating it So here since the whole list is within quotes returns the function of the first element and not the result (setf len-map2 '((e (list (rnd-pick (mf f)))) (s (mf)) (e. (mf)) (h (p<f)) (h. (p<f)) (w (P<f>p))(wq (P<f>p))(wh (P<f>p))(wh. (P<f>p))(ww (P<f>p)))) The back quote by it's self is no different here from the regular quote (setf len-map2 `((e (list (rnd-pick (mf f)))) (s (mf)) (e. (mf)) (h (p<f)) (h. (p<f)) (w (P<f>p))(wq (P<f>p))(wh (P<f>p))(wh. (P<f>p))(ww (P<f>p)))) But with the comma before list will evaluate the function (list (rnd-pick (mf f))) which needs '(mf f) to be quoted (setf len-map2 `((e ,(list (rnd-pick '(mf f)))) (s (mf)) (e. (mf)) (h (p<f)) (h. (p<f)) (w (P<f>p))(wq (P<f>p))(wh (P<f>p))(wh. (P<f>p))(ww (P<f>p)))) Jesper as an alternative with regular quotes you could write like this but the backquote/comma is much easier. (setf len-map2 (list (list 'e (list (rnd-pick '(mf f)))) '(s (mf)) '(e. (mf)) '(h (p<f)) '(h. (p<f)) '(w (P<f>p)) '(wq (P<f>p)) '(wh (P<f>p)) '(wh. (P<f>p)) '(ww (P<f>p)))) or (setf len-map2 (cons (list 'e (list (rnd-pick '(mf f)))) '((s (mf)) (e. (mf)) (h (p<f)) (h. (p<f)) (w (P<f>p))(wq (P<f>p))(wh (P<f>p))(wh. (P<f>p))(ww (P<f>p))))) JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
opmo Posted August 23 Share Posted August 23 Julio, your code is not correct. It is important to approach the problem step by step. For example, your code snippet (setf len-map2 '((e (list (rnd-pick (mf f)))) (s (mf))...) needs to be organised in stages to ensure correctness. Attempting to fix this with a macro (script) is not a productive use of time. I recommend delving deeper into Lisp coding practices to achieve a more robust and stylistically sound implementation. And, the length-map (e (mf f)) will select at random one of the dynamic - if list - anyway JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted August 23 Author Share Posted August 23 Thanks a lot, Jesper and Janusz Yes, I need to study LISP deeper, I´m still behind in this but I´d like to remind you that this way used to work for many years. I used this code many times before. Best, Julio Quote Link to comment Share on other sites More sharing options...
opmo Posted August 24 Share Posted August 24 (setf dy1 (list 'e (rnd-pick '(mf f))) dy2 '(s mf) dy3 '(e. mf) dy4 '(h p<f) dy5 '(h. p<f) dy6 '(w P<f>p) dy7 '(wq P<f>p) dy8 '(wh P<f>p) dy9 '(wh. P<f>p) dy10 '(ww P<f>p) ) (setf dyn (assemble-seq (list dy1 dy2 dy3 dy4 dy5 dy6 dy7 dy8 dy9 dy10))) => ((e f) (s mf) (e. mf) (h p<f) (h. p<f) (w p<f>p) (wq p<f>p) (wh p<f>p) (wh. p<f>p) (ww p<f>p)) RST and JulioHerrlein 1 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted August 25 Author Share Posted August 25 Thanks for your attention, Janusz ! 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.