This file contains 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
;BEATS | |
(require 2htdp/image) | |
(require 2htdp/universe) | |
(require rsound) | |
(require rsound/reverb-typed) | |
(define SILENCE (silence 1)) | |
(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? next-start-time Sounds1 Sounds2 Sounds3 Sounds4 Sounds5 Sounds6 Sounds7 Sounds8 tempo_pos)) |
This file contains 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? next-start-time 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 counter)) |
This file contains 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 | |
;takes in a list of numbers and returns the mean. | |
(define (damean litt) | |
(/ (halp litt) (lengtha litt))) | |
(define (halp litt) | |
(cond [(empty? litt) 0] | |
[else (+ (first litt) (halp (rest litt)))])) | |
(define (lengtha litt) |
This file contains 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 | |
;given a list and number, returns a list length of the given number. The length of the list will always be greater than the number. | |
(define (numlist litt number) | |
(cond [(= 0 number) empty] | |
[else (cons (first litt) (numlist (rest litt) (- number 1)))])) | |
(check-expect (numlist (list 1 2 3 4 5) 2) (list 1 2)) |
This file contains 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 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 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)) |