@@ -13,23 +13,26 @@ From Terminal (`/Applications/Utiliies/Terminal`), do: | |||||
sudo port install python26 | sudo port install python26 | ||||
sudo port install py26-game | sudo port install py26-game | ||||
If you are having troubles with the latter command, try downloading the direct | |||||
[installer](http://pygame.org/ftp/pygame-1.9.1release-py2.6-macosx10.5.zip). | |||||
Next, | Next, | ||||
[download MusicQuizzer](https://github.com/earwig/music-quizzer/tarball/v0.1.1) | |||||
[download MusicQuizzer](https://github.com/earwig/music-quizzer/tarball/v0.1.2) | |||||
and uncompress it. Move the folder wherever you want (keep its contents | and uncompress it. Move the folder wherever you want (keep its contents | ||||
intact!) and double-click on `mac_osx.sh` to use the quizzer. | |||||
intact!) and double-click on `mac_osx.command` to use the quizzer. | |||||
## Windows | ## Windows | ||||
MusicQuizzer is written in Python, a language that does not come with Windows | MusicQuizzer is written in Python, a language that does not come with Windows | ||||
by default. Download the latest version of Python 2.7.x | |||||
[here](http://python.org/download/) (_not_ Python 3). Use the default settings | |||||
during installation. | |||||
by default. Download the installer for Python 2.7.1 | |||||
[here](http://python.org/ftp/python/2.7.1/python-2.7.1.msi). Use the default | |||||
settings during installation. | |||||
Next, download and install pygame from | Next, download and install pygame from | ||||
[here](http://pygame.org/ftp/pygame-1.9.2a0.win32-py2.7.msi). | [here](http://pygame.org/ftp/pygame-1.9.2a0.win32-py2.7.msi). | ||||
Finally, | Finally, | ||||
[download MusicQuizzer](https://github.com/earwig/music-quizzer/zipball/v0.1.1) | |||||
[download MusicQuizzer](https://github.com/earwig/music-quizzer/zipball/v0.1.2) | |||||
and extract it wherever you want. To use, simply double-click on the | and extract it wherever you want. To use, simply double-click on the | ||||
`musicquizzer` file inside (do not move or delete any of the other files). | `musicquizzer` file inside (do not move or delete any of the other files). | ||||
@@ -42,7 +45,7 @@ pygame and tk with: | |||||
sudo apt-get install python-pygame python-tk | sudo apt-get install python-pygame python-tk | ||||
Then, | Then, | ||||
[download MusicQuizzer](https://github.com/earwig/music-quizzer/tarball/v0.1.1) | |||||
[download MusicQuizzer](https://github.com/earwig/music-quizzer/tarball/v0.1.2) | |||||
and execute the program with `python musicquizzer.py` from your terminal. | and execute the program with `python musicquizzer.py` from your terminal. | ||||
# Usage | # Usage | ||||
@@ -34,6 +34,7 @@ title: Brandenburg Concerto No. 2 | |||||
composer: Johann Sebastian Bach | composer: Johann Sebastian Bach | ||||
era: Baroque | era: Baroque | ||||
genre: Concerto grosso | genre: Concerto grosso | ||||
form: Ritornello | |||||
url: /music/2_Brandenburg_Concerto_2.mp3 | url: /music/2_Brandenburg_Concerto_2.mp3 | ||||
[03.mp3] | [03.mp3] | ||||
@@ -41,6 +42,7 @@ title: Hornpipe from Water Music Suite | |||||
composer: George Frideric Handel | composer: George Frideric Handel | ||||
era: Baroque | era: Baroque | ||||
genre: Suite | genre: Suite | ||||
form: Ternary | |||||
url: /music/3_Hornpipe_From_Water_Music_Suite.mp3 | url: /music/3_Hornpipe_From_Water_Music_Suite.mp3 | ||||
[04.mp3] | [04.mp3] | ||||
@@ -48,6 +50,7 @@ title: Spring from The Four Seasons | |||||
composer: Antonio Vivaldi | composer: Antonio Vivaldi | ||||
era: Baroque | era: Baroque | ||||
genre: Concerto | genre: Concerto | ||||
form: Ritornello | |||||
url: /music/4_Spring_From_Four_Seasons_Movement_1.mp3 | url: /music/4_Spring_From_Four_Seasons_Movement_1.mp3 | ||||
[05.mp3] | [05.mp3] | ||||
@@ -55,6 +58,7 @@ title: Trumpet Concerto in E-flat major | |||||
composer: Joseph Haydn | composer: Joseph Haydn | ||||
era: Classical | era: Classical | ||||
genre: Concerto | genre: Concerto | ||||
form: Sonata-rondo | |||||
url: /music/5_Trumpet_Concerto_In_E_Flat_Major_Movement_3.mp3 | url: /music/5_Trumpet_Concerto_In_E_Flat_Major_Movement_3.mp3 | ||||
[06.mp3] | [06.mp3] | ||||
@@ -62,6 +66,7 @@ title: Piano Concerto No. 20 | |||||
composer: Wolfgang Amadeus Mozart | composer: Wolfgang Amadeus Mozart | ||||
era: Classical | era: Classical | ||||
genre: Concerto | genre: Concerto | ||||
form: Sonata-allegro | |||||
url: /music/6_Piano_Concerto_20_In_D_Minor_Movement_1.mp3 | url: /music/6_Piano_Concerto_20_In_D_Minor_Movement_1.mp3 | ||||
[07.mp3] | [07.mp3] | ||||
@@ -69,6 +74,7 @@ title: Symphony No. 40 | |||||
composer: Wolfgang Amadeus Mozart | composer: Wolfgang Amadeus Mozart | ||||
era: Classical | era: Classical | ||||
genre: Symphony | genre: Symphony | ||||
form: Sonata-allegro | |||||
url: /music/7_Symphony_40_In_G_Minor_Movement_1.mp3 | url: /music/7_Symphony_40_In_G_Minor_Movement_1.mp3 | ||||
[08.mp3] | [08.mp3] | ||||
@@ -76,6 +82,7 @@ title: Symphony No. 5 | |||||
composer: Ludwig van Beethoven | composer: Ludwig van Beethoven | ||||
era: Transitional | era: Transitional | ||||
genre: Symphony | genre: Symphony | ||||
form: Sonata-allegro | |||||
url: /music/8_Symphony_5_In_C_Minor_Fate_Movement_1.mp3 | url: /music/8_Symphony_5_In_C_Minor_Fate_Movement_1.mp3 | ||||
[09.mp3] | [09.mp3] | ||||
@@ -0,0 +1,8 @@ | |||||
#! /bin/bash | |||||
dir=${0%/*} | |||||
if [ -d "$dir" ]; then | |||||
cd "$dir" | |||||
fi | |||||
python2.6 ./musicquizzer.py |
@@ -1,2 +0,0 @@ | |||||
#! /bin/bash | |||||
python2.6 ./musicquizzer.py |
@@ -22,7 +22,7 @@ from urllib import urlretrieve | |||||
__author__ = "Ben Kurtovic" | __author__ = "Ben Kurtovic" | ||||
__copyright__ = "Copyright (c) 2011 by Ben Kurtovic" | __copyright__ = "Copyright (c) 2011 by Ben Kurtovic" | ||||
__license__ = "MIT License" | __license__ = "MIT License" | ||||
__version__ = "0.1.1" | |||||
__version__ = "0.1.2" | |||||
__email__ = "ben.kurtovic@verizon.net" | __email__ = "ben.kurtovic@verizon.net" | ||||
config_filename = "config.cfg" | config_filename = "config.cfg" | ||||
@@ -211,13 +211,10 @@ class AnswerSheet(object): | |||||
before = time.time() | before = time.time() | ||||
self.play_piece(piece) | self.play_piece(piece) | ||||
after = time.time() | after = time.time() | ||||
retries = 1 | |||||
while after - before < 3 or retries >= 100: # if the piece | |||||
before = time.time() # played for less than 3 seconds, | |||||
self.play_piece(piece) # assume something went wrong | |||||
after = time.time() # loading and try to replay it, | |||||
retries += 1 # but don't get stuck in a loop if | |||||
# we legitimately can't play it | |||||
while after - before < 3: # if the piece played for less than | |||||
before = time.time() # 3 seconds, assume something went | |||||
self.play_piece(piece) # wrong loading and try to replay it | |||||
after = time.time() | |||||
self.playing.set("That was Excerpt {0}...".format(cur_excerpt)) | self.playing.set("That was Excerpt {0}...".format(cur_excerpt)) | ||||
cur_excerpt = chr(ord(cur_excerpt) + 1) | cur_excerpt = chr(ord(cur_excerpt) + 1) | ||||
time.sleep(break_length) | time.sleep(break_length) | ||||