Ismir2012SoftwareSessionPlan » History » Version 4

Luis Figueira, 2012-10-03 01:26 PM

1 2 Luis Figueira
h1. Ismir2012: Software Session Plan
2 1 Luis Figueira
3 1 Luis Figueira
4 1 Luis Figueira
h2. Length and plan
5 1 Luis Figueira
6 1 Luis Figueira
* 90 min (75 + 15m interval)
7 1 Luis Figueira
8 1 Luis Figueira
h2. Software Requirements
9 1 Luis Figueira
10 1 Luis Figueira
* Python 
11 1 Luis Figueira
* Numpy
12 1 Luis Figueira
* Matplotlib
13 4 Luis Figueira
* Nose and Nosetests
14 4 Luis Figueira
* ipython (desirable, not mandatory)
15 1 Luis Figueira
16 3 Luis Figueira
h2. Repository
17 3 Luis Figueira
18 3 Luis Figueira
https://code.soundsoftware.ac.uk/hg/python-tutorial-skeleton
19 3 Luis Figueira
20 1 Luis Figueira
h2. Script
21 1 Luis Figueira
22 4 Luis Figueira
* Clone/Check if repository was successfully cloned
23 4 Luis Figueira
* Explore folder and files 
24 4 Luis Figueira
* Launch python shell (ipyhon)
25 4 Luis Figueira
* import audiofile.py and plot samples
26 4 Luis Figueira
* Explain what the test files are and introduction to nose 
27 4 Luis Figueira
* Create a new file estimate_tempo.py (main programme)
28 4 Luis Figueira
* Create main program
29 4 Luis Figueira
<pre>
30 4 Luis Figueira
import tempo_estimator as est
31 4 Luis Figueira
import sys
32 4 Luis Figueira
33 4 Luis Figueira
filename = sys.argv[1]
34 4 Luis Figueira
35 4 Luis Figueira
tempo = est.estimate_tempo_of_file(filename)
36 4 Luis Figueira
</pre> 
37 4 Luis Figueira
* Easy Mercurial: 
38 4 Luis Figueira
** ignore pyc and py~
39 4 Luis Figueira
** commit estimate_tempo.py
40 4 Luis Figueira
** commit .hgignore
41 4 Luis Figueira
* Create estimate_tempo.py
42 4 Luis Figueira
* Create test file test_estimate_tempo.py
43 4 Luis Figueira
<pre>
44 4 Luis Figueira
import tempo_estimator as est
45 4 Luis Figueira
46 4 Luis Figueira
def test_tempo_120bpm():
47 4 Luis Figueira
    tempo = est.estimate_tempo_of_file("test files/120bpm.wav")
48 4 Luis Figueira
49 4 Luis Figueira
    # we consider the test to be passed if error is less than 1/4 of bpm
50 4 Luis Figueira
    error = abs(tempo - 120) < 0.25
51 4 Luis Figueira
    assert 
52 4 Luis Figueira
53 4 Luis Figueira
</pre>