BrianCope Posted November 6, 2017 Share Posted November 6, 2017 Hello All Can anyone help me develop a function which superimposes a rhythm onto a constant list of pitches? For example, how would I go about superimposing a rhythm like (1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16 3/8) on to list of pitches like (infinity-series 100 '(g4 gs4)) => (g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 fs4 a4 g4 gs4 a4 fs4 e4 b4 g4 gs4 fs4 a4 gs4 g4 f4 bb4 a4 fs4 e4 b4 fs4 a4 g4 gs4 e4 b4 a4 fs4 b4 e4 d4 cs5 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 f4 bb4 gs4 g4) So that the melody would be: => (g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 fs4 a4 g4 gs4 a4 fs4 e4 b4 g4 gs4 fs4 a4 gs4 g4 f4 bb4 1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16 => (1/2 g4 1/16 fs4 7/16 a4 1/8 gs4 3/8 f4 3/16 f4 5/16 g4 1/4 fs4 1/4 a4 5/16 g4 3/16 g4) I want to set each pitch to a constant value, for e.g 1/16 then superimpose the rhythm so that rather than span the rhythm to the pitches, the rhythm swallows the pitches leaving a resultant melody. I hope this makes sense. Any help gratefully received. Best wishes Brian opmo 1 Quote Link to comment Share on other sites More sharing options...
AM Posted November 6, 2017 Share Posted November 6, 2017 like that? (setf lengths '(1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16)) (setf pitches '(g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 fs4 a4 g4 gs4 a4 fs4 e4 b4 g4 gs4 fs4 a4 gs4 g4 f4 bb4 a4 fs4 e4 b4 fs4 a4 g4 gs4 e4 b4 a4 fs4 b4 e4 d4 cs5 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 f4 bb4 gs4 g4)) ;;; get the pitches (loop for i in (append (list 0) (cumulative-sums (loop for k in lengths collect (/ k 1/16)))) collect (nth i pitches)) ;;; a function which generates OMN-format (defun superimpose (lengths pitches) (make-omn :length lengths :pitch (loop for i in (append (list 0) (cumulative-sums (loop for k in lengths collect (/ k 1/16)))) collect (nth i pitches)))) ;;; evaluate -> OMN output (superimpose '(1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16) '(g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 fs4 a4 g4 gs4 a4 fs4 e4 b4 g4 gs4 fs4 a4 gs4 g4 f4 bb4 a4 fs4 e4 b4 fs4 a4 g4 gs4 e4 b4 a4 fs4 b4 e4 d4 cs5 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 f4 bb4 gs4 g4)) opmo and JulioHerrlein 2 Quote Link to comment Share on other sites More sharing options...
BrianCope Posted November 6, 2017 Author Share Posted November 6, 2017 Thank you, that's exactly what I was looking for!! Much appreciated! Brian Quote Link to comment Share on other sites More sharing options...
AM Posted November 6, 2017 Share Posted November 6, 2017 you're welcome :-) greetings andré Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted November 6, 2017 Share Posted November 6, 2017 Hello, All I'm trying to work out André's solution examples to make partitions out of tone rows or infinity series (setf lengths '(1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16)) (setf pitches '(g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 fs4 a4 g4 gs4 a4 fs4 e4 b4 g4 gs4 fs4 a4 gs4 g4 f4 bb4 a4 fs4 e4 b4 fs4 a4 g4 gs4 e4 b4 a4 fs4 b4 e4 d4 cs5 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 f4 bb4 gs4 g4)) ;;; get the pitches (setf pitsublist (loop for i in (append (list 0) (cumulative-sums (loop for k in lengths collect (/ k 1/16)))) collect (nth i pitches)) ; All ok but what I need next is to take the nth order sublist generated in André's solution to chordize it in partitions ala Babbitt. chordize (gen-divide '(2 1 3) '(pitsublist) chordize-list (gen-divide '(2 1 3) '(pitsublist)))) Any hint ? Thanks a lot ! Quote Link to comment Share on other sites More sharing options...
opmo Posted November 6, 2017 Share Posted November 6, 2017 Have you check the TIME-POINT-SYSTEM function. Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted November 6, 2017 Share Posted November 6, 2017 Dear Janusz, This is the closest I get. I suppose it isn't related to Time-point. I'll try to explain. 1) There is a general list of pitches from a certain source (a row, for example) 2) From this list, we use the rhythm list as a skip list of pitches, picking the notes from a sequence. 3) The sequence of note picks is related to the lenght of note divided by the small quantized value, for example, the 16th note. 4) So, the lenght sequence (1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16)) Will result in a pick skip note sequence like (8, 1, 7, 2, 6, 3, 5, 4, 4, 5, 3) 5) The pick-skip note acts like 8 - means pick the first and skip 7 from the first list of pitches 1 - means pick the first and skip 0 from the first list of pitches 7 - means pick the first and skip 6 from the first list of pitches and so on... This will result in a sublist of first list of pitches, based on the skipped notes, taken every nth notes. according to the sequence. 5) The missed step is that I want to chordize this sublist to an desired HARMONIC partition, like for example 2 trichords, 1 dyad, 3 single notes and a tetrachord, using something like this: (chordize (gen-divide '(3 3 2 1 1 1 4) 'pitches sublist)) Here is the closer I get. Best, Julio (setf lengths '(1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16)) (setf pitches '(g5 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 fs4 a4 g4 gs4 a4 fs4 e4 b4 g4 gs4 fs4 a4 gs4 g4 f4 bb4 a4 fs4 e4 b4 fs4 a4 g4 gs4 e4 b4 a4 fs4 b4 e4 d4 cs5 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 f4 bb4 gs4 g4)) (def-score time ( :key-signature 'chromatic :time-signature time-sig :tempo 112 :layout (clarinet-layout 'clarinet) ) (clarinet :length lengths :pitch (loop for i in (append (list 0) (cumulative-sums (loop for k in lengths collect (/ k 1/16)))) collect (nth i pitches)) :channel 1 :sound 'gm :program 'piano )) Quote Link to comment Share on other sites More sharing options...
AM Posted November 6, 2017 Share Posted November 6, 2017 something like this? don't know if it's like this... you want to project a chord on these "filtered pitches"? (setf lengths '(1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16)) (setf pitches '(g5 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 fs4 a4 g4 gs4 a4 fs4 e4 b4 g4 gs4 fs4 a4 gs4 g4 f4 bb4 a4 fs4 e4 b4 fs4 a4 g4 gs4 e4 b4 a4 fs4 b4 e4 d4 cs5 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 f4 bb4 gs4 g4)) (setf chord-intervals '(3 1 2 2)) (make-omn :length lengths :pitch (loop for i in (append (list 0) (cumulative-sums (loop for k in lengths collect (/ k 1/16)))) append (chordize (interval-to-pitch chord-intervals :start (nth i pitches))))) JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
opmo Posted November 6, 2017 Share Posted November 6, 2017 I think you are looking for something like that: (setf length '(1/2 1/16 7/16 1/8 3/8 3/16 5/16 1/4 1/4 5/16 3/16 3/8)) (setf infinity (infinity-series 100 '(g4 gs4))) => (g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 fs4 a4 g4 gs4 a4 fs4 e4 b4 g4 gs4 fs4 a4 gs4 g4 f4 bb4 a4 fs4 e4 b4 fs4 a4 g4 gs4 e4 b4 a4 fs4 b4 e4 d4 cs5 gs4 g4 f4 bb4 g4 gs4 fs4 a4 f4 bb4 gs4 g4 bb4 f4 eb4 c5 g4 gs4 fs4 a4 gs4 g4 f4 bb4 fs4 a4 g4 gs4 a4 fs4 e4 b4 f4 bb4 gs4 g4) (time-swallow 1/16 1 length pitch) => (g4 fs4 a4 gs4 f4 f4 g4 fs4 a4 g4 g4 a4) (make-omn :length length :pitch (time-swallow 1/16 1 length pitch)) => (h g4 s fs4 q.. a4 e gs4 q. f4 e. qs g4 q fs4 a4 qs g4 e. q. a4) (make-omn :length length :pitch (time-swallow 1/16 '(3 3 2 1) length pitch)) => (h g4gs4fs4 s fs4a4g4 q.. a4g4 e gs4 q. f4bb4g4 e. f4bb4gs4 qs g4bb4 q fs4 a4fs4e4 qs g4gs4fs4 e. g4f4 q. a4) (make-omn :length length :pitch (time-swallow 1/16 '(3 3 2 1) length pitch :type 2)) => (h g4gs4fs4 s g4gs4a4 q.. fs4e4 e gs4 q. a4f4bb4 e. c5fs4a4 qs a4fs4 q fs4 f4bb4a4 qs fs4a4g4 e. fs4b4 q. cs5) I made some changes the function which allows you now to assign a chord size to the pitch output. JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted November 6, 2017 Share Posted November 6, 2017 Thanks a lot, Janusz. This swallow function is already avaiable in Opusmodus? Do I have to update ? Best, Julio Quote Link to comment Share on other sites More sharing options...
opmo Posted November 6, 2017 Share Posted November 6, 2017 The update will be released tomorrow. The final function name might be different. JulioHerrlein and BrianCope 1 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted November 6, 2017 Share Posted November 6, 2017 Dear André, I´m going to check your solution soon. Thanks, friends ! Very inspiring ! Best, Julio Quote Link to comment Share on other sites More sharing options...
BrianCope Posted November 6, 2017 Author Share Posted November 6, 2017 Thank you so much Janusz!! I love the way you creative lisp-coders can hear an idea and immediately create a lisp-realisation (with extensions)!!! What am amazing community. I'll look forward to the update. All the best Brian JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
opmo Posted November 8, 2017 Share Posted November 8, 2017 JulioHerrlein 1 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.