beats 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +29 -4
- data/bin/beats +36 -71
- data/lib/beats.rb +57 -0
- data/lib/beatswavefile.rb +93 -0
- data/lib/kit.rb +67 -11
- data/lib/pattern.rb +131 -86
- data/lib/song.rb +145 -114
- data/lib/songoptimizer.rb +154 -0
- data/lib/songparser.rb +40 -28
- data/lib/songsplitter.rb +38 -0
- data/lib/track.rb +33 -31
- data/lib/wavefile.rb +475 -0
- data/test/examples/combined.wav +0 -0
- data/test/examples/split-agogo_high.wav +0 -0
- data/test/examples/split-bass.wav +0 -0
- data/test/examples/split-hh_closed.wav +0 -0
- data/test/examples/split-snare.wav +0 -0
- data/test/examples/split-tom2.wav +0 -0
- data/test/examples/split-tom4.wav +0 -0
- data/test/fixtures/expected_output/example_combined_mono_16.wav +0 -0
- data/test/fixtures/expected_output/example_combined_mono_8.wav +0 -0
- data/test/fixtures/expected_output/example_combined_stereo_16.wav +0 -0
- data/test/fixtures/expected_output/example_combined_stereo_8.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_16-agogo.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_16-bass.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_16-hh_closed.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_16-snare.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_16-tom2_mono_16.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_16-tom4_mono_16.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_8-agogo.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_8-bass.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_8-hh_closed.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_8-snare.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_8-tom2_mono_8.wav +0 -0
- data/test/fixtures/expected_output/example_split_mono_8-tom4_mono_8.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_16-agogo.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_16-bass.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_16-hh_closed.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_16-snare.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_16-tom2_stereo_16.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_16-tom4_stereo_16.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_8-agogo.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_8-bass.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_8-hh_closed.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_8-snare.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_8-tom2_stereo_8.wav +0 -0
- data/test/fixtures/expected_output/example_split_stereo_8-tom4_stereo_8.wav +0 -0
- data/test/fixtures/invalid/bad_repeat_count.txt +8 -0
- data/test/fixtures/invalid/bad_rhythm.txt +9 -0
- data/test/fixtures/invalid/bad_structure.txt +9 -0
- data/test/fixtures/invalid/bad_tempo.txt +8 -0
- data/test/fixtures/invalid/no_header.txt +3 -0
- data/test/fixtures/invalid/no_structure.txt +6 -0
- data/test/fixtures/invalid/pattern_with_no_tracks.txt +12 -0
- data/test/fixtures/invalid/sound_in_kit_not_found.txt +10 -0
- data/test/fixtures/invalid/sound_in_track_not_found.txt +8 -0
- data/test/fixtures/invalid/template.txt +31 -0
- data/test/fixtures/valid/example_mono_16.txt +28 -0
- data/test/fixtures/valid/example_mono_8.txt +28 -0
- data/test/fixtures/valid/example_no_kit.txt +30 -0
- data/test/fixtures/valid/example_stereo_16.txt +28 -0
- data/test/fixtures/valid/example_stereo_8.txt +28 -0
- data/test/fixtures/valid/example_with_empty_track.txt +10 -0
- data/test/fixtures/valid/example_with_kit.txt +34 -0
- data/test/fixtures/valid/no_tempo.txt +8 -0
- data/test/fixtures/valid/pattern_with_overflow.txt +9 -0
- data/test/fixtures/valid/repeats_not_specified.txt +10 -0
- data/test/fixtures/yaml/song_yaml.txt +30 -0
- data/test/includes.rb +11 -4
- data/test/integration.rb +100 -0
- data/test/kit_test.rb +39 -39
- data/test/pattern_test.rb +119 -71
- data/test/song_test.rb +87 -62
- data/test/songoptimizer_test.rb +162 -0
- data/test/songparser_test.rb +36 -165
- data/test/sounds/agogo_high_mono_16.wav +0 -0
- data/test/sounds/agogo_high_mono_8.wav +0 -0
- data/test/sounds/agogo_high_stereo_16.wav +0 -0
- data/test/sounds/agogo_high_stereo_8.wav +0 -0
- data/test/sounds/agogo_low_mono_16.wav +0 -0
- data/test/sounds/agogo_low_mono_8.wav +0 -0
- data/test/sounds/agogo_low_stereo_16.wav +0 -0
- data/test/sounds/agogo_low_stereo_8.wav +0 -0
- data/test/sounds/bass2_mono_16.wav +0 -0
- data/test/sounds/bass2_mono_8.wav +0 -0
- data/test/sounds/bass2_stereo_16.wav +0 -0
- data/test/sounds/bass2_stereo_8.wav +0 -0
- data/test/sounds/bass_mono_8.wav +0 -0
- data/test/sounds/bass_stereo_16.wav +0 -0
- data/test/sounds/bass_stereo_8.wav +0 -0
- data/test/sounds/clave_high_mono_16.wav +0 -0
- data/test/sounds/clave_high_mono_8.wav +0 -0
- data/test/sounds/clave_high_stereo_16.wav +0 -0
- data/test/sounds/clave_high_stereo_8.wav +0 -0
- data/test/sounds/clave_low_mono_16.wav +0 -0
- data/test/sounds/clave_low_mono_8.wav +0 -0
- data/test/sounds/clave_low_stereo_16.wav +0 -0
- data/test/sounds/clave_low_stereo_8.wav +0 -0
- data/test/sounds/conga_high_mono_16.wav +0 -0
- data/test/sounds/conga_high_mono_8.wav +0 -0
- data/test/sounds/conga_high_stereo_16.wav +0 -0
- data/test/sounds/conga_high_stereo_8.wav +0 -0
- data/test/sounds/conga_low_mono_16.wav +0 -0
- data/test/sounds/conga_low_mono_8.wav +0 -0
- data/test/sounds/conga_low_stereo_16.wav +0 -0
- data/test/sounds/conga_low_stereo_8.wav +0 -0
- data/test/sounds/cowbell_high_mono_16.wav +0 -0
- data/test/sounds/cowbell_high_mono_8.wav +0 -0
- data/test/sounds/cowbell_high_stereo_16.wav +0 -0
- data/test/sounds/cowbell_high_stereo_8.wav +0 -0
- data/test/sounds/cowbell_low_mono_16.wav +0 -0
- data/test/sounds/cowbell_low_mono_8.wav +0 -0
- data/test/sounds/cowbell_low_stereo_16.wav +0 -0
- data/test/sounds/cowbell_low_stereo_8.wav +0 -0
- data/test/sounds/hh_closed_mono_16.wav +0 -0
- data/test/sounds/hh_closed_mono_8.wav +0 -0
- data/test/sounds/hh_closed_stereo_16.wav +0 -0
- data/test/sounds/hh_closed_stereo_8.wav +0 -0
- data/test/sounds/hh_open_mono_16.wav +0 -0
- data/test/sounds/hh_open_mono_8.wav +0 -0
- data/test/sounds/hh_open_stereo_16.wav +0 -0
- data/test/sounds/hh_open_stereo_8.wav +0 -0
- data/test/sounds/ride_mono_16.wav +0 -0
- data/test/sounds/ride_mono_8.wav +0 -0
- data/test/sounds/ride_stereo_16.wav +0 -0
- data/test/sounds/ride_stereo_8.wav +0 -0
- data/test/sounds/rim_mono_16.wav +0 -0
- data/test/sounds/rim_mono_8.wav +0 -0
- data/test/sounds/rim_stereo_16.wav +0 -0
- data/test/sounds/rim_stereo_8.wav +0 -0
- data/test/sounds/sine-mono-8bit.wav +0 -0
- data/test/sounds/snare2_mono_16.wav +0 -0
- data/test/sounds/snare2_mono_8.wav +0 -0
- data/test/sounds/snare2_stereo_16.wav +0 -0
- data/test/sounds/snare2_stereo_8.wav +0 -0
- data/test/sounds/snare_mono_16.wav +0 -0
- data/test/sounds/snare_mono_8.wav +0 -0
- data/test/sounds/snare_stereo_16.wav +0 -0
- data/test/sounds/snare_stereo_8.wav +0 -0
- data/test/sounds/tom1_mono_16.wav +0 -0
- data/test/sounds/tom1_mono_8.wav +0 -0
- data/test/sounds/tom1_stereo_16.wav +0 -0
- data/test/sounds/tom1_stereo_8.wav +0 -0
- data/test/sounds/tom2_mono_16.wav +0 -0
- data/test/sounds/tom2_mono_8.wav +0 -0
- data/test/sounds/tom2_stereo_16.wav +0 -0
- data/test/sounds/tom2_stereo_8.wav +0 -0
- data/test/sounds/tom3_mono_16.wav +0 -0
- data/test/sounds/tom3_mono_8.wav +0 -0
- data/test/sounds/tom3_stereo_16.wav +0 -0
- data/test/sounds/tom3_stereo_8.wav +0 -0
- data/test/sounds/tom4_mono_16.wav +0 -0
- data/test/sounds/tom4_mono_8.wav +0 -0
- data/test/sounds/tom4_stereo_16.wav +0 -0
- data/test/sounds/tom4_stereo_8.wav +0 -0
- data/test/sounds/tone.wav +0 -0
- data/test/track_test.rb +78 -72
- metadata +277 -15
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# An example song using mono 8-bit sounds
|
2
|
+
|
3
|
+
Song:
|
4
|
+
Tempo: 120
|
5
|
+
Structure:
|
6
|
+
- Verse: x2
|
7
|
+
- Chorus: x4
|
8
|
+
- Verse: x2
|
9
|
+
- Chorus: x4
|
10
|
+
Kit:
|
11
|
+
- bass: ../../sounds/bass_mono_16.wav
|
12
|
+
- snare: ../../sounds/snare_mono_16.wav
|
13
|
+
- hh_closed: ../../sounds/hh_closed_mono_16.wav
|
14
|
+
- agogo: ../../sounds/agogo_high_mono_16.wav
|
15
|
+
- tom_high: ../../sounds/tom4_mono_16.wav
|
16
|
+
- tom_low: ../../sounds/tom2_mono_16.wav
|
17
|
+
|
18
|
+
Verse:
|
19
|
+
- bass: X...X
|
20
|
+
- snare: X.X.X
|
21
|
+
- hh_closed: X.XXX
|
22
|
+
- hh_closed: X....
|
23
|
+
- agogo: ....X
|
24
|
+
|
25
|
+
Chorus:
|
26
|
+
- bass: X...X...XX..X...
|
27
|
+
- snare: ....X.......X...
|
28
|
+
- hh_closed: X......
|
29
|
+
- hh_closed: X.XXX.XXX.XX..X.
|
30
|
+
- tom_high: ...........X....
|
31
|
+
- tom_low: X.............X.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# An example song using mono 16-bit sounds
|
2
|
+
|
3
|
+
Song:
|
4
|
+
Tempo: 120
|
5
|
+
Structure:
|
6
|
+
- Verse: x2
|
7
|
+
- Chorus: x4
|
8
|
+
- Verse: x2
|
9
|
+
- Chorus: x4
|
10
|
+
Kit:
|
11
|
+
- bass: ../../sounds/bass_mono_16.wav
|
12
|
+
- snare: ../../sounds/snare_mono_16.wav
|
13
|
+
- hh_closed: ../../sounds/hh_closed_mono_16.wav
|
14
|
+
- agogo: ../../sounds/agogo_high_mono_16.wav
|
15
|
+
|
16
|
+
Verse:
|
17
|
+
- bass: X...X...X...X...
|
18
|
+
- snare: ..............X.
|
19
|
+
- hh_closed: X.XXX.XXX.X.X.X.
|
20
|
+
- agogo: ..............XX
|
21
|
+
|
22
|
+
# Also including non-Kit sounds to test that they work as well:
|
23
|
+
Chorus:
|
24
|
+
- bass: X...X...XX..X...
|
25
|
+
- snare: ....X.......X...
|
26
|
+
- hh_closed: X.XXX.XXX.XX..X.
|
27
|
+
- ../../sounds/tom4_mono_16.wav: ...........X....
|
28
|
+
- ../../sounds/tom2_mono_16.wav: ..............X.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# An example song using mono 8-bit sounds
|
2
|
+
|
3
|
+
Song:
|
4
|
+
Tempo: 120
|
5
|
+
Structure:
|
6
|
+
- Verse: x2
|
7
|
+
- Chorus: x4
|
8
|
+
- Verse: x2
|
9
|
+
- Chorus: x4
|
10
|
+
Kit:
|
11
|
+
- bass: ../../sounds/bass_mono_8.wav
|
12
|
+
- snare: ../../sounds/snare_mono_8.wav
|
13
|
+
- hh_closed: ../../sounds/hh_closed_mono_8.wav
|
14
|
+
- agogo: ../../sounds/agogo_high_mono_8.wav
|
15
|
+
|
16
|
+
Verse:
|
17
|
+
- bass: X...X...X...X...
|
18
|
+
- snare: ..............X.
|
19
|
+
- hh_closed: X.XXX.XXX.X.X.X.
|
20
|
+
- agogo: ..............XX
|
21
|
+
|
22
|
+
# Also including non-Kit sounds to test that they work as well:
|
23
|
+
Chorus:
|
24
|
+
- bass: X...X...XX..X...
|
25
|
+
- snare: ....X.......X...
|
26
|
+
- hh_closed: X.XXX.XXX.XX..X.
|
27
|
+
- ../../sounds/tom4_mono_8.wav: ...........X....
|
28
|
+
- ../../sounds/tom2_mono_8.wav: ..............X.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# An example song, with no Kit section in the header.
|
2
|
+
|
3
|
+
Song:
|
4
|
+
Tempo: 99
|
5
|
+
Structure:
|
6
|
+
- Verse: x2
|
7
|
+
- Chorus: x2
|
8
|
+
- Verse: x2
|
9
|
+
- Chorus: x4
|
10
|
+
- Bridge: x1
|
11
|
+
- Undefined: x0 # Legal to reference undefined pattern as long as num repeats is 0.
|
12
|
+
- Chorus: x4
|
13
|
+
|
14
|
+
Verse:
|
15
|
+
- test/sounds/bass_mono_8.wav: X...X...X...XX..X...X...XX..X...
|
16
|
+
- test/sounds/snare_mono_8.wav: ..X...X...X...X.X...X...X...X...
|
17
|
+
# Here is a comment
|
18
|
+
- test/sounds/hh_closed_mono_8.wav: X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.
|
19
|
+
- test/sounds/hh_open_mono_8.wav: X...............X..............X
|
20
|
+
# Here is another comment
|
21
|
+
Chorus:
|
22
|
+
- test/sounds/bass_mono_8.wav: X...X...XXXXXXXXX...X...X...X...
|
23
|
+
- test/sounds/snare_mono_8.wav: ...................X...X...X...X
|
24
|
+
- test/sounds/hh_closed_mono_8.wav: X.X.XXX.X.X.XXX.X.X.XXX.X.X.XXX. # It's comment time
|
25
|
+
- test/sounds/hh_open_mono_8.wav: ........X.......X.......X.......
|
26
|
+
- test/sounds/ride_mono_8.wav: ....X...................X.......
|
27
|
+
|
28
|
+
|
29
|
+
Bridge:
|
30
|
+
- test/sounds/hh_closed_mono_8.wav: XX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.X
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# An example song using stereo 16-bit sounds
|
2
|
+
|
3
|
+
Song:
|
4
|
+
Tempo: 120
|
5
|
+
Structure:
|
6
|
+
- Verse: x2
|
7
|
+
- Chorus: x4
|
8
|
+
- Verse: x2
|
9
|
+
- Chorus: x4
|
10
|
+
Kit:
|
11
|
+
- bass: ../../sounds/bass_stereo_16.wav
|
12
|
+
- snare: ../../sounds/snare_stereo_16.wav
|
13
|
+
- hh_closed: ../../sounds/hh_closed_stereo_16.wav
|
14
|
+
- agogo: ../../sounds/agogo_high_stereo_16.wav
|
15
|
+
|
16
|
+
Verse:
|
17
|
+
- bass: X...X...X...X...
|
18
|
+
- snare: ..............X.
|
19
|
+
- hh_closed: X.XXX.XXX.X.X.X.
|
20
|
+
- agogo: ..............XX
|
21
|
+
|
22
|
+
# Also including non-Kit sounds to test that they work as well:
|
23
|
+
Chorus:
|
24
|
+
- bass: X...X...XX..X...
|
25
|
+
- snare: ....X.......X...
|
26
|
+
- hh_closed: X.XXX.XXX.XX..X.
|
27
|
+
- ../../sounds/tom4_stereo_16.wav: ...........X....
|
28
|
+
- ../../sounds/tom2_stereo_16.wav: ..............X.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# An example song using stereo 8-bit sounds
|
2
|
+
|
3
|
+
Song:
|
4
|
+
Tempo: 120
|
5
|
+
Structure:
|
6
|
+
- Verse: x2
|
7
|
+
- Chorus: x4
|
8
|
+
- Verse: x2
|
9
|
+
- Chorus: x4
|
10
|
+
Kit:
|
11
|
+
- bass: ../../sounds/bass_stereo_8.wav
|
12
|
+
- snare: ../../sounds/snare_stereo_8.wav
|
13
|
+
- hh_closed: ../../sounds/hh_closed_stereo_8.wav
|
14
|
+
- agogo: ../../sounds/agogo_high_stereo_8.wav
|
15
|
+
|
16
|
+
Verse:
|
17
|
+
- bass: X...X...X...X...
|
18
|
+
- snare: ..............X.
|
19
|
+
- hh_closed: X.XXX.XXX.X.X.X.
|
20
|
+
- agogo: ..............XX
|
21
|
+
|
22
|
+
# Also including non-Kit sounds to test that they work as well:
|
23
|
+
Chorus:
|
24
|
+
- bass: X...X...XX..X...
|
25
|
+
- snare: ....X.......X...
|
26
|
+
- hh_closed: X.XXX.XXX.XX..X.
|
27
|
+
- ../../sounds/tom4_stereo_8.wav: ...........X....
|
28
|
+
- ../../sounds/tom2_stereo_8.wav: ..............X.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# An example song
|
2
|
+
|
3
|
+
Song:
|
4
|
+
Tempo: 99
|
5
|
+
Kit:
|
6
|
+
- bass: test/sounds/bass_mono_8.wav
|
7
|
+
- snare: test/sounds/snare_mono_8.wav
|
8
|
+
- hhclosed: test/sounds/hh_closed_mono_8.wav
|
9
|
+
- hhopen: test/sounds/hh_open_mono_8.wav
|
10
|
+
Structure:
|
11
|
+
- Verse: x2
|
12
|
+
- Chorus: x2
|
13
|
+
- Verse: x2
|
14
|
+
- Chorus: x4
|
15
|
+
- Bridge: x1
|
16
|
+
- Undefined: x0 # Legal to reference undefined pattern as long as num repeats is 0.
|
17
|
+
- Chorus: x4
|
18
|
+
|
19
|
+
Verse:
|
20
|
+
- bass: X...X...X...XX..X...X...XX..X...
|
21
|
+
- snare: ..X...X...X...X.X...X...X...X...
|
22
|
+
# Here is a comment
|
23
|
+
- hhclosed: X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.
|
24
|
+
- hhopen: X...............X..............X
|
25
|
+
# Here is another comment
|
26
|
+
Chorus:
|
27
|
+
- bass: X...X...XXXXXXXXX...X...X...X...
|
28
|
+
- snare: ...................X...X...X...X
|
29
|
+
- test/sounds/hh_closed_mono_8.wav: X.X.XXX.X.X.XXX.X.X.XXX.X.X.XXX. # It's comment time
|
30
|
+
- hhopen: ........X.......X.......X.......
|
31
|
+
- test/sounds/ride_mono_8.wav: ....X...................X.......
|
32
|
+
|
33
|
+
Bridge:
|
34
|
+
- hhclosed: XX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.X
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Song:
|
2
|
+
Tempo: 99
|
3
|
+
Structure:
|
4
|
+
- Verse: x2
|
5
|
+
- Chorus: x2
|
6
|
+
- Verse: x2
|
7
|
+
- Chorus: x4
|
8
|
+
- Bridge: x1
|
9
|
+
- Chorus: x4
|
10
|
+
Kit:
|
11
|
+
- bass: test/sounds/bass_mono_8.wav
|
12
|
+
- hhclosed: test/sounds/hh_closed_mono_8.wav
|
13
|
+
- hhopen: test/sounds/hh_open_mono_8.wav
|
14
|
+
- snare: test/sounds/snare_mono_8.wav
|
15
|
+
|
16
|
+
Bridge:
|
17
|
+
- hhclosed: XX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.X
|
18
|
+
|
19
|
+
Chorus:
|
20
|
+
- bass: X...X...XXXXXXXXX...X...X...X...
|
21
|
+
- hhopen: ........X.......X.......X.......
|
22
|
+
- snare: ...................X...X...X...X
|
23
|
+
- test/sounds/hh_closed_mono_8.wav: X.X.XXX.X.X.XXX.X.X.XXX.X.X.XXX.
|
24
|
+
- test/sounds/ride_mono_8.wav: ....X...................X.......
|
25
|
+
|
26
|
+
Verse:
|
27
|
+
- bass: X...X...X...XX..X...X...XX..X...
|
28
|
+
- hhclosed: X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.
|
29
|
+
- hhopen: X...............X..............X
|
30
|
+
- snare: ..X...X...X...X.X...X...X...X...
|