Ismir2012SoftwareSessionPlan » History » Version 5
Luis Figueira, 2012-10-03 01:27 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 | 5 | Luis Figueira | * Create estimate_tempo.py (main programme) |
28 | 4 | Luis Figueira | <pre> |
29 | 4 | Luis Figueira | import tempo_estimator as est |
30 | 4 | Luis Figueira | import sys |
31 | 4 | Luis Figueira | |
32 | 4 | Luis Figueira | filename = sys.argv[1] |
33 | 4 | Luis Figueira | |
34 | 4 | Luis Figueira | tempo = est.estimate_tempo_of_file(filename) |
35 | 4 | Luis Figueira | </pre> |
36 | 4 | Luis Figueira | * Easy Mercurial: |
37 | 4 | Luis Figueira | ** ignore pyc and py~ |
38 | 4 | Luis Figueira | ** commit estimate_tempo.py |
39 | 4 | Luis Figueira | ** commit .hgignore |
40 | 4 | Luis Figueira | * Create estimate_tempo.py |
41 | 1 | Luis Figueira | * Create test file test_estimate_tempo.py |
42 | 4 | Luis Figueira | <pre> |
43 | 5 | Luis Figueira | import estimate_tempo as est |
44 | 4 | Luis Figueira | |
45 | 4 | Luis Figueira | def test_tempo_120bpm(): |
46 | 4 | Luis Figueira | tempo = est.estimate_tempo_of_file("test files/120bpm.wav") |
47 | 4 | Luis Figueira | |
48 | 4 | Luis Figueira | # we consider the test to be passed if error is less than 1/4 of bpm |
49 | 4 | Luis Figueira | error = abs(tempo - 120) < 0.25 |
50 | 1 | Luis Figueira | assert |
51 | 1 | Luis Figueira | |
52 | 4 | Luis Figueira | </pre> |
53 | 5 | Luis Figueira | * Commit both files |
54 | 5 | Luis Figueira | * Start writing the code of tempo_estimator.py |