# How to get time signature to repeat for each list in dictum?

## Recommended Posts

In the toy I made for learning from documented examples, my time signatures only go on for the 4 bars that realize the first list in my dictum. After that, the score just keeps re-using the 4th bar's time signature rather than repeating the same group of meter changes. Clearly, I'm misunderstanding something fundamental, so rather than describe the situation in words, if you preview the toy's score, you'll see how my 2/4 3/8 2/4 2/4 meter only gets used for the first 4 bars. How do I make it span over everything counterpoint generates?

```(progn
(setf my-dictum '(((- 1 2 -))
((1 - - 2))
((2 - - 2))
((1 2 2 1))))

(setf times (* 1 (length my-dictum)))
(setf my-root -0)
(setf my-intervals '(0 1 4 7))
(setf my-pitches (pitch-transpose my-root (integer-to-pitch my-intervals)))
(setf my-lengths (rnd-sample times '((q e) (q q)) :seed 356))
(setf my-articulations (span my-lengths '(-)))

(setf my-velocities '(pp p mp mf f ff))

(setf my-sequence (make-omn
:length my-lengths
:pitch my-pitches
:velocity my-velocities))

(setf my-chord-sequence (make-omn
:length my-lengths
:pitch (gen-chord2 '(2 4) '(2 2 3 4)
'((c4 cs4 e4 g4)
(c4 cs4 e4 g4)))
:velocity my-velocities
:articulation my-articulations))

(setf my-time-signature (get-time-signature my-sequence))

(counterpoint (list my-sequence my-chord-sequence)
my-dictum
:global-methods '((fl) (cl) (hn) (vc))
:index 'voice1-)

(ps 'gm
:fl (list voice1-1)
:cl (list voice1-2)
:hn (list voice1-3)
:vc (list voice1-4)
:tempo 161
:time-signature my-time-signature)
)```

##### Share on other sites

Hi,

here's your code slightly modified to give you and example of the usage of counterpoint function with multiple lists.

As you can see, the :sequence keyword in dictum allow you to choose for each instrument in which list you pick the patterns.

I've added 2 more lines to your dictum to show how to use :span to constrain the time signature on some bars.

The :extend keyword allow you to add rest at the end (default) or at the start (:extend '(s))) of the bar when a bar is extended by :span keyword.

Hope this example will help.

Best regards.

Stéphane Boussuge

```

(progn
(setf my-dictum '(((- 1 2 -) :sequence '(1 1 2 1))
((1 - - 2) :sequence '(1 1 2 1))
((2 - - 2) :sequence '(1 1 2 1))
((1 2 2 1) :sequence '(1 1 2 1))
((3 1 3 2) :span 4/4 :sequence '(1 1 2 1) :extend '(- s s -))
((4 1 4 1) :span 2/4 :sequence '(1 1 2 1))
))

(setf times (* 1 (length my-dictum)))
(setf my-root -0)
(setf my-intervals '(0 1 4 7))
(setf my-pitches (pitch-transpose my-root (integer-to-pitch my-intervals)))
(setf my-lengths (rnd-sample times '((q e) (q q)) :seed 356))
(setf my-articulations (span my-lengths '(-)))

(setf my-velocities '(pp p mp mf f ff))

(setf my-sequence (make-omn
:length my-lengths
:pitch my-pitches
:velocity my-velocities))

(setf my-chord-sequence (make-omn
:length my-lengths
:pitch (gen-chord2 '(2 4) '(2 2 3 4)
'((c4 cs4 e4 g4)
(c4 cs4 e4 g4)))
:velocity my-velocities
:articulation my-articulations))

(setf my-time-signature (get-time-signature my-sequence))

(counterpoint (list my-sequence my-chord-sequence)
my-dictum
:global-methods '((fl) (cl) (hn) (vc))
:index 'voice1-)

(ps 'gm
:fl (list voice1-1)
:cl (list voice1-2)
:hn (list voice1-3)
:vc (list voice1-4)
:tempo 161
)
)
```

##### Share on other sites

Thanks so much--I'll study this. It seems that messing with COUNTERPOINT because it looked cool took me too far away from what's covered in the stages. I got confused too easily. For example, COUNTERPOINT seems to be more about re-structuring sequences with unfold sets, but then I saw that example where it was used to pass the sequence between different combinations of instrumentation, which I really wanted to do. But that led me to PS and global-methods, which also aren't in the stages, so maybe I've bitten off more than I can chew for now. I'm now thinking that passing the sequence between different instrument combos might best be done without COUNTERPOINT by extracting different portions of the sequence list for different instruments in a DEF-SCORE rather than messing with PS.

Please add any learning advice you think is appropriate. Is the book more a presentation of graduated tutorials, or is it a collection of relatively independent recipes?

##### Share on other sites

On 5/7/2023 at 1:17 PM, JimmyTheSaint said:

extracting different portions of the sequence list for different instruments

In that case, you can use substitute-map.  Here's a short example for woodwind trio:

```;;;---------------------------------------------------------
;;; Parameters

(setf material
'(#|1|# (q. f4 f e fs4 q d4 s c4 f4 a4 fs4)
#|2|# (e d4 f c4 f4 a4 fs4 b4 eb4 f4)
#|3|# (h f4 a4)
#|4|# (h fs4 f b4)
#|5|# (h eb4 f4)
#|6|# (q. gs4 mp e c4 q f4 s a4 a4 gs4 b4)
#|7|# (h f4 mp a4)
#|8|# (q. a4 mp e gs4 q b4 s gs4 c4 b4 fs4)
))

(setf fl.index '(1 2 1 3 1 4 5 6 7 8))
(setf ob.index '(3 2 4 3 5 4 6 5 7 6))
(setf bn.index '(1 2 2 1 1 3 3 1 1 4))

(setf ref-list (gen-integer 1 (length material)))
(setf flute (substitute-map material ref-list fl.index))
(setf oboe (substitute-map material ref-list ob.index))
(setf bassoon (pitch-transpose
-24
(substitute-map
material
ref-list
bn.index)))

;;;---------------------------------------------------------
;;; Score and Layout

(def-score woodwind-trio
(:title "Title"
:composer "Composer"
:key-signature 'chromatic
:time-signature '((1 1 1 1) 4)
:tempo 100
:layout (wind-trio-layout 'flute 'oboe 'bassoon))

(flute
:omn flute
:channel 1
:sound 'gm
:program 'flute
:volume 95
:pan 70
:controllers (91 '(52))
)

(oboe
:omn oboe
:channel 2
:sound 'gm
:program 'oboe
:volume 95
:pan 54
:controllers (91 '(55))
)

(bassoon
:omn bassoon
:channel 3
:sound 'gm
:program 'bassoon
:volume 95
:pan 70
:controllers (91 '(57))
)
)

```

SB.

##### Share on other sites

On 5/7/2023 at 5:50 PM, Stephane Boussuge said:

Hi,

here's your code slightly modified to give you and example of the usage of counterpoint function with multiple lists.

As you can see, the :sequence keyword in dictum allow you to choose for each instrument in which list you pick the patterns.

I've added 2 more lines to your dictum to show how to use :span to constrain the time signature on some bars.

The :extend keyword allow you to add rest at the end (default) or at the start (:extend '(s))) of the bar when a bar is extended by :span keyword.

Hope this example will help.

Best regards.

Stéphane Boussuge

```(progn
(setf my-dictum '(((- 1 2 -) :sequence '(1 1 2 1))
((1 - - 2) :sequence '(1 1 2 1))
((2 - - 2) :sequence '(1 1 2 1))
((1 2 2 1) :sequence '(1 1 2 1))
((3 1 3 2) :span 4/4 :sequence '(1 1 2 1) :extend '(- s s -))
((4 1 4 1) :span 2/4 :sequence '(1 1 2 1))
))

(setf times (* 1 (length my-dictum)))
(setf my-root -0)
(setf my-intervals '(0 1 4 7))
(setf my-pitches (pitch-transpose my-root (integer-to-pitch my-intervals)))
(setf my-lengths (rnd-sample times '((q e) (q q)) :seed 356))
(setf my-articulations (span my-lengths '(-)))

(setf my-velocities '(pp p mp mf f ff))

(setf my-sequence (make-omn
:length my-lengths
:pitch my-pitches
:velocity my-velocities))

(setf my-chord-sequence (make-omn
:length my-lengths
:pitch (gen-chord2 '(2 4) '(2 2 3 4)
'((c4 cs4 e4 g4)
(c4 cs4 e4 g4)))
:velocity my-velocities
:articulation my-articulations))

(setf my-time-signature (get-time-signature my-sequence))

(counterpoint (list my-sequence my-chord-sequence)
my-dictum
:global-methods '((fl) (cl) (hn) (vc))
:index 'voice1-)

(ps 'gm
:fl (list voice1-1)
:cl (list voice1-2)
:hn (list voice1-3)
:vc (list voice1-4)
:tempo 161
)
)
```

This is strange. When you first posted this solution, I got the informative output, and the number of bars depended on what I set for times. Today, when I cut and paste your code, no matter what I set for times, when I do cmd-1 with the cursor after the last parenthesis, I only get six bars of output. What am I not seeing? I also get this error message:

```OM 25 > audition-musicxml-omn-snippet

Error: While trying to compute notation:
SeeScore returned error code 3 at line 2, column 626: "expected element not encountered"
1 (abort) Abort display notation.

Type :b for backtrace or :c <option number> to proceed.
Type :bug-form "<subject>" for a bug report template or :? for other options.```

##### Share on other sites

No error here. Just use eval. You don't use cmd-1 with PS function.

It is better for all scores to use def-score instance.

##### Share on other sites

So, right click into the score and choose Evaluate Score / Notation

##### Share on other sites

Place the cursor at the end of the score and press "Return" - thats all.

The Evaluate Score / Notation is for def-score.

##### Share on other sites

OK, I understand about the (apparent) error, but I still have my question about the strange behavior: When I do cmd-E to evaluate the PS function, the score only has six bars. Regardless of whatever times evaluates to, the score only shows six bars. I've simply copied and pasted Stephane's code from above. When I did that last week, I got many more bars, depending on the multiplier I enter for times. Now, however, I just get six bars. When I evaluate my-sequence and my-chord-sequence separately, they have much more omn than six bars, so I'm certainly missing something trivial here. I can't figure out what it is because when I simply cut and paste Stephane's code (with the ps, not the one with the def-score), I get this strange behavior: six bars regardless of what the omn evaluates to. I've attached the file. Do you see some typo in it or something? I use the .lisp extension because I prefer OM files to open in Emacs when launched from the Finder.

##### Share on other sites

The dictum is only 6 bar long, so that's totally normal.

S.

##### Share on other sites

In my original question, the dictum is only 4 bars long:

```(progn
(setf my-dictum '(((- 1 2 -))
((1 - - 2))
((2 - - 2))
((1 2 2 1))))
(setf times (* 10 (length my-dictum)))
(setf my-root -0)
(setf my-intervals '(0 1 4 7))
(setf my-pitches (pitch-transpose my-root (integer-to-pitch my-intervals)))
(setf my-lengths (rnd-sample times '((q e) (q q)) :seed 356))
(setf my-articulations (span my-lengths '(-)))

(setf my-velocities '(p mp mf f mf mp))

(setf my-sequence (make-omn
:length my-lengths
:pitch my-pitches
:velocity my-velocities))

(setf my-chord-sequence (make-omn
:length my-lengths
:pitch (gen-chord2 '(2 4) '(2 2 3 4)
'((c4 cs4 e4 g4)
(c4 cs4 e4 g4)))
:velocity my-velocities
:articulation my-articulations))

(setf my-time-signature (get-time-signature my-sequence))

(counterpoint (list my-sequence my-chord-sequence)
my-dictum
:global-methods '((fl) (cl) (hn) (vc))
:index 'voice1-)

(ps 'gm
:fl (list voice1-1)
:cl (list voice1-2)
:hn (list voice1-3)
:vc (list voice1-4)
:tempo 161
:time-signature my-time-signature)
)  ```

Then by making times a multiple of the dictum's length, I scale up the total number of bars. I asked the original question because the time signature wasn't spanning (which you addressed), but now my total number of bars doesn't scale, or even go beyond 6. I can't see the difference why your change limits it to 6 when my original was any multiple of the dictum's length that I wanted (but without the time signatures I wanted).

##### Share on other sites

I'm using sequences in Dictum and my example was an example of possible proper way to use dictum and counterpoint function.

Best

Stéphane

##### Share on other sites

I understand, and that it's best for me to work from your proper way. My question is: how does my example generate an arbitrary number of bars when your example's number of bars is limited to the cardinality of its dictum? I can't see what causes such a dramatic difference in behavior between these two similar pieces of code.

##### Share on other sites

Because `(list my-sequence my-chord-sequence)` is a list of lists.

When you call for example 1 in you dictum, you don't call the first patterns but the full first list of patterns.

Your code could work normally is you replace this list of list expression by: (flatten-sublist  `(list my-sequence my-chord-sequence))`

S.

##### Share on other sites

OK, thanks, for digging into that. I guess this has become more a question of how the code works because I'm rusty at that. For practical musical considerations, the dev said, "it is better for all scores to use def-score instance" instead of the ps function. So I guess you generally recommend using counterpoint for altering sequences and sticking with def-score for juggling instrumentation and orchestration?

##### Share on other sites

Ps function is not a problem if you stay in GM but could become a bit complicated for a new comer if you want to use it with plugins, external ports etc...

Basically the def-score is indeed the most "normal" and powerful way for OM to manage final score.

PS is for drafting/sketching or teaching. But with def-score you can assemble them into complex pieces etc...

I can't give a full course here, the subject is too big...

For instrumentation, orchestration I may use several strategies but some of my favorites are to use do-timeline or do-timeline2 functions or a different approach like counterpoint function as you made in your exercise file who is working well now with the small possible corrections I've showed to you.

S.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
• #### Browser

• Video Gallery

• Lessons