Ver a proveniência

Merge branch 'develop'

tags/v0.1.2^0
Ben Kurtovic há 13 anos
ascendente
cometimento
bf050b5d0b
5 ficheiros alterados com 30 adições e 17 eliminações
  1. +10
    -7
      README.md
  2. +7
    -0
      config.cfg
  3. +8
    -0
      mac_osx.command
  4. +0
    -2
      mac_osx.sh
  5. +5
    -8
      musicquizzer.py

+ 10
- 7
README.md Ver ficheiro

@@ -13,23 +13,26 @@ From Terminal (`/Applications/Utiliies/Terminal`), do:
sudo port install python26
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,
[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
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

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
[here](http://pygame.org/ftp/pygame-1.9.2a0.win32-py2.7.msi).

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
`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

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.

# Usage


+ 7
- 0
config.cfg Ver ficheiro

@@ -34,6 +34,7 @@ title: Brandenburg Concerto No. 2
composer: Johann Sebastian Bach
era: Baroque
genre: Concerto grosso
form: Ritornello
url: /music/2_Brandenburg_Concerto_2.mp3

[03.mp3]
@@ -41,6 +42,7 @@ title: Hornpipe from Water Music Suite
composer: George Frideric Handel
era: Baroque
genre: Suite
form: Ternary
url: /music/3_Hornpipe_From_Water_Music_Suite.mp3

[04.mp3]
@@ -48,6 +50,7 @@ title: Spring from The Four Seasons
composer: Antonio Vivaldi
era: Baroque
genre: Concerto
form: Ritornello
url: /music/4_Spring_From_Four_Seasons_Movement_1.mp3

[05.mp3]
@@ -55,6 +58,7 @@ title: Trumpet Concerto in E-flat major
composer: Joseph Haydn
era: Classical
genre: Concerto
form: Sonata-rondo
url: /music/5_Trumpet_Concerto_In_E_Flat_Major_Movement_3.mp3

[06.mp3]
@@ -62,6 +66,7 @@ title: Piano Concerto No. 20
composer: Wolfgang Amadeus Mozart
era: Classical
genre: Concerto
form: Sonata-allegro
url: /music/6_Piano_Concerto_20_In_D_Minor_Movement_1.mp3

[07.mp3]
@@ -69,6 +74,7 @@ title: Symphony No. 40
composer: Wolfgang Amadeus Mozart
era: Classical
genre: Symphony
form: Sonata-allegro
url: /music/7_Symphony_40_In_G_Minor_Movement_1.mp3

[08.mp3]
@@ -76,6 +82,7 @@ title: Symphony No. 5
composer: Ludwig van Beethoven
era: Transitional
genre: Symphony
form: Sonata-allegro
url: /music/8_Symphony_5_In_C_Minor_Fate_Movement_1.mp3

[09.mp3]


+ 8
- 0
mac_osx.command Ver ficheiro

@@ -0,0 +1,8 @@
#! /bin/bash

dir=${0%/*}
if [ -d "$dir" ]; then
cd "$dir"
fi

python2.6 ./musicquizzer.py

+ 0
- 2
mac_osx.sh Ver ficheiro

@@ -1,2 +0,0 @@
#! /bin/bash
python2.6 ./musicquizzer.py

+ 5
- 8
musicquizzer.py Ver ficheiro

@@ -22,7 +22,7 @@ from urllib import urlretrieve
__author__ = "Ben Kurtovic"
__copyright__ = "Copyright (c) 2011 by Ben Kurtovic"
__license__ = "MIT License"
__version__ = "0.1.1"
__version__ = "0.1.2"
__email__ = "ben.kurtovic@verizon.net"

config_filename = "config.cfg"
@@ -211,13 +211,10 @@ class AnswerSheet(object):
before = time.time()
self.play_piece(piece)
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))
cur_excerpt = chr(ord(cur_excerpt) + 1)
time.sleep(break_length)


Carregando…
Cancelar
Guardar