March 1, 20233 yr Hello! I have a series of lists which are algorithmically generated: (setf pitch-mat (vector-to-pitch '(e3 e5) (gen-noise 64 :seed 458 :type :gaussian))) (setf pch1 (flatten (rnd-order (gen-divide 8 pitch-mat)))) (setf size 12) (setf line1 (length-legato (gen-filter-euclidean size 12 1 12 pch1 's :seed 45 :velocity '(p)))) Under the code above, Line 1 evaluates as ((e gs4 p s c5 a4 e s c5 e4 e f4 s gs3 b3) (e. g4 p f4 e4 fs3) (s b4 p e4 fs4 f4 gs4 d4 bb3 bb3 b3 bb3 gs4 c4) (e. d4 p e cs4 e. f4 e fs4 gs4) (e e3 p s b3 e e5 b3 s fs4 e a3 cs4) (s fs3 p cs4 g4 fs4 gs4 fs4 c5 a4 a4 e4 e c5) (e f4 p s gs3 b3 e g4 s eb4 f4 e d4 s e4 bb3) (e c4 p s b4 b3 b4 e4 e fs4 s gs4 d4 bb3 bb3) (e b3 p gs4 d4 c4 b4 cs5) (e fs4 p s gs4 e b3 s d5 e b3 s e s fs4) (s a3 p eb4 cs4 c5 fs3 cs4 g4 fs4 gs4 fs4 c5 a4) (e a4 p s c5 e4 f4 f4 e gs3 s g4 e4 eb4 f4)) If I use the counterpoint feature with all of the lines as evaluated OMN, I can generate my musical piece. It works fine. (rh :omn '(#|1|# ((e fs4 p s a4 e4 e c5 s gs4 e4 e f4 s s g4) (e. f4 p e4 fs3 e4) (s bb3 p e4 bb3 d4 fs4 f4 gs4 b4 c4 d4 cs4 cs4) (e. c4 p e b3 e. eb4 e cs5 a3) (e b3 p s e e3 d5 s b3 e fs3 g4) (s eb4 p fs4 cs4 cs4 fs4 a4 a4 e4 c5 c5 e gs4) (e f4 p s s g4 e f4 s b3 e4 e c4 s fs3 b4) (e e4 p s bb3 d4 bb3 e4 e bb3 s fs4 f4 gs4 b4) (e c4 p cs4 c4 bb3 b4 fs4) (e cs5 p s a3 e b3 s e5 e b3 s eb4 e d5 s b3) (s fs3 p c5 g4 a3 eb4 fs4 cs4 cs4 fs4 a4 a4 e4) (e c5 p s gs4 e4 f4 gs3 e f4 s s eb4 b3 e4)) :channel 1 :sound 'gm :program 0 :volume 90 :pan 64) This works as expected. However, if I use the list variable/name instead of the explicit OMN: (rh :omn '(#|1|# line1) :channel 1 :sound 'gm :program 0 :volume 90 :pan 64) It does not work properly. This makes sense to me because we are listing the OMN as specified by the :omn reference. My question is - will I be able to build my counterpoint without explicitly adding the OMN and merely using list names? To be clear, I'm not blocked by this issue. I can easily evaluate each list by name and add the evaluated OMN into the counterpoint function. I'm just posting this as I'm curious if there's a more elegant way to reach my goal. Using the list variable/name would be a more efficient workflow if I need to tweak the parameters of the algorithmically generated OMN. Thanks, THT
March 1, 20233 yr You can't do that. this is only use for bars - bar numbers. (rh :omn '(#|1|# line1) :channel 1 :sound 'gm :program 0 :volume 90 :pan 64)
March 1, 20233 yr Author I suspected that was the case. I will just evaluate and us the OMN. Thanks for letting me know! THT
March 1, 20233 yr If really you want to do that you can do: `(#|1|# ,line1) But that's a bit strange usage of OM.
March 3, 20233 yr just wondering? Why '(#|1|# line1) Why not omn: line1 `(#|1|#, line1) is the same as (list line1 ) . Adds an extra level of () to line1 #|1|# is a comment and can be added anywhere: omn: #|1|# line1
March 3, 20233 yr I don't see any logic to use the comment #|1|# here especially in the instrument instance :omn
March 3, 20233 yr Exactly. But , why not. There is no harm in comments. If it helps for any reason. The original problem seems to me, was: :omn '(line1) That does not work, because line1 is not evaluated, but given to :omn as a symbol. :omn line1 should work. If for any reason I can't see there needs to be an extra () , (list line1) will do. I didn't look into counterpoint yet. Maybe things have to be done differently. Tom, could you try :omn line1 instead of :omn '(line1) and see if that solves the original posted problem? Try with #|1|# or without. There is no difference. You probably know about comments: ; ignores everything to end of line. #|......|# ignores everything between #| and |# . So you can comment several lines of code. #!......!# works in opusmodus. It is not mentioned in the Common-lisp-Hyperspec but handy on my German Apple keyboard.
Create an account or sign in to comment