December 7, 2014
Our program allows the user to input songs into a database. The user can then play those songs in the database. The program displays a mood image along with a short comment on your mood and also opens the wikipedia page of the artist of the song that is playing.
- Recursion used to re-access the databases and find specific elements"
- Lists used to create all the databases and songs.
- eq? to match lists and elements of the lists.
- filter to filter out the artist, genre, and album to create separate databases
External Technology and Libraries
- We integrated our program with the music library on the laptop. We used the rsound library to stop, play and read the music. We used net/sendurl library to access the internet and open the wikipedia page on the artist. We used the 2htdp/image library to import the mood images.
Favorite Lines of Code
(define (play-music song-name db) (define alb (car db)) (cond ((eq? song-name (song alb)) (read-music alb db)) (play-music song-name (cdr db))))
- This code searches for the song inputted by the user and finds it in the database and calls read-music to play it
(define (read-music rec db) (define this-wav (wav rec)) (define get-song (rs-read this-wav)) (play get-song) (display-mood rec) (look-up-artist rec db))
- This code wraps everything together. It plays the song, displays the mood image, and opens the wikipedia page