This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require rsound) | |
(require rsound/reverb-typed) | |
(play | |
(rs-filter | |
(rs-read (build-path (collection-path "rsound") "examples" "speaking.wav")) | |
reverb)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require rsound) | |
(provide does-recording-work?) | |
;; try to record an incredibly short sound | |
(define (does-recording-work?) | |
(with-handlers ([exn:fail? (lambda (exn) false)]) | |
(record-sound 10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; a note is (make-note note-num frames frames) | |
(define-struct note (pitch time duration)) | |
;; number -> number | |
;; converts seconds to frames | |
(define (s f) | |
(* 44100 f)) | |
(check-expect (s 10) 441000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Nancy Truong, Mitchell Salles, Dan Stone | |
;; CPE 123 (3:00 P - 5:00 P) | |
(define (s sec) (* 44100 sec)) | |
;; a note is (make-note midi-num frames frames) | |
(define-struct note (pitch time dur)) | |
;; note -> boolean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require rsound) | |
;a note is | |
;(make-note number number number) | |
(define-struct note (pitch time duration)) | |
;a list-of-notes is one of: | |
;-empty, or | |
;-(cons note list-nof-notes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require rsound) | |
(require rsound/filter | |
rsound/reverb-typed) | |
(require plot) | |
;(play ding) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; play a bunch of long tones; each one is 4 seconds long, fades in and out | |
;; slowly, and consists of two waveforms from Adventure Kid's samples, | |
;; differing in pitch by a small random amount. The notes are chosen from | |
;; a scale built on a specified set of intervals. The code is written in | |
;; a somewhat HTDP-friendly way. | |
(require rsound) | |
(require rsound/envelope) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require 2htdp/universe | |
2htdp/image | |
rackunit) | |
;; a text-box-content is a string or false | |
;; a text-box is (make-text-box text-box-content pixels pixels) | |
(define-struct text-box (content x y) #:transparent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require rsound) | |
(require rsound/piano-tones) | |
;; a note is (make-note note-num frames frames) | |
(define-struct note (pitch time duration)) | |
(define bach-notes | |
(list | |
(make-note 60 8820 8820) | |
(make-note 62 17640 8820) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(make-note 60 8820 8820) | |
(make-note 62 17640 8820) | |
(make-note 64 26460 8820) | |
(make-note 65 35280 8820) | |
(make-note 62 44100 8820) | |
(make-note 64 52920 8820) | |
(make-note 60 61740 8820) | |
(make-note 67 70560 17640) | |
(make-note 48 79380 8820) | |
(make-note 72 88200 17640) |