Rangarajan Posted March 9, 2016 Share Posted March 9, 2016 Hi, I am encountering a funny problem with the following score. As shown in the comments, notes played in some bars are not as per the supplied pitches list. Strangely, the musicxml notation and what is played agree! Request your comment on what might be wrong. ;;; --------------- ;;; Notes played in the last 2 bars are not as per this list (setf m1 '((c4) (e4) (b4) (d5) (g4) (g4) (c5 d4 c5 c5 c5) (a4 d4 a4 e5 a4))) (setf rhy1 '((-w) (-w) (-w) (-w) (-w) (-w) (1/4 1/4 1/8 1/8 1/4) (1/4 1/4 1/8 1/8 1/4))) ;;; Notes played in the 6th and 8th bars are not as per this list (setf m2 '((c4 g4 c4 f4 f4) (e4 d4 c4 d4 f4) (b4 a4 a4 d5 a4) (d5 d5 g4 g4 g4) (g4 d4 d4 g4 c4) (g4 d4 f4 g4 e4) (c5 e5 a4 c5 d4) (a4 a4 e5 e5 a4))) (setf rhy2 '((1/4 1/4 1/8 1/8 1/4) (1/4 1/4 1/8 1/8 1/4) (1/4 1/8 -1/8 1/4 1/4) (1/4 1/4 1/8 1/8 1/4) (1/4 1/8 1/8 1/4 1/4) (1/4 1/8 -1/8 1/4 1/4) (1/4 1/4 1/4 1/8 1/8) (1/8 1/8 1/4 -1/8 3/8))) (def-score progression-example ( :key-signature 'chromatic :time-signature '(4 4) :tempo 120 ) (instr1 :pitch m1 :length rhy1 :velocity '(f) :channel 1 :sound 'gm :program 'Glockenspiel) (instr2 :pitch m2 :length rhy2 :velocity '(f) :channel 2 :sound 'gm :program 'Flute) ) ;;; ------------------ Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted March 9, 2016 Share Posted March 9, 2016 it is normal, it play the notes you give. at the end, the last two bars play C4 and E4 and it is what you supply in m1. it play this pitch because you made rest before, and by the way the system don't need any notes for rest, but when normal rhythm values arrives, it furnish the pitch as given. You can achieve what you want this way: (setf m1 '((c4) (e4) (b4) (d5) (g4) (g4) (c5 d4 c5 c5 c5) (a4 d4 a4 e5 a4))) (setf rhy1 '((-w) (-w) (-w) (-w) (-w) (-w) (1/4 1/4 1/8 1/8 1/4) (1/4 1/4 1/8 1/8 1/4))) (setf m1.omn (make-omn :pitch m1 :length rhy1 :swallow t )) (setf m2 '((c4 g4 c4 f4 f4) (e4 d4 c4 d4 f4) (b4 a4 a4 d5 a4) (d5 d5 g4 g4 g4) (g4 d4 d4 g4 c4) (g4 d4 f4 g4 e4) (c5 e5 a4 c5 d4) (a4 a4 e5 e5 a4))) (setf rhy2 '((1/4 1/4 1/8 1/8 1/4) (1/4 1/4 1/8 1/8 1/4) (1/4 1/8 -1/8 1/4 1/4) (1/4 1/4 1/8 1/8 1/4) (1/4 1/8 1/8 1/4 1/4) (1/4 1/8 -1/8 1/4 1/4) (1/4 1/4 1/4 1/8 1/8) (1/8 1/8 1/4 -1/8 3/8))) (setf m2.omn (make-omn :pitch m2 :length rhy2 :swallow t )) (def-score progression-example ( :key-signature 'chromatic :time-signature '(4 4) :tempo 120 ) (instr1 :omn m1.omn :channel 1 :sound 'gm :program 'Glockenspiel) (instr2 :omn m2.omn :channel 2 :sound 'gm :program 'Flute) ) SB Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted March 9, 2016 Author Share Posted March 9, 2016 Thanks very much S.B! That seems neat, but tricky. I looked up the documentation of make-omn, but could not find any explanation of the :swallow option, but there was one example. Maybe for everyone's benefit, this could be elaborated in the documentation. By the way, isn't each nested list mapped to one bar? When generating through a function, it was easy (and natural) to do it this way. Looks like I have to do more serious study! Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted March 9, 2016 Share Posted March 9, 2016 you can also use some 'nil for the list corresponding to the rest lengths. (setf m1 '(nil nil nil nil nil nil (c5 d4 c5 c5 c5) (a4 d4 a4 e5 a4))) (setf rhy1 '((-w) (-w) (-w) (-w) (-w) (-w) (1/4 1/4 1/8 1/8 1/4) (1/4 1/4 1/8 1/8 1/4))) but it is not easy, the :swallow way is the best. What is important to understand is the fact that the system take the pitch one after the other. Anyway, please, use the MAKE-OMN way because it is primary the way Opusmodus was thought and use :omn in DEF-SCORE accordingly. SB Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted March 9, 2016 Author Share Posted March 9, 2016 OK, let me explore this. Regards, Rangarajan Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted March 9, 2016 Share Posted March 9, 2016 Here is the solution for use with you DEF-SCORE without MAKE-OMN use. This solution is to use GEN-SWALLOW function: ;;; Notes played in the last 2 bars are not as per this list (setf rhy1 '((-w) (-w) (-w) (-w) (-w) (-w) (1/4 1/4 1/8 1/8 1/4) (1/4 1/4 1/8 1/8 1/4))) (setf m1 (gen-swallow rhy1 '((c4) (e4) (b4) (d5) (g4) (g4) (c5 d4 c5 c5 c5) (a4 d4 a4 e5 a4)))) ;;; Notes played in the 6th and 8th bars are not as per this list (setf rhy2 '((1/4 1/4 1/8 1/8 1/4) (1/4 1/4 1/8 1/8 1/4) (1/4 1/8 -1/8 1/4 1/4) (1/4 1/4 1/8 1/8 1/4) (1/4 1/8 1/8 1/4 1/4) (1/4 1/8 -1/8 1/4 1/4) (1/4 1/4 1/4 1/8 1/8) (1/8 1/8 1/4 -1/8 3/8))) (setf m2 (gen-swallow rhy2 '((c4 g4 c4 f4 f4) (e4 d4 c4 d4 f4) (b4 a4 a4 d5 a4) (d5 d5 g4 g4 g4) (g4 d4 d4 g4 c4) (g4 d4 f4 g4 e4) (c5 e5 a4 c5 d4) (a4 a4 e5 e5 a4)))) (def-score progression-example ( :key-signature 'chromatic :time-signature '(4 4) :tempo 120 ) (instr1 :pitch m1 :length rhy1 :velocity '(f) :channel 1 :sound 'gm :program 'Glockenspiel) (instr2 :pitch m2 :length rhy2 :velocity '(f) :channel 2 :sound 'gm :program 'Flute) ) Best SB Quote Link to comment Share on other sites More sharing options...
Rangarajan Posted March 9, 2016 Author Share Posted March 9, 2016 Thanks SB. That was a very useful suggestion (to prefer OMN). I will try to spend more time to learn these. Regards, Rangarajan 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.