Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Tweak music-modify to take an (i)alist, rather than a single key-value binding. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: | 6e9fcf38cb97eab0063c39418507f3003a042d052c37c8a5f63f014aa780c73a |
User & Date: | wcm 2019-04-28 02:28:57 |
Context
2019-04-28
| ||
19:10 | Implement basic event structure (Csound score IR) check-in: d79e7c536d user: wcm tags: trunk | |
02:28 | Tweak music-modify to take an (i)alist, rather than a single key-value binding. check-in: 6e9fcf38cb user: wcm tags: trunk | |
2019-04-27
| ||
20:10 | Implement sequences as (i)lists. This may not be a good choice. check-in: 6106f8b49c user: wcm tags: trunk | |
Changes
Changes to SPEC.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
## Music modifiers Modifiers are music values that wrap a music value with a key, value environment affecting the interpretation of that music. music-modify : symbol * music -> modifier (music-modify key val m) Wrap m in a modifier that associates key with val. modifier-ref : symbol modifier -> * (modifier-ref key m) Returns the value associated with key in the environment of m, or #f. ### Important modifier keys |
| | | > |
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
## Music modifiers Modifiers are music values that wrap a music value with a key, value environment affecting the interpretation of that music. music-modify : list[symbol,*] music -> modifier (music-modify props m) Takes a symbol-to-arbitrary-value ialist props and a music value m and returns a modifier wrapping m with an environment built from props. modifier-ref : symbol modifier -> * (modifier-ref key m) Returns the value associated with key in the environment of m, or #f. ### Important modifier keys |
Changes to score.scm.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
simultaneity?
(part1 simultaneity-part1)
(part2 simultaneity-part2))
;;; Modifiers
(define-record-type modifier
(make-modifier env music)
modifier?
(env modifier-env)
(music modifier-music))
(define (music? x)
(or (prim? x)
(sequence? x)
(modifier? x)
(simultaneity? x)))
|
| > > > > > > > |
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
simultaneity? (part1 simultaneity-part1) (part2 simultaneity-part2)) ;;; Modifiers (define-record-type modifier (music-modify env music) modifier? (env modifier-env) (music modifier-music)) ;; Lookup key in the env of modifier m. ialist implementation. (define (modifier-ref key m) (if (modifier? m) (let ((p (iassv key (modifier-env m)))) (and p (icadr p))) (error "not a modifier" m))) (define (music? x) (or (prim? x) (sequence? x) (modifier? x) (simultaneity? x))) |