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
;;list number -> list | |
;;the function takes in a list and a number and returns a list of the first n elements. | |
(define (take a-list n) | |
(cond [(= 0 n) empty] | |
[else (cons (first a-list) (take (rest a-list)(- n 1))) ])) | |
(check-expect (take (list "a" "b" "c" "d" "e") 3)(list "a" "b" "c")) | |
(check-expect (take (list "a" "b" "c" "d" "e") 2)(list "a" "b")) |
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
;the world_state will eventually become a structure. when that happens, all instances of world_state will have to be changed with world_state-current_screen or something of the ilk | |
(require 2htdp/image) | |
(require 2htdp/universe) | |
(require rsound) | |
(define ps (make-pstream)) | |
;;main-world is one of 0 (home screen) 1 (recorder) 2 (beat machine) | |
(define-struct World (main-world record-screen pause? Sounds1 Sounds2 Sounds3 Sounds4 Sounds5 Sounds6 Sounds7 Sounds8)) | |
(define-struct Sounds1 (pause-button 1o 1e 1+ 1a 2o 2e 2+ 2a 3o 3e 3+ 3a 4o 4e 4+ 4a)) |
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 2htdp/universe) | |
(require 2htdp/image) | |
(define (s sec) (* sec 44100)) | |
(define (draw-world st) | |
(empty-scene 20 20)) | |
(define (both a b)b) | |
(define RECORD-LENGTH (s 2)) |
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
;the world_state will eventually become a structure. when that happens, all instances of world_state will have to be changed with world_state-current_screen or something of the ilk | |
(require 2htdp/image) | |
(require 2htdp/universe) | |
(require rsound) | |
(define ps (make-pstream)) | |
;;main-world is one of 0 (home screen) 1 (recorder) 2 (beat machine) | |
(define-struct World (main-world record-screen Sounds1 Sounds2 Sounds3 Sounds4 Sounds5 Sounds6 Sounds7 Sounds8)) | |
(define-struct Sounds1 (pause-button 1o 1e 1+ 1a 2o 2e 2+ 2a 3o 3e 3+ 3a 4o 4e 4+ 4a)) |
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) |