The problem here is that the piano notes are not all the same duration. Specifically, your chord (chord 60 64 67) is a bit longer:
(rs-frames (chord 60 64 67)) -> 161634 frames
(rs-frames (piano-tone 72)) -> 144000 frames
There are a lot of ways of solving this, including clipping the two sounds to the same length and using the `assemble` function. but here’s one simple way:
(require rsound)
(require rsound/piano-tones)
(define (chord . notes)
(rs-overlay* (map piano-tone notes)))
(play (rs-append (rs-overlay (chord 60 64 67)
(piano-tone 72))
(rs-overlay (chord 60 65 69)
(piano-tone 72))
(rs-overlay (chord 62 67 71)
(piano-tone 74))
(rs-overlay (chord 64 67 72)
(piano-tone 84))))
(that is, put the append on the outside, and the rs-overlays inside it.)
(Also, yes, I made it a little I-IV-V-I instead of the same chord twice.)
John
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
racket-users...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/CAAmHZodfci0HM0_b%2BPaEuGBojyJsKwOhDKd-%2Bgi3jJHhaHi7Hg%40mail.gmail.com.