Jump to content

AM

Members
  • Joined

  • Last visited

Everything posted by AM

  1. AM replied to AM's post in a topic in Support & Troubleshooting
    with OSC - (with the external osc-library i've sended you) - it should work similiar? loop-function which PRINT the revcevied osc-values over and over (it works). i would like to do that with MIDI but i'm not a lisp pro.... (code not by me) (defparameter *in-port* 9999) (defparameter *in-socket* (make-socket :type :datagram :local-port *in-port* :format :binary)) (setq *osc-receive* (process-run-function "osc-receive-process" #'(lambda () (loop do (print (osc::decode-message (receive-from *in-socket* 2048)) #.*terminal-io*))))) (process-kill *osc-receive*) ;; Prozess wieder anhalten
  2. AM replied to AM's post in a topic in Support & Troubleshooting
    thanx! but... it's "only a LISP problem" with LOOP and SLEEP my code should read X (the midi-values) every 2 seconds - (sleep 2). i don't know why "LISP don't safe" variable X inside the loop when i'm doing "midi-entry"....
  3. dear all as so often i try out strange things 🙂 i switch on midi-entry, read the pitches which i enter from a keyboard. everything clear so far. I am now trying to do this in a 2-second-loop (with sleep-function), so that variable X would always be assigned new values. at the end of the loop sequence, however, X is NIL. only when I evaluate X again are the values assigned. (see video) (the idea is... to IMPORT live-midi into a "realtime-process") some ideas? thanx andré clip.mov
  4. AM replied to NagyMusic's post in a topic in Function Examples
    (gen-divide '(1 2 3 4 5 6) '(1 2 3 4 5 6 7 8 9 10)) => ((1) (2 3) (4 5 6) (7 8 9 10))
  5. (binary-to-length '(1 0 0 0 1 0 0 1 0 1 0 1 1) :value 1) => (4 3 2 2 1 1) greetings
  6. AM replied to AM's post in a topic in Support & Troubleshooting
    the LOOP-cycles produces data-sequences with lengths about 5 to 20 sec for this... stop and wait via SLEEP is oaky.... inside the loop: i send the datas (the sequences) to screens (generative score + conducting for the musicians / polytempo) and MAXMSP (sound/modsynth) ... this is via OSC for accuracy/coordination so it works fine like that... but: LISP is not exactly suitable for REALTIME processing 😄
  7. AM replied to AM's post in a topic in Support & Troubleshooting
    dear torsten, that works perfect! so i can display what my algo is doing in each loop... thx
  8. AM posted a post in a topic in Support & Troubleshooting
    is there a possibilty to ONLY show INSIDE the LISTENER what i like to: some (print ....)-stuff ...and not all the "function-calls" like ..... ratio-to-msec rnd-pick :seed 990096 rnd1 :seed 858709 compress rnd1 :seed 223329 compress list-to-string ratio-to-msec ratio-to-msec ratio-to-msec prob :seed 115209 prob :seed 40751 stop-score-player score-player .... thanx for a hint andré
  9. (defun interval-distance (alist n) (let ((alist (if (pitchp (car alist)) (pitch-to-midi alist) alist)) (n (if (pitchp n) (pitch-to-midi n) n))) (loop for i in alist collect (- i n)))) (interval-distance '(c4 d4 b2 e7) 'c4) => (0 2 -13 40) (interval-distance '(c4 d4) 'c4) => (0 2) (interval-distance '(43 44) '41) => (2 3) (interval-distance '(56 48 11) 'c4) => (-4 -12 -49)
  10. you're welcome....
  11. is this a solution? ...or some ideas to it... greetings andré ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun gen-resultant (r1 r2 &key (rhy 1/4)) (gen-length (difference (remove-duplicates (sort-asc (flatten (append (cons 0 (gen-accumulate r1)) (cons 0 (gen-accumulate r2))))))) rhy)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; example.... correct? (gen-resultant (primes-to 7) (reverse (primes-to 7))) ;;; another example (gen-resultant '(9) '(3 1 4)) (gen-resultant '(9) '(3 1 4) :rhy 1/16) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; n-version... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; for several layers (defun gen-resultant* (r &key (rhy 1/4)) (gen-length (difference (remove-duplicates (sort-asc (flatten (loop for i in r append (cons 0 (gen-accumulate i))))))) rhy)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; correct? (gen-resultant* '((16) (9) (3 1 4) (7))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; a version with length-input - but test it, correct...? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; for several layers / with direct rhythm-input (defun gen-resultant** (r) (difference (remove-duplicates (sort-asc (flatten (loop for i in r append (cons 0 (gen-accumulate i)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; correct? (gen-resultant** '((2/4 1/4 3/4) (1/16 3/16 2/12 1/12) (3/4 3/20 2/20))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  12. listen to the processes... (make-omn :pitch (integer-to-pitch (pascal-triangle 50 :johnson-modulo (1+ (random 23)))) :length '(t) :span :pitch) an example with parallel processes (chordized).. (setf chordlist (loop for i in (flatten (integer-to-pitch (pascal-triangle 20 :johnson-modulo (1+ (random 23))))) for j in (flatten (integer-to-pitch (pascal-triangle 20 :johnson-modulo (1+ (random 23))))) for k in (flatten (integer-to-pitch (pascal-triangle 20 :johnson-modulo (1+ (random 23))))) append (chordize (list i j k)))) (make-omn :pitch chordlist :length '(t) :span :pitch)
  13. here is a short program (based on JOHNSON's writing... pascal-code found in www and modified) to generate TOM JOHNSON's series of numbers for "pascal's triangle ...". maybe interesting to play with the MODULO like JOHNSON did (mod 7)... try it! greetings andré ;;; SUB (defun pascal-next-row (a &key (johnson-modulo nil)) (loop :for q :in a :and p = 0 :then q :as s = (if (null johnson-modulo) (list (+ p q)) (list (mod (+ p q) johnson-modulo))) :nconc s :into a :finally (rplacd s (list 1)) (return a))) ;;; MAIN (defun pascal-triangle (n &key (johnson-modulo nil)) (loop :for a = (list 1) :then (pascal-next-row a :johnson-modulo johnson-modulo) :repeat n :collect a)) ;;; => pascal-triangle (pascal-triangle 7) => ((1) (1 1) (1 2 1) (1 3 3 1) (1 4 6 4 1) (1 5 10 10 5 1) (1 6 15 20 15 6 1)) ;;; => pascal-triangle with MODULO like tom johnson in PASCAL'S TRIANGLE MODULO SEVEN (pascal-triangle 21 :johnson-modulo 7) => ((1) (1 1) (1 2 1) (1 3 3 1) (1 4 6 4 1) (1 5 3 3 5 1) (1 6 1 6 1 6 1) (1 0 0 0 0 0 0 1) (1 1 0 0 0 0 0 1 1) (1 2 1 0 0 0 0 1 2 1) (1 3 3 1 0 0 0 1 3 3 1) (1 4 6 4 1 0 0 1 4 6 4 1) (1 5 3 3 5 1 0 1 5 3 3 5 1) (1 6 1 6 1 6 1 1 6 1 6 1 6 1) (1 0 0 0 0 0 0 2 0 0 0 0 0 0 1) (1 1 0 0 0 0 0 2 2 0 0 0 0 0 1 1) (1 2 1 0 0 0 0 2 4 2 0 0 0 0 1 2 1) (1 3 3 1 0 0 0 2 6 6 2 0 0 0 1 3 3 1) (1 4 6 4 1 0 0 2 1 5 1 2 0 0 1 4 6 4 1) (1 5 3 3 5 1 0 2 3 6 6 3 2 0 1 5 3 3 5 1) (1 6 1 6 1 6 1 2 5 2 5 2 5 2 1 6 1 6 1 6 1)) ;;; look!! (list-plot (flatten (pascal-triangle 50 :johnson-modulo 7)) :point-radius 0 :style :fill) (list-plot (flatten (pascal-triangle 50 :johnson-modulo 11)) :point-radius 0 :style :fill) (list-plot (flatten (pascal-triangle 80 :johnson-modulo 17)) :point-radius 0 :style :fill) (list-plot (flatten (pascal-triangle 50 :johnson-modulo 3)) :point-radius 0 :style :fill) ;;; rnd-testing (list-plot (flatten (pascal-triangle 80 :johnson-modulo (1+ (random 23)))) :point-radius 0 :style :fill) Bildschirmvideo aufnehmen 2021-04-10 um 23.47.59.mov
  14. lieber torsten, herzlichen dank! beste grüsse andré
  15. yes, but i do not compose with OPMO - it's too strange with rhythm/instrumentation/notation. most of the time i'm sketching with OPMO and compose "by hand". guitar-scordatura: i thought i'd rather "pull the pitches out of MIDI/XML" and then convert them.. i will see... but, THANX! greetings andré could look like that (excerpt of a piece for solo trp - also with some SORT-ALGORITHMS inside (sketched/calculated with OPMO) 🙂 works fine with SIBELIUS for layouting etc...
  16. thanks, dear julio, i'll take a look at it, but depending on the situation, programming takes more time than doing it by hand 🙂
  17. i am currently working on a piece for piano, guitar and drums. the guitar will have a "scordatura" so that i can do different harmonics and resonances than with the usual tunings. so that I can now make a more readable score, I would like to write the guitar part on two systems: one system as it sounds and one readable for the guitarist (because of the scordatura/fingerings)... it would be nice if we could do a FUNCTION which transforms the "sounding pitch part" (readable in score) into the "guitar-specific-part" (how to play for guitarist)...
  18. dear julio i would code it! you could do a "systematic/formalized sketch" (not in LISP) and with that you would try to program a function 🙂 best a.
  19. here it is... but NOT microtonal. just for equal tempered tunings it was too complicated (and not necessary) for me to code it (with attributes and cents, it's a bit ... 🤔), so i coded it just for my needs ... for equal tempered tunings... could use it for guitar/strings, just to have a list of your SCORDATURA-harmonics to work with. would be interesting if someone could CODE a function which transforms a "sounding-pitch-guitar-score" into the "play-score". so i wouldn't have to do it by hand... where are the guitar players here? 🙂 julio? janusz? greetings andré (defun sort-to-pitch-events (events sort) (let* ((int (loop for i in events collect (list (pitch-to-integer (second i)) i))) (out (sortcar sort int))) (loop for i in out collect (second i)))) ;;----------------------------------------------------------------------------------- (defun gen-natural-harmonics (openstrings &key (scale nil) (n 16)) (progn (add-text-attributes '(str1 "str1") '(str2 "str2") '(str3 "str3") '(str4 "str4")'(str5 "str5") '(str6 "str6")) (let* ((cent-list (cents-to-attribute '(0 2 0 -14 2 -31 0 4 -14 -49 -2 41 -31 -12 0))) (harmonic (loop for i from 2 to n collect (compress (list 'num i)))) (harmonic-seq (loop for i in openstrings for j in (list 'str6 'str5 'str4 'str3 'str2 'str1) collect (make-omn :pitch (rest (harmonics i n)) :length '(q) :articulation (loop for i in cent-list for x in harmonic collect (if (equal i '-) (compress (list x '+ j)) (compress (list i '+ x '+ j)))) :span :pitch)))) (if (null scale) harmonic-seq (sort-to-pitch-events (single-events (flatten harmonic-seq)) '<))))) ;;----------------------------------------------------------------------------------- ;;----------------------------------------------------------------------------------- ;; attributes: string number + partial number + CENTS ;; sorted by strings (gen-natural-harmonics '(e1 a1 ds2 g2 a2 b2) :n 7) => ((q e2 num2+str6 b2 2c+num3+str6 e3 num4+str6 gs3 -14c+num5+str6 b3 2c+num6+str6 d4 -31c+num7+str6) (q a2 num2+str5 e3 2c+num3+str5 a3 num4+str5 cs4 -14c+num5+str5 e4 2c+num6+str5 g4 -31c+num7+str5) (q eb3 num2+str4 bb3 2c+num3+str4 eb4 num4+str4 g4 -14c+num5+str4 bb4 2c+num6+str4 cs5 -31c+num7+str4) (q g3 num2+str3 d4 2c+num3+str3 g4 num4+str3 b4 -14c+num5+str3 d5 2c+num6+str3 f5 -31c+num7+str3) (q a3 num2+str2 e4 2c+num3+str2 a4 num4+str2 cs5 -14c+num5+str2 e5 2c+num6+str2 g5 -31c+num7+str2) (q b3 num2+str1 fs4 2c+num3+str1 b4 num4+str1 eb5 -14c+num5+str1 fs5 2c+num6+str1 a5 -31c+num7+str1)) ;; sorted by pitch (gen-natural-harmonics '(e1 f1 a1 d2) :n 7 :scale t) => ((q e2 mf num2+str6) (q f2 mf num2+str5) (q a2 mf num2+str4) (q b2 mf 2c+num3+str6) (q c3 mf 2c+num3+str5) (q d3 mf num2+str3) (q e3 mf num4+str6) (q e3 mf 2c+num3+str4) (q f3 mf num4+str5) (q gs3 mf -14c+num5+str6) (q a3 mf -14c+num5+str5) (q a3 mf num4+str4) (q a3 mf 2c+num3+str3) (q b3 mf 2c+num6+str6) (q c4 mf 2c+num6+str5) (q cs4 mf -14c+num5+str4) (q d4 mf -31c+num7+str6) (q d4 mf num4+str3) (q eb4 mf -31c+num7+str5) (q e4 mf 2c+num6+str4) (q fs4 mf -14c+num5+str3) (q g4 mf -31c+num7+str4) (q a4 mf 2c+num6+str3) (q c5 mf -31c+num7+str3))
  20. thank you, janusz... i will post the FUNCTION...
  21. thanx! (i'm doing a little function to get all the natural harmonics for guitar tunings 😉 equal tempered or microtonal...)
  22. hi all little question: i would like to SORT an (single-event)-list by pitch... and be able to keep the event-data "in the set" (=> the attribute-cents should be bound to pitch!) ((e e4 mf) (e a4 mf) (e d5 mf) (e g5 mf) (e b5 mf) (e d6 mf) (e b4 mf 2c) (e e5 mf 2c) (e a5 mf 2c) (e d6 mf 2c) (e fs6 mf 2c) (e a6 mf 2c) (e e5 mf) (e a5 mf) (e d6 mf) (e g6 mf) (e b6 mf) (e d7 mf) (e gs5 mf -14c) (e cs6 mf -14c) (e fs6 mf -14c) (e b6 mf -14c) (e eb7 mf -14c) (e fs7 mf -14c) (e b5 mf 2c) (e e6 mf 2c) (e a6 mf 2c) (e d7 mf 2c) (e fs7 mf 2c) (e a7 mf 2c) (e d6 mf -31c) (e g6 mf -31c) (e c7 mf -31c) (e f7 mf -31c) (e a7 mf -31c) (e c8 mf -31c) (e e6 mf) (e a6 mf) (e d7 mf) (e g7 mf) (e b7 mf) (e d8 mf)) any solutions? thanx! andré
  23. real LISP knowledge is very helpful for me. i think it's enough if you know (work with) the fundamentals - like... list/append/cons/loop/loop-inside-a-loop/progn/push/pop/collect/defun... ... so that you can code your specific solutions! greetings andré

Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy