Search the Community
Showing results for tags 'unfold'.
-
Given: user defined function: test-foo-lib in Opusmodus/User Source/Libraries/Def-Unfold-Sets Opusmodus version: Version 3.0.28766 (3.0.28766) (defun test-foo-lib (offset pattern) (setf pattern-flat (flatten pattern)) (format t "test-foo-lib: ~% offset: ~A ~% pattern: ~A ~% pattern-flat ~A ~%" offset pattern pattern-flat) (setf pat-length (omn :length pattern)) ;just for debugging reason (setf result (pitch-transpose offset pattern-flat))) ;Test (setf my-pattern '(s bb4 p a4 h. db4 t gs4 mf fs4 c5 b4 q f5 e5)) (setf testresult-1 (test-foo-lib 12 my-pattern)) ;direct call Listener output: result: just perfect! test-foo-lib: offset: 12 pattern: (s bb4 p a4 h. db4 t gs4 mf fs4 c5 b4 q f5 e5) pattern-flat (s bb4 p a4 h. db4 t gs4 mf fs4 c5 b4 q f5 e5) omn pitch-transpose (s bb5 p a5 h. cs5 t gs5 mf fs5 c6 b5 q f6 e6) ;----------------------------------------------------------------- Problem: However if test-foo-lib is called via (def-unfold-set dw-om-methods :methods ( :group expansion p-exp-patt (:pitch (test-foo-lib 12 x)))) with the following call: (in same library file or called from my projects file) (unfold 'dw-om-methods '(p-exp-patt) my-pattern) Listener output: bad result: 1) pattern becomes a list of list. 2) only pitch information available! Therefore the logical error message: No length information OM 24 > unfold test-foo-lib: offset: 12 pattern: ((bb4 a4 db4 gs4 fs4 c5 b4 f5 e5)) pattern-flat (bb4 a4 db4 gs4 fs4 c5 b4 f5 e5) Error: No length specified before first pitch 1 (abort) Return to top loop level 0. ;----------------------------------------------------------------- What is going on here, what can I do, what is wrong? Thanks for any hints! Daniel
- 8 replies
-
- def-unfold-set
- unfold
-
(and 1 more)
Tagged with:
-
How to use a user defined function, defined in my def-unfold-set "my-mehods" (in-package :Opusmodus), in the counterpoint function? Example (setf test-pattern '(e c4 d4 e4 f4 g4 a4 b4 c5)) (unfold ' my-mehods '(amb-c6b6) test-pattern) ;; works perfectly, shifting up pitches However how do I use this function amb-c6b6 in the counterpoint function? #|1|# ((2 - 6 5) :methods ( amb-c6b6 - (r t-12) t-12)) ;;error, how to unfold amb-c6b6? Thanks for any idea!
- 8 replies
-
- unfold
- counterpoint
-
(and 1 more)
Tagged with:
-
Hi, Why does the first example work and the second don't, what am I missing? Thanks! (setf eins '((q d4 e4 fs4 gs4) (q d4 e4 fs4 gs4) (q d4 e4 fs4 gs4))) (unfold 'om '((pause 2)) eins) => ((q d4 e4 fs4 gs4) (-w) (q d4 e4 fs4 gs4)) (unfold 'om '((pause 2 2)) eins) => ((q d4 e4 fs4 gs4) (q d4 mf e4 fs4 gs4) (q d4 e4 fs4 gs4))
-
This short example demonstrates how powerful and flexible the UNFOLD function is, especially when working with short patterns. The entire process is very compact and requires only a few lines of code. Source: (progn (setf mat1 '((h. eb4 pp q g3 -e q gs4 mf -s a5 p tie) (e. a5 -e q bb4 mf -s q cs5 p -s q. e5 mf -e.) (q cs5 p h. d5 mf -q c5 pp tie) (h c5 pp h. gs3 -e a4 p<) (h. fs5 mp q bb3 c5 p e4 mf tie) (h e4 -e q cs4 mp h d5 p e f4)) mat2 '((q d4 pp s eb4 < leg g4 < leg bb4 < leg a4 q. cs5 mf -e 3q gs5 > leg fs5 > leg c5 > b4 > leg f4 leg e4) (t d4 < leg eb4 < leg g4 < leg bb4 q. a4 marc t fs4 mf leg gs4 leg e. c5 e b4 t f5 leg e5 leg d5 leg eb5 3q bb5 > a4 > bb5 > e a4 pp stacc -e)) p01 (unfold 'eg '(t7 dyn) mat1) p02 (unfold 'eg '(t7 v? dyn ob) mat1) p03 (unfold 'eg '(v? ra dyn) mat1) p04 (unfold 'eg '(t-12 t-5 dyn v? raf hn) p03) p05 (unfold 'eg '(t-12 t-5 ld ra dyn bn) p02) p11 (assemble-seq (unfold 'eg '(t7 dyn) mat1) (unfold 'eg '(t7 dyn) mat2)) p12 (assemble-seq (unfold 'eg '(t-12 v? dyn ob) mat1) (unfold 'eg '(t-12 v? dyn ob) mat2)) p13 (assemble-seq (unfold 'eg '(v? raf dyn) mat1) (unfold 'eg '(v? dyn) mat2)) p14 (unfold 'eg '(t-12 t-5 dyn v? raf dyn hn) p13) p15 (unfold 'eg '(t-12 t-5 ld ra dyn bn) p12)) (ps 'gm :w5 (list (assemble-seq p01 p11) (assemble-seq p02 p12) (assemble-seq p03 p13) (assemble-seq p04 p14) (assemble-seq p05 p15)))) Output: Best, JP