Jump to content

Search the Community

Showing results for tags 'function'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome To Opusmodus
    • Announcements
    • Pre Sales Questions
  • Support Forum
    • Support & Troubleshooting
    • OMN Lingo
    • Function Examples
    • Score and Notation
    • Live Coding Instrument
    • Library Setup
    • MIDI Setup
  • Question & Answer
    • Suggestions & Ideas
  • Sharing
    • Made In Opusmodus
    • User Extensions Source Code

Blogs

  • Stephane Boussuge
  • Didier Debril

Categories

  • OMN The Language
  • Tutorial Guide
  • CLM Examples

Categories

  • Getting Started
  • HowTo
  • Live Coding
  • Music Theory and Analysis

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Gender


Location


Interests


About Me

Found 12 results

  1. I try to put a seed as an option in this function with a default value of nil or no seed , how may i add it as optional Thanks Patrick (defun patkaos ( seed lambda long ) (let ((res (cons seed nil)) (xn seed)) (dotimes (n long res) (setf res (cons (setf xn (* lambda xn (- 1 xn))) res))) (reverse res)))
  2. Hello i try to write a function who could directly apply to an omn list of that form : (set melo1 '(s bb5 f c6 mf bb5 f q mf s c6) (s c6 g5 g5 mp q c5 s bb5 f) (h. g5 f e. mp bb4 ff bb5 mf g5 f) ) How may i proceed to access independently pitch , length , velocity or articulation without having to disassemble it . Is there an existing helping function already made on which i could assign a new custom written function . Thanks Patrick
  3. Hello i tried to have a function who could move one atom or a list anyplace in another list , but now i would like to have the options to move this atom or list with or without parenthesis , see option a option b option a2 option b2 . I have no idea how i can implement several result options in a function , could you please explain me how to do that Thank you Patrick her are the functions i'd use as helping functions (defun list-diff (L1 L2) (cond ((null L1) nil) ((null (member (first L1) L2)) (cons (first L1) (list-diff (rest L1) L2))) (t (list-diff (rest L1) L2)) ) ) (defun hasSublistp (lst) (cond ((null lst) nil) ((listp (first lst)) t) (t (hasSublistp (rest lst))))) This is the final one (defun consxp (rang item lis ) (setq oldlist lis) (setq newlist ( nthcdr rang oldlist )) (setq litem (list item)) (cond ( ( and ( listp item ) (hassublistp oldlist )) ; OPTION A (append (list-diff oldlist newlist ) (list item) (nthcdr rang oldlist ))) ; OPTION B (append (list-diff oldlist newlist ) item (nthcdr rang oldlist ))) (( and ( atom item ) (hassublistp oldlist )) ; OPTION A2 (append (list-diff oldlist newlist ) (cons (list item) (nthcdr rang oldlist )))) ; OPTION B2 (append (list-diff oldlist newlist ) (cons item (nthcdr rang oldlist )))) (( listp item ) (append (list-diff oldlist newlist ) item (nthcdr rang oldlist ))) (( atom item ) (append (list-diff oldlist newlist ) (cons item (nthcdr rang oldlist )))))) ; ( consxp 2 '( a d a) '(a (d) c )) option a ) for example
  4. here is a little function, to use or optimize... greetings andré ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; a little lisp-function that's switches by a "hysteresis" from one value to the other ;;;;;;;;;;;;;;;;;;;;;;; ;;;; could be used for any-value ;;;; :start-weight -> tendency at the beginning ;;;; :sensitivity -> change-step of tendency when switch/match ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; subfunctions (defun weighted-random (list) (loop for item in list with rand-num = (random (loop for x in list sum (second x))) for add = (second item) then (+ add (second item)) when (< rand-num add) return (first item))) (defun weighted-t/nil (on-weight) (let ((off-weight (- 1 on-weight))) (weighted-random (list (list 't on-weight) (list 'nil off-weight))))) (weighted-t/nil 0.5) ;;;; mainfunction (defun binary-hysteresis-1.0 (&key number-of-values (values '(0 1)) (start-weight 0.1) (sensitivity 0.02)) (loop repeat number-of-values with weight = start-weight with cnt = 0 when (equal (weighted-t/nil weight) 'nil) collect (first values) else collect (second values) and do (incf cnt) when (= cnt 3) do (setq weight (+ weight sensitivity) cnt 0))) ;;;; example with 0/1 (length-list-plot (binary-hysteresis-1.0 :number-of-values 200 :values '(0 1) :start-weight 0.1 :sensitivity 0.07)) ;;;; example with two pitches (make-omn :pitch (binary-hysteresis-1.0 :number-of-values 200 :values '(c4 c5) :start-weight 0.05 :sensitivity 0.1) :length (gen-repeat 200 '(1/32)))
  5. ;;;;small function -> create symmetrical lists (palindrom) with markov (for generating half-seq) (setf transition '((1 (4 1) (5 1) (-6 2)) (2 (5 2) (4 1)) (3 (4 1)) (4 (5 1) (2 1)) (5 (1 3) (-6 2) (4 1)) (-6 (4 1) (3 2)) (7 (1 1) (-6 1)))) ;;;FUNCTION (defun gen-sym-markov (&key seq-length transition-matrix) (let ((vals 0)) ;falls seq-length = liste, werden positive werte gezählt und neu ;seq-length (= angepasst, formatunabhängig) (if (listp seq-length) (setq seq-length (car (last (loop for i in seq-length with cnt = 0 when (> i 0) collect (incf cnt)))))) ;entscheindung grad/ungrad (if (evenp seq-length) (progn (setq vals (gen-markov-from-transitions transition-matrix :size (/ seq-length 2) :start (rnd-pick (flatten (filter-first 1 transition-matrix))))) (append vals (reverse vals))) (progn (setq vals (gen-markov-from-transitions transition-matrix :size (/ (- seq-length 1) 2) :start (rnd-pick (flatten (filter-first 1 transition-matrix))))) (append vals (list (rnd-pick (flatten (filter-first 1 transition-matrix)))) (reverse vals)))))) ;;;;EXAMPLE (gen-sym-markov :seq-length 8 :transition-matrix transition)
  6. Hi, here's a simple example of my use of BINARY-RHYTHM function inspired by the Janusz's doc examples for generating a full movement of a chamber symphonie. The BINARY-RHYTHM function use FIBONACCI stuff and variant optional keyword: (init-seed 839201883) (setf fib1 (fibonacci 4 64)) (setf fib2 (fibonacci 21 81)) (setf fib3 (fibonacci 14 74)) (setf fib4 (fibonacci 32 92)) (setf fib5 (fibonacci 1 61)) (setf rhstruct (rnd-sample 8 '(4 8 16 32 64))) (setf bval '(h h q q e e s s s e s e q e h q h h)) (setf len1 (binary-rhythm rhstruct fib1 bval :type 2 :variant '?)) (setf len2 (binary-rhythm rhstruct fib2 bval :type 2 :variant '?)) (setf len3 (binary-rhythm rhstruct fib3 bval :type 2 :variant '?)) (setf len4 (binary-rhythm rhstruct fib4 bval :type 2 :rotate 18)) (setf len5 (binary-rhythm rhstruct fib5 bval :type 2 :variant '?)) SB.
  7. length-lsystem ls &key depth map remove preserve omn [Function] Arguments and Values: ls a name of the l-system class. depth an integer. Depth of recursion. map mapping symbols (variables) to pitches. start length symbol (pitch transposition start). remove removes selected symbol from the list. The default is NIL. preserve preserved selected symbol from the list. The default is NIL. omn length symbols or ratios. The default is T (symbols). Length L-SYSTEM Operators: + always length-note - always rest-note * length multiplication by 2 / length divided by 2 < pushes operations on stack > pops operations from stack Description: An L-SYSTEM or LINDENMAYER SYSTEM is a parallel rewriting system and a type of formal grammar. An L-SYSTEM consists of an alphabet of symbols that can be used to make strings, a collection of production rules that expand each symbol into some larger string of symbols, an initial "axiom" string from which to begin construction, and a mechanism for translating the generated strings into geometric structures. L-SYSTEMS were introduced and developed in 1968 by Aristid Lindenmayer, a Hungarian theoretical biologist and botanist at the University of Utrecht. Lindenmayer used L-SYSTEMS to describe the behaviour of plant cells and to model the growth processes of plant development. L-SYSTEMS have also been used to model the morphology of a variety of organisms and can be used to generate self-similar fractals such as iterated function systems. - Wikipedia Example 1: Algae Lindenmayer's original L-SYSTEM for modelling the growth of algae. variables: A B constants: none axiom: A rules: (A → AB), (B → A) which produces: n = 0 : A n = 1 : AB n = 2 : ABA n = 3 : ABAAB n = 4 : ABAABABA n = 5 : ABAABABAABAAB n = 6 : ABAABABAABAABABAABABA n = 7 : ABAABABAABAABABAABABAABAABABAABAAB n=0: A start (axiom/initiator) / \ n=1: A B The initial single A spawned into AB by rule (A → AB), /| \ rule (B → A) couldn't be applied. n=2: A B A Former string AB with all rules applied, /| | |\ A spawned into AB again, former B turned into A. n=3: A B A A B note all A's producing a copy of themselves in the first place, /| | |\ |\ \ then a B, which turns ... n=4: A B A A B A B A ... into an A one generation later, starting to spawn/repeat/recurse then ... How to use the L-SYSTEM to generate a list of lengths. There are two essential steps to create an Opusmodus L-SYSTEM: The first step is class (DEFCLASS) and the second step is method (DEFMETHOD). The L-SYSTEM class form: (defclass name (l-system) ((axiom :initform axiom) (depth :initform number))) The argument in DEFCLASS is always l-system. The L-SYSTEM method form: (defmethod l-productions ((ls name)) (choose-production ls (variabile (--> rules)))) The name in the DEFMETHOD is always l-productions with the first argument always as ls. The second argument is the name of the DEFCLASS. Lets apply some simple rules to the two variables 'a' and 'b'. (defclass algae (l-system) ((axiom :initform '(a)) (depth :initform 4))) (defmethod l-productions ((ls algae)) (choose-production ls (a (--> a b)) (b (--> a)))) To be able to see the output of the applied L-SYSTEM rules, we use the REWRITE-LSYSTEM function: (rewrite-lsystem 'algae) => (a b a a b a b a) (rewrite-lsystem 'algae :depth 7) => (a b a a b a b a a b a a b a b a a b a b a a b a a b a b a a b a a b) To map the variables to length symbols we use :map keyword: (length-lsystem 'algae :depth 7 :map '((a s) (b e))) => (s e s = e s e s = e s = e s e s = e s e s = e s = e s e s = e s = e) Example 2: Pythagoras Tree variables : 0, 1 constants: <, > axiom: 0 rules: (1 → 1 1), (0 → 1 < 0 > 0) The shape is built by recursively feeding the axiom through the production rules. Each character of the input string is checked against the rule list to determine which character or string to replace it with in the output string. In this example, a '1' in the input string becomes '1 1' in the output string, while '<' remains the same. Applying this to the axiom of '0', we get: axiom: 0 1st recursion: 1 < 0 > 0 2nd recursion: 1 1 < 1 < 0 > 0 > 1 < 0 > 0 3rd recursion: 1 1 1 1 < 1 1 < 1 < 0 > 0 > 1 < 0 > 0 > 1 1 < 1 < 0 > 0 > 1 < 0 > 0 . . . (defclass tree (l-system) ((axiom :initform '(0)) (depth :initform 3))) (defmethod l-productions ((ls tree)) (choose-production ls (1 (--> 1 1)) (0 (--> 1 < 0 > 0)))) (rewrite-lsystem 'tree) => (1 1 1 1 < 1 1 < 1 < 0 > 0 > 1 < 0 > 0 > 1 1 < 1 < 0 > 0 > 1 < 0 > 0) The LENGTH-LSYSTEM function transforms the L-SYSTEM grammar into a list of lengths. (length-lsystem 'tree :depth 3 :map '((1 s) (0 e))) => (s = = = = = = e = s e = s = = e = s e =) Examples: (defclass lent1 (l-system) ((axiom :initform '(e)) (depth :initform 4))) (defmethod l-productions ((ls lent1)) (choose-production ls (e (--> s s)) (s (--> s s e q)) (s (--> s s q e -e)) (q (--> e -e -e s s)))) (length-lsystem 'lent1) => (s = e q s = e q s = e - - s = = = e q s = e q s = e - - s = = = e q s = e q s = -e - s = e q s = e q s = e q s = e q s = e - - s = = = e q s = e q s = e - - s = = = e q s = e q s = -e - s = e q s = e q) Advance examples for users with L-System deeper knowledge. ;; Context-sensitive L-systems from ABoP p. 34--35 Example 1 (defclass context-a (l-system) ((axiom :initform '(F 1 F 1 F 1)) (depth :initform 30) (angle-increment :initform 22.5) (ignore-list :initform '(+ - F)))) (defmethod l-productions ((ls context-a)) (choose-production ls (0 (with-lc (0) (with-rc (0) (--> 0)) (with-rc (1) (--> 1 [ + F 1 F 1 ]))) (with-lc (1) (with-rc (0) (--> 0)) (with-rc (1) (--> 1 F 1)))) (1 (with-lc (0) (--> 1)) (with-lc (1) (with-rc (0) (--> 0)) (with-rc (1) (--> 0)))) (+ (--> -)) (- (--> +)))) (rewrite-lsystem 'context-a :depth 10 :map '((f s) (1 e) (0 *)) :preserve '(f 1 + - 0)) The rewrite: => (s e s * s * s * + s e s e s e s e s e - s e s * s e + s e s * s * s e s e s e s e) (length-lsystem 'context-a :depth 10 :map '((f s) (1 e) (0 *)) :preserve '(f 1 + - 0)) The transformation result: => (s e s e = e. e s e s e s e s e -s e s e = = = s e = = s e s e s e) Example 2 (defclass context-b (l-system) ((axiom :initform '(F 1 F 1 F 1)) (depth :initform 30) (angle-increment :initform 22.5) (consider-list :initform '(0 1)))) (defmethod l-productions ((ls context-b)) (choose-production ls (0 (with-lc (0) (with-rc (0) (--> 1)) (with-rc (1) (--> 1 [ - F 1 F 1 ]))) (with-lc (1) (with-rc (0) (--> 0)) (with-rc (1) (--> 1 F 1)))) (1 (with-lc (0) (--> 1)) (with-lc (1) (with-rc (0) (--> 1)) (with-rc (1) (--> 0)))) (+ (--> -)) (- (--> +)))) (rewrite-lsystem 'context-b :depth 10) => (f 1 f 0 f 1 ([ 12) - f 1 f 1 (] 6) f 1 f 0 f 0 ([ 32) + f 0 ([ 29) + f 0 f 1 (] 23) f 1 (] 19) ([ 50) - f 1 f 0 f 1 ([ 47) - f 1 f 1 (] 41) f 1 (] 33) f 1) This output above is not very useful for length transformation. Lets preserve the symbols which are useful to map: (rewrite-lsystem 'context-b :depth 10 :preserve '(f 1 + - 0 [ ])) => (f 1 f 0 f 1 [ - f 1 f 1 ] f 1 f 0 f 0 [ + f 0 [ + f 0 f 1 ] f 1 ] [ - f 1 f 0 f 1 [ - f 1 f 1 ] f 1 ] f 1) Now we map the symbol to to length symbols and to our operators: (length-lsystem 'context-b :depth 10 :map '((f s) (1 e) (0 *) ([ <) (] >)) :preserve '(f 1 + - 0 [ ])) => (s e s e = -s e s e s e s e e. = e = = = - = s e = -s e s e s e = =)
  8. time-point-system pitch length &key type start mod pcs variant (denominator 4) time-signature seed [Function] Arguments and Values: pitch a pitch list or lists of pitches. length a length or list of lengths (length symbol or ratio). type integers: 1 or 2. (Type of time point system). The default is 1. start integers: from 0 to 11 or ’? (at random). The default is the first integer in the pitch list. mod an integer, the default is 12. variant 'o (origin), 'r (retrograde), 'i (invert), 'ri (retrograde-invert), or '? (at random). pcs pitch class set: 'n (normal order), 'r (retrograde), 'i (inversion). The default is NIL. denominator an integer. The default is 4 (list round up to given time signature measure). time-signature time-signature measures. The default is '(3 4). seed NIL or an integer (random seed). The default is NIL. Description: The Time Point System was first developed by Milton Babbitt and is based on two principles: 1. The relationships in a pitch system are transferred in totality to the sphere of time relations. 2. This transfer is accomplished through the linkage of one simple equivalence - that of time intervals corresponding to pitch intervals. There are two types of the time point system. The type 1 is based on Milton Babbitt system The type 2 is based purely on modus 12: 0=1, 1=2, 2=3, … 11=12 Type 1: (setf pitch1 '(f4 a4 gb4 ab4 e5 g4 db5 bb4 d4 c5 eb5 b4)) (setf pitch2 '((b4 d5 fs5) (d4 f4 a4))) (time-point-system pitch1 's) => ((-q -s e. f4 tie s f4 e. a4 tie) (q a4 tie e a4 fs4 q gs4 tie) (q gs4 e. e5 q g4 tie s g4 tie) (s g4 h cs5 tie s cs5 e bb4 tie) (e bb4 h d4 tie e d4) (e. c5 s eb5 tie q eb5 tie e. eb5 s b4)) (time-point-system pitch1 's :start 0) => ((q f4 h a4 tie) (s a4 e fs4 s gs4 tie q gs4 tie e. gs4 s e5 tie) (e e5 q. g4 q cs5 tie) (q cs5 tie s cs5 e. bb4 tie s bb4 e. d4 tie) (q d4 tie e. d4 s c5 tie e c5 eb5 tie) (q eb5 tie e eb5 q. b4)) (time-point-system pitch1 's :start '? :seed 34) => ((-e. s f4 tie e. f4 q a4 tie s a4 tie) (q a4 e fs4 q. gs4 tie) (e gs4 e5 tie s e5 e. g4 tie g4 s cs5 tie) (h cs5 q bb4) (h d4 tie e d4 c5 tie) (s c5 e. eb5 tie q eb5 tie s eb5 e. b4)) (time-point-system pitch1 's :mod 6) => ((-q -s q.. f4 tie) (e. f4 h a4 tie s a4) (e fs4 gs4 h e5 tie) (s e5 g4 e cs5 tie s cs5 q.. bb4 tie) (e. bb4 h d4 tie s d4 tie) (s d4 e. c5 e eb5 q. b4 tie) (s b4)) (time-point-system pitch1 's :mod 6 :start 0) => ((h f4 tie e f4 a4 tie) (q a4 tie e. a4 s fs4 tie fs4 e gs4 s e5 tie) (h e5 s g4 e. cs5) (h bb4 tie e bb4 d4 tie) (h d4 e. c5 s eb5 tie) (s eb5 h b4 tie e. b4 tie) (s b4)) (time-point-system pitch1 's :mod 6 :start 2) => ((-e h f4 tie e f4) (h a4 tie s a4 e fs4 s gs4 tie) (s gs4 h e5 tie s e5 g4 cs5 tie) (e cs5 h bb4 tie e bb4) (h d4 tie e d4 c5 tie) (s c5 e eb5 h b4 tie s b4 tie) (s b4)) (time-point-system pitch2 's) => ((-h -e. s b4 tie) (e b4 d5 tie d5 q. fs5) (-e d4 tie s d4 e. f4 tie s f4 e. a4)) (time-point-system pitch2 's :start 0) => ((e. b4 s d5 tie e. d5 q fs5 tie s fs5) (e. d4 s f4 tie e. f4 q a4 tie s a4)) (time-point-system pitch2 's :start '? :seed 34) => ((e. b4 s d5 tie e. d5 q fs5 tie s fs5) (-h -e d4 tie) (s d4 e. f4 tie s f4 q.. a4)) (time-point-system pitch2 's :mod 6) => ((-q -s q.. b4 tie) (e b4 h d5 tie e d5) (h. fs5) (-e d4 tie s d4 q.. f4 tie) (e. f4 h a4 tie s a4)) (time-point-system pitch2 's :mod 6 :start 0) => ((h b4 tie s b4 e. d5 tie) (q d5 tie e. d5 q fs5 tie s fs5) (e. d4 h f4 tie s f4 tie) (s f4 h a4 tie e. a4)) (time-point-system pitch2 's :mod 6 :start '(0 2)) => ((h b4 tie s b4 e. d5 tie) (q d5 tie e. d5 q fs5 tie s fs5) (-e d4 tie s d4 q.. f4 tie) (e. f4 h a4 tie s a4)) Type 2: (time-point-system pitch1 's :type 2) => ((q f4 tie e f4 q. a4 tie) (q a4 fs4 tie e. fs4 s gs4 tie) (h gs4 q e5 tie) (s e5 e. g4 tie q g4 tie s g4 e cs5 s bb4 tie) (q bb4 tie bb4 tie e bb4 d4 tie) (s d4 c5 e eb5 tie eb5 q. b4 tie) (q b4 tie e b4)) (time-point-system pitch1 's :type 2 :start 0) => ((s f4 q a4 tie s a4 e fs4 q gs4) (h. e5) (e. g4 h cs5 tie s cs5) (q bb4 tie e bb4 q. d4 tie) (q d4 h c5) (h eb5 tie e. eb5 s b4 tie) (q b4 tie e b4)) (time-point-system pitch1 's :type 2 :start '? :seed 34) => ((q f4 h a4) (q fs4 tie s fs4 q.. gs4) (e. e5 s g4 tie q g4 tie s g4 e. cs5 tie) (q cs5 tie cs5 tie s cs5 e. bb4 tie) (q bb4 tie e bb4 s d4 q c5 tie s c5 tie) (q c5 tie e c5 eb5 q b4 tie) (q b4 tie e b4)) (time-point-system pitch1 's :type 2 :mod 6) => ((q f4 tie e f4 a4 tie a4 s fs4 gs4 tie) (e gs4 q e5 tie s e5 g4 tie g4 e cs5 s bb4 tie) (q bb4 e. d4 s c5 q eb5) (q b4 tie e b4)) (time-point-system pitch1 's :type 2 :mod 6 :start 0) => ((s f4 h a4 tie e. a4) (h fs4 q gs4 tie) (q gs4 tie e gs4 q. e5 tie) (q e5 tie e e5 q. g4 tie) (e. g4 h cs5 tie s cs5) (h. bb4) (h d4 tie e d4 c5 tie) (q c5 tie e c5 q. eb5 tie) (q eb5 tie s eb5 b4)) (time-point-system pitch1 's :type 2 :mod 6 :start 2) => ((e. f4 s a4 h fs4 tie) (e fs4 h gs4 tie e gs4 tie) (e gs4 e5 h g4 tie) (e. g4 h cs5 tie s cs5 tie) (e cs5 bb4 h d4 tie) (q d4 h c5 tie) (e c5 s eb5 b4 tie e b4)) (time-point-system pitch2 's :type 2) => ((h. b4) (e. d5 s fs5 tie q fs5 tie e fs5 d4 tie) (s d4 e. f4 tie f4 q a4 tie s a4 tie) (q a4 tie s a4)) (time-point-system pitch2 's :type 2 :start 0) => ((s b4 e. d5 tie s d5 q.. fs5 tie) (s fs5 d4 e f4 tie f4 q. a4 tie) (e a4)) (time-point-system pitch2 's :type 2 :start '? :seed 34) => ((s b4 e. d5 tie s d5 q.. fs5 tie) (s fs5 h d4 tie e. d4) (e f4 q. a4)) (time-point-system pitch2 's :type 2 :mod 6 :start 0) => ((s b4 h d5 tie e d5 s fs5 tie) (q fs5 tie e. fs5 s d4 q f4) (e a4)) (time-point-system pitch2 's :type 2 :mod 6 :start '(0 2)) => ((s b4 h d5 tie e d5 s fs5 tie) (q fs5 tie e. fs5 s d4 tie e d4 f4 tie) (q f4 a4)) Mixing types: (setf pitch3 '((e4 a4 fs4 d4) (f4 b4 c4 bb4) (eb4 ab4 db4 g4))) (time-point-system pitch3 's :type '(2 1 1)) => ((q e4 tie s e4 q.. a4 tie) (e. a4 s fs4 tie q fs4 tie e fs4 d4 tie) (s d4 -e. -s -s q. f4) (s b4 h c4 tie e c4 s bb4 tie) (s bb4 -e. q eb4 tie s eb4 e. gs4 tie) (e gs4 q. cs4 q g4 tie) (s g4)) With :time-signature keyword: (setf pitch4 (row-group-combination 4 '(6 6) '(6 6) '(0 1 2 3 4 5 6 7 8 9 10 11) :type :pitch)) => ((f4 e4 eb4 d4 cs4 c4) (b4 bb4 a4 gs4 g4 fs4)) (time-point-system pitch4 's) => ((-q -s q.. f4 tie) (q f4 h e4 tie) (e. e4 h eb4 tie s eb4 tie) (e eb4 h d4 tie e d4 tie) (s d4 h cs4 tie e. cs4) (h. c4) (-h -e. s b4 tie) (q b4 tie b4 tie e b4 bb4 tie) (q bb4 tie bb4 tie s bb4 e. a4 tie) (h a4 q gs4 tie) (q gs4 tie e. gs4 q g4 tie s g4 tie) (q g4 tie e g4 q. fs4)) (time-point-system pitch4 's :type '(1 2)) => ((-q -s q.. f4 tie) (q f4 h e4 tie) (e. e4 h eb4 tie s eb4 tie) (e eb4 h d4 tie e d4 tie) (s d4 h cs4 tie e. cs4) (h. c4) (h. b4) (h bb4 tie e. bb4 s a4 tie) (q a4 tie a4 tie s a4 e. gs4 tie) (q gs4 tie e gs4 q. g4 tie) (e g4 fs4 tie q fs4 tie s fs4)) With :mod keyword: (setf pitch5 '((eb4 f4 fs4 a4 c4) (bb4 c4 eb4 e4 f4))) (time-point-system pitch5 '(s t) :type '(2 1) :mod '(3 4)) => ((s eb4 e. f4 s fs4 a4 c4 -s q bb4 tie) (s bb4 s. c4 q eb4 tie t eb4 e4 q f4 tie t f4 tie) (s f4)) With :pcs keyword: (time-point-system pitch5 '(s t) :mod '(3 4) :pcs '(i r)) => ((h eb4 tie e eb4 f4) (s fs4 a4 h c4 tie e c4 tie) (e c4 s. bb4 q c4 tie t c4 tie s c4 e. eb4 tie) (e eb4 tie t eb4 q e4 tie s. e4 q f4 tie) (e f4)) Example: With chords: (setf clusters (gen-loop 3 (flatten (gen-cluster '(3 4 2 3) :type 'c :transpose (rnd-sample 4 (gen-integer -12 12)))) :seed 3568)) (time-point-system clusters 's) => ((-h -s e. a4bb4b4 tie) (e. a4bb4b4 h eb3e3f3fs3 tie s eb3e3f3fs3) (s c3cs3 h c3cs3d3 tie e. c3cs3d3 tie) (s c3cs3d3 -s cs4d4eb4 cs4d4eb4e4 e. d3eb3 q f4fs4g4 tie s f4fs4g4 tie) (e f4fs4g4 -e -s q.. eb3e3f3 tie) (e eb3e3f3 c5cs5d5eb5 q d4eb4 fs4g4gs4 tie) (e fs4g4gs4)) L-SYSTEM with TIME POINT SYSTEM: (defclass exp (l-system) ((axiom :initform '(c4 b3 ab3 bb3 a3 ab4)) (depth :initform 3))) (defmethod l-productions ((ls exp)) (choose-production ls (c4 (--> - + b3)) (b3 (--> ab3 + bb3)) (ab3 (--> bb3 a3)) (bb3 (--> a3 gb3 c4)) (a3 (--> gb3 + c4 -)) (ab4 (--> gb3 - + b3)))) (time-point-system (gen-divide 4 (pitch-lsystem 'exp :depth 3)) 's :type '(1 2 1 1 2)) => ((-h -e bb3 tie) (q bb3 tie bb3 tie s bb3 a3 e bb3 tie) (q bb3 tie e. bb3 q g3 tie s g3) (e cs4 h bb3 tie e bb3 tie) (s bb3 e. g3 tie q g3 tie s g3 e cs4 -s) (-q -e q. g3 tie) (s g3 e. d4 tie d4 q gs3 tie s gs3 tie) (e gs3 h eb4 tie s eb4 -s) (-q -e. q gs3 tie s gs3) (q cs4 tie e. cs4 q gs3 tie s gs3 tie) (e gs3 h eb4 tie s eb4 gs3 tie) (h gs3 e cs4 gs3 tie) (q gs3 tie e. gs3 s d4 tie e d4 -e) (-q -e q. gs3) (q d4 tie e d4 gs3 bb3 cs4) (h a3 tie e a3 s c4 eb4 tie) (e. eb4 -h -s) (-s e. bb3 tie s bb3 q.. d4 tie) (q d4 s cs4 q.. d4 tie) (e. d4 -h -s) (-e q. b3 q f4 tie) (e. f4))
  9. hello i try to make this work any idea ? (gen-filter-change (permute '(gs4 e4 d4 c4 c4 a4 fs4)) '(1/16 1/2 1/4 1/4) '(pp ff mf))Thanks, Patrick
  10. I would like to understand why if i express this function that way it works fine (gen-filter-change (vector-to-pitch '(g4 g5) (gen-white-noise 64 :seed 246)) (vector-to-length 's 1 5 (gen-white-noise 32 :seed 456)) (vector-to-velocity 'mp 'ff (gen-white-noise 122 ))) and if i do that (gen-filter-change '(gs4 e4 e4 d4 e4 gs4 d4 c4 fs4 gs4 e4 e4 c4 e4 gs4 d4 gs4 fs4 fs4 d4) '(1/16 1/2 1/4 1/4) '(s e s s e) '(mf mf mp ff mf mf mp mf ff mf mf f f mf mf mp ff mf f mp ff ff f mp ff f f mp mf mp f ff f mf mf mf ff mf mp f ff f mf mp f f mf ff f f mf f mp mf f ff f mp mf mf f ff f mf mp f mf mf mf mf mf mf f mf mf f f ff mf f mf f mp f mf f mp f mf mf f mp mp mf mf mf mf f ff f mf mp mp mf mf mf f mp f f f f f f f mf f mf mp mp f mp))It doesn't work , why can't we enter velocities manually? Thanks
  11. pitch-rotate rotation-number sequence &key chord section ambitus [Function] Arguments and Values: rotation-number a number or list of numbers. sequence list of pitches. chord NIL or T (chord rotation). The default is T. ambitus instrument name or an integer or pitch list (low high). The default is 'piano. section an integer or list of integers. Selected list or lists to process. Description: The function PITCH-ROTATE employs chordal rotation based on a rotation-number value. (pitch-rotate 1 '(c4 d4 e4 f4 g4 a4 b4)) => (d4 e4 f4 g4 a4 b4 c5) (pitch-rotate 2 '(c4 d4 e4 f4 g4 a4 b4)) => (e4 f4 g4 a4 b4 c5 d5) (pitch-rotate 1 '(c4e4g4 d4f4 e4g4)) => (d4f4 e4g4 e4g4c5) (pitch-rotate 2 '(c4e4g4 d4f4 e4g4)) => (e4g4 e4g4c5 f4d5) Without rotation on the chords :chord NIL (pitch-rotate 2 '(c4e4g4 d4f4 e4g4) :chord nil) => (e4g4 c5e5g5 d5f5) Examples: (setf seq '((a4 a4bb4g4d5 bb4 d5c5bb4a4c5 a4) (bb4a4g4c5 g4 bb4a4g4a4 d5 bb4a4g4) (d5c5bb4a4c5 d5 bb4a4g4c5 c5 bb4a4g4g4))) (pitch-rotate '(1 2 -3) seq) => ((a4bb4g4d5 bb4 d5c5bb4a4c5 a4 a5) (bb4a4g4a4 d5 bb4a4g4 a4g4c5bb5 g5) (c4bb4a4g4 c4 g3bb4a4g4 d5c5bb4a4c5 d5)) Without rotation on the chords :chord NIL (pitch-rotate '(1 2 -3) seq :chord nil) => ((a4bb4g4d5 bb4 d5c5bb4a4c5 a4 a5) (bb4a4g4a4 d5 bb4a4g4 bb5a5g5c6 g5) (bb3a3g3c4 c4 bb3a3g3g3 d5c5bb4a4c5 d5)) Selected lists to process. (pitch-rotate '(1 2 -3 3) (append seq seq) :section '(0 2 3 5)) => ((a4bb4g4d5 bb4 d5c5bb4a4c5 a4 a5) (bb4a4g4c5 g4 bb4a4g4a4 d5 bb4a4g4) (c4bb4a4g4 c4 g3bb4a4g4 d5c5bb4a4c5 d5) (d5c5bb4a4c5 a4 a5 bb4g4d5a5 bb5) (bb4a4g4c5 g4 bb4a4g4a4 d5 bb4a4g4) (bb4a4g4c5 c5 bb4a4g4g4 c5bb4a4c5d6 d6)) OMN (pitch-rotate (rnd-sample 6 (gen-integer -6 6)) '((q a4bb4g4d5 e bb4 = q d5c5bb4a4c5 e a4 a5) (q bb4a4g4c5 e g4 q bb4a4g4a4 e d5 q bb4a4g4) (q c4bb4a4g4 e c4 = q g3bb4a4g4 d5c5bb4a4c5 e d5) (q d5c5bb4a4c5 e a4 a5 q bb4g4d5a5 e bb5) (q bb4a4g4c5 e g4 q bb4a4g4a4 e d5 q bb4a4g4) (q bb4a4g4c5 e c5 q bb4a4g4g4 c5bb4a4c5d6 e d6))) => ((q d4a4bb4g4 e bb3 bb3 q c4d5c5bb4a4 e a3 a4) (q a4g4c5bb5 e g5 q a4g4a4bb5 e d6 q a4g4bb5) (q d5c5bb4a4c5 e d5 bb4a4g4c5 q c5 c5 e bb4a4g4g4) (q c4d5c5bb4a4 e a3 a4 q a4bb4g4d5 e bb4) (q c4bb4a4g4 e g3 q a3bb4a4g4 e d4 q g3bb4a4) (q c4 e g3bb4a4g4 q d5c5bb4a4c5 d5 e bb4a4g4c5))
  12. Version 1.0.15605 is out with a new function added: GEN-CHORD2, ready for download. gen-chord2 count chord-size pitches &key ambitus-chord offset transpose rnd-octaves ambitus seed [Function] Arguments and Values: count an integer or list of integers (number of chords). chord-size an integer or list of integers (size of chords). pitches list or lists of pitches. offset an integer or list of integers. ambitus-chord an integer or list of integers. transpose an integer or list of integers. rnd-octaves NIL or T. The default is NIL. ambitus instrument name or an integer or pitch list (low high). The default is 'piano. seed NIL or number. The default is NIL. Description: The function GEN-CHORD2 enables the composer to generate chords from a list of pitches. The count value sets the number of chords to be generated. The size of the chord is determined by the chord-size parameters. Keywords like :transpose, :ambitus-chord, :rnd-octaves, :ambitus and :offset are further parameters used within the function. (setf row (rnd-row :type :pitch :seed 245)) => (c4 cs4 e4 eb4 b4 fs4 gs4 a4 bb4 d4 f4 g4) (gen-chord2 4 '(3 3 3 3) row) => (c4cs4e4 eb4b4fs4 gs4a4bb4 d4f4g4) (gen-chord2 4 '(2 2 3 4) row :offset '(2 2 -1 1)) => (e4eb4 b4fs4 eb4b4fs4 b4fs4gs4a4) (gen-chord2 4 '(2 2 3 4) row :offset '(2 0 -1 0)) => (e4eb4 e4eb4 cs4e4eb4 cs4e4eb4b4) (gen-chord2 4 '(4 3) row) => (b4fs4gs4a4 a4bb4d4 g4c4cs4e4 e4eb4b4) (gen-chord2 '(12 6) '(3 4) '((c4 cs4 d4 ds4 e4 f4) (fs4 g4 gs4 a4 as4 b4))) => ((eb4e4f4 cs4d4eb4e4 e4f4c4 d4eb4e4f4 f4c4cs4 eb4e4f4c4 c4cs4d4 e4f4c4cs4 cs4d4eb4 f4c4cs4d4 d4eb4e4 c4cs4d4eb4) (a4bb4b4 g4gs4a4bb4 bb4b4fs4 gs4a4bb4b4 b4fs4g4 a4bb4b4fs4) Examples: If :offset is NIL (the default) then the chord-size value determines the offset value. (gen-chord2 4 '(4 3) row :offset '(2 3 -2)) => (e4eb4b4fs4 fs4gs4a4 eb4b4fs4gs4 fs4gs4a4) (gen-chord2 4 '(4 3) row :offset '(2 3 -2) :transpose '(0 6 1 13)) => (e4eb4b4fs4 c5d5eb5 e4c5g4a4 g5a5bb5) (gen-chord2 4 '(4 3) row :offset '(2 3 -2) :transpose '(0 6 1 13) :rnd-octaves t) => (e2eb2b1fs2 c2d2eb2 e2c2g2a1 g6a6bb6)
×
×
  • Create New...