scheme-score

Check-in [7325885039]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Allow 0 durations
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:7325885039c4e266a7579901bad1efb19b0b714745579c1588ae7252a0fa9d8b
User & Date: wcm 2019-05-02 21:34:12
Context
2019-05-02
21:46
Make music-append variadic, and allow null sequences. check-in: 127a68575d user: wcm tags: trunk
21:34
Allow 0 durations check-in: 7325885039 user: wcm tags: trunk
21:32
Describe compilation procedures and implement music->events (rough) check-in: 88d316fc44 user: wcm tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to score.scm.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
;; Argument-checking procedure from SRFI-1.
(define (check-arg pred val caller)
  (let lp ((val val))
    (if (pred val) val (lp (error "Bad argument" val pred caller)))))

;; Currently, we restrict durations and pitches to the set of
;; positive rationals.
(define (duration? x) (and (rational? x) (> x 0)))
(define (pitch? x) (and (rational? x) (> x 0)))

;;; Primitives

(define-record-type note
  (make-note duration pitch)
  note?







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
;; Argument-checking procedure from SRFI-1.
(define (check-arg pred val caller)
  (let lp ((val val))
    (if (pred val) val (lp (error "Bad argument" val pred caller)))))

;; Currently, we restrict durations and pitches to the set of
;; positive rationals.
(define (duration? x) (and (rational? x) (>= x 0)))
(define (pitch? x) (and (rational? x) (> x 0)))

;;; Primitives

(define-record-type note
  (make-note duration pitch)
  note?