Jump to content

different notation


Recommended Posts

Hi,

could someone help me

here's a blues;-)

 

(setf blues '((-e e a5 -e e fs5 g5 e5 d5 bs4)(3e cs5 3e d5 3e cs5 e b4 q as4 tie e as4 fs4 3e cs5 d5 cs5 e a4)(e b4 cs5 d5 e5 fs5 e5 d5 cs5)(e c5 e4 g4 b4 bb4 fs4 d4 c4)(q b3 -q 3e a4 3e bb4 3e a4 e fs4 e g4 a4)(e bb4 b4 c5 cs5 d5 bb4 g4 es4)(e fs4 a4 3q b4 cs5 e5 e cs5 d5 fs5 a5)(e bb5 s a5 ab5 e g5 eb5 c5 ab4 g4 f4)(e e4 g4 b4 d5 b4 bs4 cs5 a4)(e b4 g4 e4 a4 fs4 g4 b4 d5)(e fs5 f5 cs5 a4 q d5 -e e cs5)(e c5 d5 e5 g5 bb5 3e g5 3e f5 3e d5 e c5 g4)))

 

;;; transpose loop is ok
(setf looptrans (loop for i in '(0 5) 
      append (pitch-transpose i blues)))

 

;;;main task applied to all measurements with notation error bar 2-7-12-14-19-24
(setf loopbars   (loop for bar in looptrans collect ;;or append
               (list (filter-repeat 1 (rnd-order (first (gen-divide 4 bar))
               :type :pitch :seed 3) :type :pitch) 
               (filter-repeat 1 (rnd-order (second (gen-divide 4 bar))
               :type :pitch :seed 3) :type :pitch))))

image.png.d73d96daa73e02038752f96ed2f695bc.png

 

 

 

Link to comment
Share on other sites

When gen-dividing bars with tuplets, that's what happens.

There is probably a better way but you could add a length-span that makes sure every bar is 1.

 

Jesper

 

(setf loopbars  (loop for bar in looptrans collect ;;or append
               (length-span 1 (list (filter-repeat 1 (rnd-order (first (gen-divide 4 bar))
               :type :pitch :seed 3) :type :pitch) 
               (filter-repeat 1 (rnd-order (second (gen-divide 4 bar))
               :type :pitch :seed 3) :type :pitch)))))

Link to comment
Share on other sites

They can't be.

Let's look at your second bar, just the lengths

 

(setf bar2 (omn :length (second looptrans)))

;;then you divide it 
(setf div (gen-divide 4 bar2))

;;then you take the first 4 notes and if you sum them, they are 1/4 long
(sum (first div)) ;; = 1/4

;; the next 4 notes sums to 13/24
(sum (second div));; = 13/24

;;together they make 19/24
(+ 1/4 13/24) = 19/24 which is what you got in your first example although notated as 3/4 + 1/24
(+ 3/4 1/24) = 19/24
 

It will never add up with tuplets like that.

What length-span is doing is if the lengths are too long to fit the measure, it cuts off or shortens the end , and if it is too short it repeats. So the last 4 notes in your second picture are the first 4 notes repeated, starting after 19/24 so that it adds up to 1 or a 4/4 bar

Link to comment
Share on other sites

whouahhh I see what you mean, you are an expert!
would it be possible instead of "gen-divide" to use a function to divide bar in 2? 2/4
currently blues is in 4/4

(setf blues '((-e e a5 -e e fs5 g5 e5 d5 bs4)(3e cs5 3e d5 3e cs5 e b4 q as4 tie e as4 fs4 3e cs5 d5 cs5 e a4)(e b4 cs5 d5 e5 fs5 e5 d5 cs5)(e c5 e4 g4 b4 bb4 fs4 d4 c4)(q b3 -q 3e a4 3e bb4 3e a4 e fs4 e g4 a4)(e bb4 b4 c5 cs5 d5 bb4 g4 es4)(e fs4 a4 3q b4 cs5 e5 e cs5 d5 fs5 a5)(e bb5 s a5 ab5 e g5 eb5 c5 ab4 g4 f4)(e e4 g4 b4 d5 b4 bs4 cs5 a4)(e b4 g4 e4 a4 fs4 g4 b4 d5)(e fs5 f5 cs5 a4 q d5 -e e cs5)(e c5 d5 e5 g5 bb5 3e g5 3e f5 3e d5 e c5 g4)))

Link to comment
Share on other sites

Maybe just:

 

(setf blues '((-e e a5 -e e fs5 g5 e5 d5 bs4)(3e cs5 3e d5 3e cs5 e b4 q as4 tie e as4 fs4 3e cs5 d5 cs5 e a4)(e b4 cs5 d5 e5 fs5 e5 d5 cs5)(e c5 e4 g4 b4 bb4 fs4 d4 c4)(q b3 -q 3e a4 3e bb4 3e a4 e fs4 e g4 a4)(e bb4 b4 c5 cs5 d5 bb4 g4 es4)(e fs4 a4 3q b4 cs5 e5 e cs5 d5 fs5 a5)(e bb5 s a5 ab5 e g5 eb5 c5 ab4 g4 f4)(e e4 g4 b4 d5 b4 bs4 cs5 a4)(e b4 g4 e4 a4 fs4 g4 b4 d5)(e fs5 f5 cs5 a4 q d5 -e e cs5)(e c5 d5 e5 g5 bb5 3e g5 3e f5 3e d5 e c5 g4)))

 

(setf looptrans (loop for i in '(0 5) append (pitch-transpose i blues)))

 

(setf tmp (omn-to-measure looptrans 1/2))

;;randomizing and back to 4/4

(setf res (omn-to-measure (loop for x in tmp collect (rnd-order x :type :pitch :seed nil)) 4/4))
;;or reversing the order

(setf res (omn-to-measure (loop for x in (gen-divide 2 tmp) collect (reverse x)) 4/4))

 

Jesper

Link to comment
Share on other sites

Thank you Jesper!

I see by doing this option,  notation is ok! with tie on bar 2...bizarre...so!

 

image.png.62cd649c3ddb0860fa18f723eeda4c22.pngyou were right, I deleted the tie bar 2, second time on "blues"!
there is no more problem now!🙏

 

Are you musician, composer ?

do you have any advice for me to progress with om?

I am a jazz saxophonist and I 'm looking to develop my harmonic and rhythmic language with OM...in a simple way;-))

 

thank you for your clear explanations Jesper.

 

Link to comment
Share on other sites

Hi,

I am not changing subject because it is about division of bar.

 

(setf Like '((e f4 g4 a4 bb4 c5 d5 q e5)(e d4 e4 f4 g4 q a4 -q)(e f5 e5 d5 c5 b4 a4 q gs4)(e e5 d5 c5 bb4 a4 g4 q fs4)(e g4 a4 bb4 c5 q d5 -q)(e f5 e5 d5 c5 b4 a4 q gs4)(e f4 g4 a4 bb4 c5 d5 q e5)(e f4 g4 a4 bb4 c5 d5 q eb5)(e bb4 c5 d5 e5 f5 g5 q a5)(e a4 b4 cs5 d5 e5 fs5 q g5)(e d4 e4 fs4 g4 a4 b4 cs5 b4)(e a4 g4 fs4 e4 q d4 -q)(e g4 a4 b4 c5 d5 e5 f5 e5)(e d5 c5 b4 a4 q g4 -q)(e c5 d5 e5 f5 g5 a5 bb5 a5)(e g5 f5 e5 d5 q c5 -q)(e f4 g4 a4 bb4 c5 d5 q e5)(e d4 e4 f4 g4 q a4 -q)(e f5 e5 d5 c5 b4 a4 q gs4)(e d4 e4 fs4 g4 a4 bb4 q c5)(e g4 a4 bb4 c5 q d5 -q)(e f5 e5 d5 c5 b4 a4 q gs4)(e f4 g4 a4 bb4 c5 d5 q e5)(e f4 g4 a4 bb4 c5 d5 q eb5)(e bb4 c5 d5 e5 f5 g5 q a5)(e a4 b4 cs5 d5 e5 fs5 q g5)(e d4 e4 fs4 g4 a4 b4 q cs5)(e f5 e5 d5 c5 b4 a4 q gs4)(e e5 d5 c5 bb4 a4 g4 q fs4)(e c4 d4 e4 f4 g4 a4 q bb4)(e f4 g4 a4 bb4 c5 d5 q e5)(e c5 d5 e5 f5 g5 a5 bb5 a5)))

 

;;;I divide bar in two ( 2/4-2/4)

(setf tmpO (omn-to-measure Like 1/2))

 

after divide bar in half to randomize each part of 2/4, I reassemble in 4/4

(setf res (omn-to-measure (loop for x in tmpO collect (filter-repeat 1 (rnd-order x :type :pitch))) 4/4))

 

;;;;randomizing length on res pitch
(setf melo  (make-omn
:pitch (omn :pitch  (omn-to-measure (loop for x in tmpO collect (filter-repeat 1 (rnd-order x :type :pitch))) 4/4))
:length (gen-eval 32 '(rnd-order '(e e e -e e e_q)):seed 86138)))

 

This is where I have a problem with division of pitches which should respect tmp0 (2/4)

 

could someone help me please.

 

David

 

 

 

Link to comment
Share on other sites

Seem to me that rnd-order is not working well with length-symbols for some reason.

Try this 

;;Convert the length-symbols to ratios

(setf lengths (mapcar 'length-symbolp '(e e e -e e e_q)))

 

;;randomizing length on res pitch
(setf melo (make-omn
             :pitch (omn :pitch (omn-to-measure (loop for x in tmpO collect (filter-repeat 1 (rnd-order x :type :pitch))) 4/4))
             :length (gen-eval 32 '(rnd-order lengths) :seed 86138))
      )
 

 

Jesper

 

This works but converting to length symbols is better since the tied note (e_q ) comes in unusual positions

 

(defun scramble (lst)
  (let ((positions (rnd-order (loop for i to (- (length lst) 1) collect i))))
    (loop for pos in positions collect (nth pos lst)))
  )

(setf melo (make-omn
             :pitch (omn :pitch (omn-to-measure (loop for x in tmpO collect (filter-repeat 1 (rnd-order x :type :pitch))) 4/4))
             :length (gen-eval 32 '(scramble '(e e e -e e e_q)) :seed 86138))
      )
 

 

Link to comment
Share on other sites

here is comparison with your first solution on the first 4 bars. tmpO (reservoir of notes)

 

image.png.2bbe115680f860839950c4b5362a600b.png

result on 4/4. I'm trying to understand the logic... because some notes slip in the second part of the bar...it can be an interesting musical aspect...harmonic shift;-)

image.png.30dd8a83ef9f4f353e05eea1f771bd29.png

 

here is comparison with your second solution

tmp0

image.png.2bbe115680f860839950c4b5362a600b.png

 

result on 4/4. same I'm trying to understand the logic, it seems to be the same thing???

image.png.fe620bfd78a58620abb6e0b072a30ec5.png

 

merci pour tes explications claires Jesper!!

 

 

 

 

 

Link to comment
Share on other sites

length-symbolp is a way I found to convert length-symbols '(e e e -e e e_q) to ratios (1/8 1/8 1/8 -1/8 1/8 3/8)

It's actually for checking if an object is a length-symbol, like

(length-symbolp 'c4) 

->nil
(length-symbolp 1/8)

->nil

(length-symbolp 'e)
->1/8

 

The difference is the tied notes in your last picture. you don't want 3 tied 1/8-notes when you can write a dotted 1/4, so ratios work better here.

The second way with scramble would give the same result if you supply it with ratios instead of length-symbols

 

(setf melo (make-omn
             :pitch (omn :pitch (omn-to-measure (loop for x in tmpO collect (filter-repeat 1 (rnd-order x :type :pitch))) 4/4))
             :length (gen-eval 32 '(scramble '(1/8 1/8 1/8 -1/8 1/8 3/8)) :seed 86138))
      )

 

You know Opusmodus can use both length-symbols and ratios.

Example from the help file:

 

(setf pitch '(c3 eb3 a3 eb3 bb4 e3 gs4 cs3 fs4))
(make-omn
 :length '(e s s)
 :pitch pitch
 :velocity '(pp mf)
 :span :pitch
 :length-symbols nil)
=> (1/8 c3 pp 1/16 eb3 mf a3 pp 1/8 eb3 mf
    1/16 bb4 pp e3 mf 1/8 gs4 pp 1/6 cs3 mf fs4 pp)

 

Link to comment
Share on other sites

wouah man!!

complicated for me to understand how OM will draw the notes from tmp0 (2/4) to assemble with omn-to-measure (4/4.

Maybe I should not randomize the pitches for a better understanding 😱 

Link to comment
Share on other sites

That's the point with random, you get a new result each time unless you use the :seed argument

Here is rnd-order with seed = 1

 

(setf res (omn-to-measure (loop for x in tmpO collect (filter-repeat 1 (rnd-order x :type :pitch :seed 1))) 4/4)) 

If you evaluate several times the result should be the same. If you change the :seed then you will get a different result

but the same every time.

 

Sorry, but English is not my main language, maybe someone else can explain better.

 

 

 

Jesper

Link to comment
Share on other sites

Yes, that's why ratios are better here. It shouldn't make any difference but for some reason rnd-order

gives results like below sometimes. Not just reordering but using the same value 3/8 several times.

It might be a bug.

 

(rnd-order '(e e e -e e e_q))
=>(3/8 3/8 1/8 3/8 1/8 -1/8)

 

As I said scramble can handle length-symbols but you're better of with ratios because of the ties. 
 

Here is scramble with added seed

 

(defun scramble (lst &key (seed nil))
  (let ((positions (rnd-order (loop for i to (- (length lst) 1) collect i) :seed seed)))
    (loop for pos in positions collect (nth pos lst)))
  )

(scramble '(1/8 1/8 1/8 -1/8 1/8 3/8) :seed 1)
(scramble '(e e e -e e e_q) :seed 1)
 

Jesper

Link to comment
Share on other sites

Dear Jesper,

the seed in OM is a bit special, to use correctly without broke the overall seeds I think it is better to  program your nice scramble function that way:

 

(defun scramble (lst &key seed)
  (setf state *init-seed*)
  (setf seed (rnd-seed seed))
  (do-verbose ("scramble seed: ~s" seed)
    (let ((positions (rnd-order (loop for i to (- (length lst) 1) collect i) :seed seed)))
      (loop for pos in positions collect (nth pos lst)))
    ))

It allow also the display of the seed when you call the function.

 

But you could use rnd-order that way:

 

(rnd-order '(e e e -e e e_q) :encode nil)

Link to comment
Share on other sites

Ah, yes, thanks Stephane. That's what I normally use. Just wanted to quickly show a point about random.

Do you happen to know why rnd-order does not work properly with length-symbols?

That you can get results like this?

 

(rnd-order '(e e e -e e e_q))
=>(3/8 3/8 1/8 3/8 1/8 -1/8) 

 

Jesper 

Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy