CMSC 246 Systems Programming
Fall 2019
Assignment #7: : Function pointers to Music
Due: November 10: 11:59 PM
In this assignment you will be working with an excerpt from the Million Song Dataset, a freely-available collection of audio features and metadata for a million contemporary popular music tracks.
The file that you will be working with (/home/gtowell/Public246/a7/musicsampleCSV.csv) contains many records. (There is also a smaller file /home/gtowell/Public246/a7/musicsampleminiCSV.csv that might be easier to use during development.) Each record in musicsampleCSV.csv contains the following information for a recorded song, in comma-separated fields:
title: song title artist name: name of artist duration: duration of the track in seconds release: album name from which the track was taken start_of_fade_out: start time of the fade out, in seconds, at the end of the song tempo: tempo in BPM according to The Echo Nest terms: terms describing the song genre according to The Echo Nest year: year recordedExample: Never Gonna Give You Up,Rick Astley,211.69587,Big Tunes - Back 2 The 80s,198.536,113.359,dance pop,1987
The data has been "cleaned" so that there are entries of the correct type for each field in each record. There are also no extra commas; the only commas are field separators. However, there may be incorrect data in some fields; sorry. Use appropriate data types for each field. Note that some of the name, artist, or release string values are very long so in your reader function, you will want something like:
#define LONGLINE 4096
FILE* f = ...
char line[LONGLINE];
while (fgets(line, LONGLINE, f))
{ ... }
Sort by: 1: Title
: 2: Artist
: 3: Duration
: 4: Album
: 5: Fade Start
: 6: Tempo
: 7: Terms
: 8: Year
99 -- quit
****2
How many items should do you want to see?
<0 show all:
==0 search for a particular record
****3
2007 ALB:Myth Takes ART:!!! LEN: 144.0
1995 ALB:The Man ART:"Clarence ""Gatemouth"" Brown" LEN: 333.4
1976 ALB:Fill It! - I Love the Fifties ART:"Dave ""Baby"" Cortez" LEN: 125.6
Sort by: 1: Title
: 2: Artist
: 3: Duration
: 4: Album
: 5: Fade Start
: 6: Tempo
: 7: Terms
: 8: Year
99 -- quit
****4
How many items should do you want to see?
<0 show all:
==0 search for a particular record
****3
1996 ALB:"Blues Singer 1929-1931 ""Booger Rooger Saturday Nite" ART:Gene Autry LEN: 163.5
1967 ALB:"Trilha Sonora Do Filme ""Garota De Ipanema" ART:Orquestra LEN: 87.6
1983 ALB:#8 ART:J.J. Cale LEN: 160.6
Sort by: 1: Title
: 2: Artist
: 3: Duration
: 4: Album
: 5: Fade Start
: 6: Tempo
: 7: Terms
: 8: Year
99 -- quit
****2
How many items should do you want to see?
<0 show all:
==0 search for a particular record
****0
Find A record what:
****Devo
1993 ALB:Q: Are We Not Men? A: We Are Devo / Devo Live ART:Devo LEN: 175.3
Sort by: 1: Title
: 2: Artist
: 3: Duration
: 4: Album
: 5: Fade Start
: 6: Tempo
: 7: Terms
: 8: Year
99 -- quit
****99