-
Posts
771 -
Joined
-
Last visited
Content Type
Forums
Events
Store
Tutorials
Videos
Posts posted by AM
-
-
- opmo and Stephane Boussuge
-
2
-
oh, thx, did not know, that APPLY works on functions "first to the remaining arguments."!
-
if i understand you correctly....
you could COMPILE the score - and with :next-index t - you can keep all the versions
(compile-score 'myscore :file "My Score" :new-index t)
"If :new-index is including as an argument the composer is able to collect as saved named incremented files compilation after compilation. This can be invaluable if the score has lots of randomised possibilities that need to be explored and compared to find the 'best version'."
-
some "ugly code" ...but it works....
you want to use (merge-voices) with ONE list as input?
(setf test '((w c2) (h c4 d4) (q g5 g5 g5 g5))) (defun your-merge-voices (alist) (merge-voices (first alist) (second alist) (third alist) (fourth alist) (fifth alist))) (your-merge-voices test)
-
I would be very interested in it, since the interface over Midi is far too imprecise for reasonably complex rhythms, maybe an interface via Musicxml would be better?
-
if you adapt the code for LISPWORKS... could work like that
-
only trust your own code
-
"program me a sorting algorithm in common lisp, which shows me all sorting cycles. Input: list of values. Output: all cycles of the sorting process."
interesting! ChatGPT tells me how the code works, but it has a BUG
doesn't work
-
-
different approach...
(pitch-to-interval '(c4d4e4f6)) => intervals between neighbours (get-all-intervals '(c4d4e4f6)) => all intervals INSIDE the chord (between all pitches)
-
just tried in 3min. ouput correct or perhaps some BUGs in thinking?
greetings
andré
(defun get-all-intervals (alist) (let ((alist (sort-asc (flatten (pitch-to-midi (if (chordp alist) (melodize alist) alist)))))) (rest (sort-asc (remove-duplicates (loop repeat (length alist) for cnt = 0 then (incf cnt) append (x-b (filter-last (- (length alist) cnt) alist) (nth cnt alist)))))))) (get-all-intervals '(c4 d4 e4)) => (2 4) (get-all-intervals '(c4d4e4f6)) => (2 4 25 27 29)
-
(loop for i from 100 to 900 by 100 collect i)
-
janusz's work and support, bravo!!
-
here is the solution to send any data by OSC!
a big thanks to janusz who made it for me/us!! now a wide variety of externals can be controlled via OSC, in any format... (not only reaktor)
(defun osc-send (&rest args) (let* ((host #(127 0 0 1)) ;; host (port 7500) ;; port (s (usocket:socket-connect host port :protocol :datagram :element-type '(unsigned-byte 8))) (b (apply' osc:encode-message args))) (format t "sending to ~a on port ~A~%~%" host port) (unwind-protect (usocket:socket-send s b (length b)) (when s (usocket:socket-close s))))) (osc-send "/player" "120" 1 1 1) (osc-send "/beat" "defer" 0 "duration" 1 "pattern" 12)
- Stephane Boussuge, vpolajnar and hujairi
-
2
-
1
-
i know. but the question is/was, how it could work without eval each time. i would like to put my function in my library, so "EVAL again" is not a solution - that's the idea of DEFUN
-
that's the code
(defun filterbank (&key cc value-range (time-range '(1 127)) (port 7) (channel 16)) (let ((values (loop for i in (rnd-sample 100 (gen-integer (first value-range) (second value-range))) for j in (gen-length (gen-integer (first time-range) (second time-range)) 1/128) collect (list i j)))) (live-coding-midi (compile-score (def-score cc-seq (:title "cc-seq" :key-signature 'chromatic :time-signature '(4 4) :tempo 60) (seq :length '(3) :pitch '(c4) :velocity '(ff) :port port :channel channel :controllers (1 values))))))) (filterbank :cc 1 :value-range '(40 99) :port 1)
-
it's not a problem with live-coding - cc-messages are sended perfectly, but...
but, when i try to evaluate a few times, the error comes up - it seems to me to be a problem with "controllers" inside a new function => when i evaluate for the second time it's always:
Error: Controllers must be alternating names/numbers and values.
i have no idea, why this is a problem when doing more the 1 eval...
-
dear all
i want to code a simple function for sending midi-cc in an "all-in-one"-function (to external devices like filterbank or microcosm)
it works more or less.... but there are two bugs i can't fix.
the function:
(defun filterbank (&key cc value-range (time-range '(1 127)) (port 7) (channel 16)) (let ((values (loop for i in (rnd-sample 100 (gen-integer (first value-range) (second value-range))) for j in (gen-length (gen-integer (first time-range) (second time-range)) 1/128) collect (list i j)))) (live-coding-midi (compile-score (def-score cc-seq (:title "cc-seq" :key-signature 'chromatic :time-signature '(4 4) :tempo 60) (seq :length '(3) :pitch '(c4) :velocity '(ff) :port port :channel channel :controllers (1 values))))))) (filterbank :cc 1 :value-range '(40 99) :port 1)
problem 1: when i evaluate the function and run it ONCE - everything okay. when i like to RUN it a second time there is an error, i don't know why. then i have to evaluate the FUNCTION again... why?
problem 2: i would like to "replace" :controllers (1 values) by :controllers (cc values)
-> so that i can choose the cc-number by a variable "cc". but it don't work - any hints?
thanx for some help
andré
-
welcome
-
test/evaluate it again... my output is
=> (-15/16 15/32 1/32 1/32 1/32 61/32 1/32 1/2 1/32 -5/32 -1/32 13/16 -17/32 3/2 9/16 -7/16)
so it's correct
-
-
it's very lispian
yes, it works also by (mapcar...)
-
i checked it quickly: when you replace the 3h - for example - by h
=> then i get NO ERRORS
-
like that?
;; as lisp-code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (setf alist '((s -s s== -s -s== s== -s s -s s -s s -s==) (s== -s s -s s== -s s -s== s== -s s -s s -s==) (s -s== s -s s -s s== -s s -s==))) (loop for i in alist collect (append i (list 'q))) => ((s -s s== -s -s== s== -s s -s s -s s -s== q) (s== -s s -s s== -s s -s== s== -s s -s s -s== q) (s -s== s -s s -s s== -s s -s== q)) ;; as lisp-function ;;;;;;;;;;;;;;;;;;;;;;;;;; (defun append-value (lists value) (loop for i in lists collect (append i (list value)))) (append-value alist 'q) => ((s -s s== -s -s== s== -s s -s s -s s -s== q) (s== -s s -s s== -s s -s== s== -s s -s s -s== q) (s -s== s -s s -s s== -s s -s== q))
Converting MIDI or MusicXML to OMN
in Support & Troubleshooting
Posted
@opmo: are there any plans for that?