Skip to content

Instantly share code, notes, and snippets.

View ekajjake's full-sized avatar

Jake Kuli ekajjake

  • San Luis Obispo, CA
View GitHub Profile
@ekajjake
ekajjake / notefilter.rkt
Last active December 28, 2015 10:58
Takes in a list of notes and produces a list of notes containing only those that end in the first 10 seconds
(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)
@ekajjake
ekajjake / 30PercentFinal.rkt
Created November 15, 2013 19:56
30% Progress on Final Project
;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))
@ekajjake
ekajjake / recorder.rkt
Created November 18, 2013 19:29
Recorder for final project
(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))
;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))
@ekajjake
ekajjake / take.rkt
Created November 25, 2013 18:32
Potential Final Problem
;;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"))