User Extensions Source Code
Here you can share your functions source code
209 topics in this forum
-
Hi, I want to distribute every second note (with its length) to one voice (instrument) and every first and third note to another voice (instrument) like in the example. Is there a way to do this automatically? What I want it to spread a voice to different instruments, preserving the position.. Thanks for help! ole edit: I just saw that half of the work could be done with gen-swallow, just need to change every nth length-value into a rest-value (preferably leaving my sublists (bars) untouched)..something like length-to-rest for position instead of size of the length. (setf stimme1 '((h d4 q a4 g4) (q a4 e4 h f4) (h e4 g4) (q f4 e4 d4 cs4) (h d4 q a4 a4))) …
- 2 replies
- 2.6k views
- 1 follower
-
Hi, what I want to do is to use ambitus-pitch-remove in the second voice but preserving the rhythmical places for the remaining pitches (so that the pitches swallowed by ambitus-pitch-remove are replaced by rests of the same lengths). Or asking more generally: Is it possible to manipulate on the level where pitches and length are already glued together (omn?)? code: (setf mel '(c4 d4 e4 gs4 bb5 eb6)) (setf rhy '(1/4 -1/8 1/8 1/8 -1/8 1/4 1/4 -1/8 1/8 1/8 -1/4)) (setf mel2 (gen-eval 20 '(rnd-sample 6 mel))) (setf rhy2 (gen-eval 10 '(rnd-sample 12 rhy))) (setf rhy3 (assemble-seq '(-1/4) rhy2)) (setf eins (make-omn :length rhy2 :pitch mel2))…
-
- 6 replies
- 3.5k views
-
-
Hi, I want to make the following construction: (defun mapping-integers (x y) (interval-to-pitch (integer-to-interval x) :start y)) (mapping-integers '(0 4 5 9 11) 'c5) I get an error-warning having the wrong start parameter, how could this be done? I have a list of integers (0 4 5 9 11) and a list of root notes (c5) and want them to process to get lists like (c5 e5 f5 a5 b5).. ole
-
- 2 replies
- 2.5k views
-
-
Hi, Do the lists for pitches and lengths have to be of the same sublists (do the sublists have to have the same length)? e.g.: (setf pitches '((c4 d4 e4) (f4 g4 a4 b4))) (setf pitches2 '((c4 d4) (e4 f4) (g4 a4) (b4))) (setf rhy '((1/4 1/4 -1/4) (1/4 1/4 -1/4) (1/4 1/4 -1/4) (1/4))) (make-omn :length rhy :pitch pitches) this does not work, with 'pitches2' it works fine.. so I have to be aware that my sublists are 'in sync' and use 'flatten' if my sublists are different..? ole
-
- 9 replies
- 3.9k views
-
-
The subject says it all... Best, Torsten LENGTH-DIVIDE2 Documentation seemingly not updated (neither reference nor examples) after function has been changed for the argument :position. For example, the following example call throws an error (length-divide2 '(1 2 2) '(1/16) '(1/4 1/4 1/4 1/4) :type 'n :position 'e) > Error: There is no POSITION named: e. > Allowed POSITION: 'f (first) 'l (last) 'c (center) and '? (at random). BTW: Unfortunately, that helpful error message is not shown if I try to directly output the above …
-
- 2 replies
- 2.6k views
-
-
Dear developers, Below I report another bug (or at least what I assume is a bug). Thank you! Best, Torsten LENGTH-ADJUST If arg value is below the overall length (duration) of the given phrase, then the result is nevertheless longer than the input, seemingly by the absolute difference. This corner case is not covered by the documentation, but for consistency it would likely be better to shorten the input sequence, if the given length value is shorter than the sequence. Examples: (length-adjust 3/4 '(q c3 e d3 e3 q f3 e g3 a3)) (length-adjust 2/4 '(q c3 e d3 e3 q f3 e g3 a3)) …
-
- 0 replies
- 1.7k views
-
-
Dear developers, Opusmodus has a nice and rather extensive documentation. Nevertheless, I wondered why you use manually written rtf files for that. As you most likely know, Common Lisp already supports facilities to add documentation to symbols (e.g., functions) themselves. Example: try (documentation 'list 'function). With such facilities some automatically generated documentation could be created (at least partly), which would at least avoids certain typos. I ran in only a few typos so far in the documentation, but they exist. Here is an example: In reference, the first argument of TONALITY-SERIES is root, but th…
-
- 0 replies
- 1.9k views
-
-
This question is answered beautifully by Rainer Joswig on 'Stack Overflow' site. Difference between `set`, `setq`, and `setf` in Common Lisp? STACKOVERFLOW.COM What is the difference between "set", "setq", and "setf" in Common Lisp? (set 'mat '(c4 d4 e4)) (setq mat '(c4 d4 e4)) (setf mat '(c4 d4 e4))
-
- 0 replies
- 6.3k views
-
-
To add a SEED to your own function and make it work you need to follow three simple rules: Add keyword SEED into the function arguments. (rnd-seed seed) should be placed at the beginning of the function. Nested functions that use seed need to use a (seed) function and not a seed argument. Example: (defun rnd-number (n low high &key seed) (do-verbose ("rnd-number") (rnd-seed seed) (if (zerop n) nil (cons (round (+ low (rnd-round 0 (- high low) :seed (seed)))) (rnd-number (decf n) low high :seed (seed)))))) Each time we evaluate the expression we get a different res…
-
- 0 replies
- 2.2k views
-