Jump to content

AM

Members
  • Posts

    798
  • Joined

  • Last visited

Everything posted by AM

  1. is this correct? i think it is - not smart-coded but it works - you could merge the functions into ONE (sorry for my english). perhaps there is an OPMO-library-solution, but i don't know it... greetings (defun step-to-pitch (&key steps pitches start) (let ((pos (car (position-item start pitches)))) (append (list (nth pos pitches)) (loop for i in steps ;; setting pos by add the step to pos do (setf pos (+ pos i)) ;; when pitch-range to small then reset to lowest pitch+step ;; could be a more intelligent solution when (or (>= pos (length pitches)) (< pos 0)) do (setf pos 0);(+ 0 i)) collect (nth pos pitches))))) (defun multiple-expand-tonality (&key startpitch octaves tonality) (remove-duplicates ;remove is for "cutting" if there are too much pitches (OMN loops last octave!) (loop repeat octaves with pitch = startpitch with cnt = 0 when (= cnt (length tonality)) do (setq cnt 0) append (expand-tonality (list pitch (nth cnt tonality))) do (incf cnt) do (setq pitch (car (pitch-transpose 12 (list pitch))))))) (defun reset-seq (seq) (let ((n (abs (find-min seq)))) (loop for i in seq collect (+ n i)))) (step-to-pitch :steps (integer-to-interval (reset-seq '(0 1 -1 2 1 0 -2 3 -1 2 0 1 2 -1 -3 4 1 0 -2 3 0 1 -1 2 -2 3 1 0 3 -2 -4 5 -1 2 0 1 2 -1 -3 4 0 1 -1 2 1 0 -2 3 2 -1 -3 4 -1 2 0 1 -3 4 2 -1 4 -3 -5 6))) :pitches (multiple-expand-tonality :startpitch 'c0 :octaves 7 :tonality '(major)) :start 'g4)
  2. but YOUR steps are not the same from the web-archive-example -> in the web-example it's from G in C-major, steps are -> 1 -2 -> YOU are starting with steps -> 0 1 -1 2 ... ??? but, i have no idea about this infinity-things, i only MAP your SEQ to MAJOR-scale... in the way you asked for (i think), so perhaps you have to rethink the MAIN-thing? best wishes andré added 6 minutes later you have to think different - these are NOT steps, these is a INTEGER-TO-PITCH thing... perhaps mixed with tonality-map - but haven't time for that at the moment, sorry
  3. dear brian your pitch-range is too small for the step-sum... if you want to use it you have to enlarge your pitch-range. i've now done a small change - so you don' t have an error -> step-stack will now be set to 0, if pitches are lower or higher then your pitch-range, but in this case you don't have exact results mapping the STEPS so, enlarge your pitch-range -> perhaps with my "multiple-expand..."-function -> EXAMPLE 2 (defun step-to-pitch (&key steps pitches start) (let ((pos (car (position-item start pitches)))) (append (list (nth pos pitches)) (loop for i in steps ;; setting pos by add the step to pos do (setf pos (+ pos i)) ;; when pitch-range to small then reset to lowest pitch+step ;; could be a more intelligent solution when (or (>= pos (length pitches)) (< pos 0)) do (setf pos 0);(+ 0 i)) collect (nth pos pitches))))) ;;; EXAMPLE 1 (step-to-pitch :steps '(0 1 -1 2 1 0 -2 3 -1 2 0 1 2 -1 -3 4 1 0 -2 3 0 1 -1 2 -2 3 1 0 3 -2 -4 5 -1 2 0 1 2 -1 -3 4 0 1 -1 2 1 0 -2 3 2 -1 -3 4 -1 2 0 1 -3 4 2 -1 4 -3 -5 6) :pitches '(c3 d3 e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5 g5 a5 b5 c6) :start 'g4) ;;; here a function which enlarges TONALITIES OVER X-ocavtes ;;; so, that's easier then to type :-9 (defun multiple-expand-tonality (&key startpitch octaves tonality) (remove-duplicates ;remove is for "cutting" if there are too much pitches (OMN loops last octave!) (loop repeat octaves with pitch = startpitch with cnt = 0 when (= cnt (length tonality)) do (setq cnt 0) append (expand-tonality (list pitch (nth cnt tonality))) do (incf cnt) do (setq pitch (car (pitch-transpose 12 (list pitch))))))) (multiple-expand-tonality :startpitch 'c1 :octaves 6 :tonality '(major)) ;;; EXAMPLE 2 (step-to-pitch :steps '(0 1 -1 2 1 0 -2 3 -1 2 0 1 2 -1 -3 4 1 0 -2 3 0 1 -1 2 -2 3 1 0 3 -2 -4 5 -1 2 0 1 2 -1 -3 4 0 1 -1 2 1 0 -2 3 2 -1 -3 4 -1 2 0 1 -3 4 2 -1 4 -3 -5 6) :pitches (multiple-expand-tonality :startpitch 'c0 :octaves 7 :tonality '(major)) :start 'g4)
  4. here are some solutions: user- or OPMO-defined greetings andré
  5. evaluate this, and check out the midi-destinations-function -> shows you the ports (midi-destinations)
  6. But in this way: (setf binrow '(0 2 5 7 8 11)) (gen-binary-row 12 '(binrow)) What am I missing ? just do it like that: (setf binrow '(0 2 5 7 8 11)) (gen-binary-row 12 binrow) ;; your "binrow" is now a variable with a LIST as value ;; when you are writing '(binrow) it will be a LIST with the VALUE binrow (and not the values of "binrow")
  7. really great, torsten! thanks a lot!!! greetings andré
  8. 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)))))
  9. 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))
  10. would be also interesting for me/my work! greetings andré
  11. i would only need the "FUNCTION" who starts the midi-play and the function which EVALUATEs (quasi the function behind the short-cuts) thanx
  12. question (from a non-programmer): is there a possibility (a way) to evaluate and/or start-to-play with a delay (of x-seconds) in opusmodus/lisp? would be interesting in the context of using POLYTEMPO NETWORK http://polytempo.zhdk.ch (virtual conductor) and LIVE-evaluation/play of an algorithm (and playing it live by an e-player) on/with a specific (delay-)time. could be something like: "do evaluate algorithm" "do play it in 21.543 seconds" any ideas or solutions? thanx for help andré
  13. two functions i needed for working with POLYTEMPO-NETWORK http://philippekocher.ch/#109 http://polytempo.zhdk.ch greetings andré (defun length-to-decimal (alist &key (sum nil)) (let ((list (loop for i in (omn :length alist) collect (float (* i 4))))) (if (equal sum t) (sum list) list))) ;;; result: q = 1 / h. = 3 ...etc... (length-to-decimal '(h. h. 3q 5e 3h)) => (3.0 3.0 0.33333334 0.1 0.6666667) (length-to-decimal '(h. h. 3q 5e 3h) :sum t) => 7.1 (defun length-to-sec (alist tempo &key (sum nil)) (let ((list (loop for i in (omn :length alist) collect (* (/ 60 tempo) (float (* i 4)))))) (if (equal sum t) (sum list) list))) (length-to-sec '(h. h. 3q 5e 3h) 60) => (3.0 3.0 0.33333334 0.1 0.6666667) (length-to-sec '(h. h. 3q 5e 3h) 51) => (3.5294118 3.5294118 0.3921569 0.11764707 0.7843138) (length-to-sec '(h. h. 3q 5e 3h) 51 :sum t) => 8.3529415
  14. "I changed your keyword arguments to plain arguments, because in my code I retain keyword arguments for named optional arguments, but the arguments of this function are not optional (there is no default value)." sometimes i'm using keyword arguments for "better understandig"/legibility/overview of the function. but i see it's not "state of the art", thanks for the hint! :-)
  15. thanx!! you are totally right... i have documanted it in my OM-library (but not in the code) ...will answer you later... have also a look to: it's more useful for me grettings andré
  16. an output-seq of "a little stupid bot" (works with stochastic broken-symmetrical elements and PM..) - could produce for eternety (never ending)... it works and i am going for holidays now greetings andré
  17. hi wim, thank you for the link... also interesting are "non-trivial machines" (heinz von förster / radical constructivism): http://www.cybsoc.org/heinz.htm greetings andré
  18. that is clear to me ... I tried only to find out what the motivation / idea behind the question of WIM is.
  19. okay, i understand your wish... you would like to have some code which produces/composes a "nearly complete piece" for you - like a bot (for my own use i call this programs BOTS and code it by myself). such bots: a nightmare or a dream for a composer :-) some important books/links TORSTEN already listed. maybe we should not forget DAVID COPE - with his EMMY-things ... https://www.youtube.com/channel/UC2Ma0T4VZtmtB6kMmNw7QIA https://en.wikipedia.org/wiki/David_Cope p.s. i am not convinced of such "style exercises" (using TOOLS to imitate musical styles), it is perhaps just as if you translate with the google-translater: you understand what is meant, but it often sounds quite strange (as also this text :-))... it is usually more interesting in a scientific/technological or "produce efficient", than in an aesthetic/artistic context; but it does not make it in my opinion generally unimportant, but only the goal or the idea behind it is another. (Google Translate) best wishes andré
  20. could you tell me your exact definition/specification of OM-"out-of-the-box"-algorithms?
  21. (defun merge-voices** (seq &key insert bar/beat) (car (last (let ((bar) (beat) (distance)) (progn (setf bar (loop for i in bar/beat collect (car i)) beat (loop for j in bar/beat collect (cadr j))) (loop for ba in bar for be in beat for ins in insert with time-sign = (get-time-signature seq) with ord-time-sign = (get-time-signature seq) do (setf time-sign (if (listp (car time-sign)) (loop for i in time-sign when (> (caddr i) 1) append (loop repeat (caddr i) collect (list (car i) (cadr i))) else collect (list (car i) (cadr i))) (append time-sign)) distance (if (listp (car time-sign)) (+ (sum (loop repeat (- ba 1) for i in time-sign collect (/ (car i) (cadr i)))) (/ (1- (car be)) (cadr be))) (+ (* (1- ba) (/ (car time-sign) (cadr time-sign))) (/ (1- (car be)) (cadr be))))) do (setf ins (append (list (neg! distance)) ins)) do (setf seq (omn-to-time-signature (length-rest-merge (flatten (merge-voices (omn-merge-ties seq) ins))) ord-time-sign)) collect seq do (setf time-sign ord-time-sign))))))) (merge-voices** '((q c4 c4 c4 c4) (q c4 c4 c4 c4) (q c4 c4 c4 c4)) :insert '((q a4 a4 a4)) :bar/beat '((2 (2 8)))) (merge-voices** '((q c4 c4 c4 c4) (q c4 c4 c4 c4) (q c4 c4 c4 c4) (q c4 c4 c4 c4)) :insert '((q b5 b5 b5) (e a4 a4 a4)) :bar/beat '((2 (2 8)) (3 (2 16))))
  22. i know POSITION-ATTRIBUTE, but the output-format seems to be a bit different. one of the "problems" for coding the function is to distinguish the "pattern-match" (=> multiple-values of pitches/lengths/... comibinations of these parameters) that's seems not very simple, single-values are okay... ...but at the moment i have other things to do (composing/playing), so it will take some time, but perhaps anyone else would create such a function (stéphane, thorsten..?)
  23. dear janusz what do you think about the idea(s) to work with "bar/beat" for post-processing the scores. i see that's - in my momentary work - very useful... for example: insert at bar/beat, cut-out bar/beat/span, overwrite bar/beat, pattern-matching bar/beat/span ... ? by the way i'm coding a little bit on a function which gets me the positions of perhaps a pattern-match (single values and patterns), in the format (bar (beat)), for example (1 (3 4)), but it's not so simple... (a lot of specialities, and i can't put it into ONE code) ... greetings andré
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy