Humdrum lab 5: Difference between revisions
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
grep -l "\*\*text" *.krn | wc -l | grep -l "\*\*text" *.krn | wc -l | ||
6282 | 6282 | ||
How many have two or more verses: | |||
grep -l "\*\*text.*\*\*text" *.krn | wc -l | |||
2006 | |||
== Duration == | |||
What is the duration of all songs if played back-to-back and at the specified tempo without repeats? | |||
gettime -T *.krn | tail -n 1 | |||
286:50:23.1354 hours | |||
What are the longest songs: | |||
gettime --simple -T *.krn | sort -k2 -nr | head -n 10 | |||
WF6618.krn: 3120 | |||
WF0181.krn: 3120 | |||
WF0182.krn: 1864 | |||
WF3616.krn: 1420 | |||
WF6336.krn: 1134 | |||
WF5131.krn: 909 | |||
WF6068.krn: 785 | |||
WF5004.krn: 696 | |||
WF3226.krn: 671 | |||
WF1249.krn: 664 | |||
The -k2 option means to sort by the second column of data. -n means to sort numerically rather than alphabetically, and -r means to sort by highest first. | |||
What are the shortest songs: | |||
gettime --simple -T *.krn | sort -k2 -nr | tail -n 10 | |||
WF2814.krn: 16 | |||
WF2806.krn: 16 | |||
WF2795.krn: 16 | |||
WF2785.krn: 16 | |||
WF2856.krn: 14 | |||
WF2852.krn: 12 | |||
WF2799.krn: 12 | |||
WF6338.krn: 8 | |||
WF5609.krn: 8 | |||
The shortest song in VHV: | |||
cat WF5609.krn | pbcopy | |||
[[File:wf-puff.png|center|500px]] |
Revision as of 17:24, 1 May 2018
This lab is about the wikifonia data.
Basic information
How many files
ls *.krn | wc -l 6710
How many have lyrics:
grep -l "\*\*text" *.krn | wc -l 5460
How many have chords:
grep -l "\*\*text" *.krn | wc -l 6282
How many have two or more verses:
grep -l "\*\*text.*\*\*text" *.krn | wc -l 2006
Duration
What is the duration of all songs if played back-to-back and at the specified tempo without repeats?
gettime -T *.krn | tail -n 1 286:50:23.1354 hours
What are the longest songs:
gettime --simple -T *.krn | sort -k2 -nr | head -n 10 WF6618.krn: 3120 WF0181.krn: 3120 WF0182.krn: 1864 WF3616.krn: 1420 WF6336.krn: 1134 WF5131.krn: 909 WF6068.krn: 785 WF5004.krn: 696 WF3226.krn: 671 WF1249.krn: 664
The -k2 option means to sort by the second column of data. -n means to sort numerically rather than alphabetically, and -r means to sort by highest first.
What are the shortest songs:
gettime --simple -T *.krn | sort -k2 -nr | tail -n 10 WF2814.krn: 16 WF2806.krn: 16 WF2795.krn: 16 WF2785.krn: 16 WF2856.krn: 14 WF2852.krn: 12 WF2799.krn: 12 WF6338.krn: 8 WF5609.krn: 8
The shortest song in VHV:
cat WF5609.krn | pbcopy
