Skip to content

Instantly share code, notes, and snippets.

;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))
@JonTanS
JonTanS / gist:7574314
Created November 21, 2013 01:12
Presentation Ready
;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))
@JonTanS
JonTanS / gist:7605136
Last active December 29, 2015 03:08
Milestone 3 60% Domo
;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))
@JonTanS
JonTanS / Prac1.rkt
Created November 25, 2013 18:35
Practice 1
;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))
@JonTanS
JonTanS / practice2.rkt
Created November 25, 2013 18:55
Practice 2
;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)
@JonTanS
JonTanS / fixed.rkt
Last active December 29, 2015 14:39
Attempt for pstream
;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))
;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))