Ramon Meza Joseph Raffa December 3, 2014
Racket Guitar Tuner is an interactive application made by Joe and Ramon that allows users to play an endless range of reference notes for tuning their instrument, encased with a simple to use GUI.
- 'Object orientation' is used to represent different elements of the GUI allowing different instances of the same thing.
- 'Hash tables' are used in various ways - from as simple as storing a value associated with an note, to making a dynamic "function lookup" table
- 'Lists' and 'con cells' - stored information like mouse coordinates and individual string values and notes.
- 'Nested con cells' within our lists helped us access certain data far more easily while maintaining clean code
External Technology and Libraries
- 'RSound'- Provides the sound engine which Racket Guitar Tuner is based on
- 'Racket/GUI' - Allowed us to provide our aesthetic, like our window and images
Favorite Lines of Code
- Joe's favorite code:
(define/override (on-event event)
(when (equal? (send event get-event-type) 'left-up)
This code basically forces our drawing canvas to keep track of every left mouse click, and also forces code to be run on every left mouse click.
- Ramon's favorite code:
(define (btn-check x y)
(for ([i 24])
(if (and (= (compare x (lower-bound 'x i) (upper-bound 'x i)) 1)
(= (compare y (lower-bound 'y i) (upper-bound 'y i)) 1))
(get-func (list-ref (hash-ref test 'func) i))
This code is pretty cool. It takes in the mouse coordinates and then compares it to a table of ranges for the X coord and Y coord and based on that calls another function that grabs a function from that same table.