bloops 0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,408 @@
1
+ #
2
+ # -=) warp-o-mat (=-
3
+ # tune coded/composed by freQvibez
4
+ # (c) 2009 Alex Brem
5
+ #
6
+ # exclusively for why's BloopSaphone
7
+ #
8
+ # from Farbrausch with ♥
9
+ #
10
+
11
+ module LousyBloopMachine
12
+
13
+ class Tune
14
+
15
+ BPM = 67
16
+
17
+ ###
18
+ ### sequences
19
+ ###
20
+
21
+ SEQUENCES = {
22
+ :bass => %w^
23
+ 01 02 01 02 01 02 01 02
24
+ 01 02 01 02 01 02 01 02
25
+
26
+ 01 02 01 02 01 02 01 02
27
+ 01 02 01 02 01 02 01 02
28
+ ^,
29
+ :base => %w^
30
+ 00 01 01 01 01 01 01 01
31
+ 01 01 01 01 01 01 01 01
32
+
33
+ 01 01 01 01 01 01 01 01
34
+ 01 01 01 01 01 01 01 01
35
+ ^,
36
+ :snare => %w^
37
+ 00 00 00 00 01 01 01 02
38
+ 01 01 01 02 01 01 01 02
39
+
40
+ 01 01 01 02 01 01 01 02
41
+ 01 01 01 02 01 01 01 02
42
+ ^,
43
+ :hihat => %w^
44
+ 00 00 01 01 01 01 01 01
45
+ 01 01 01 01 01 01 01 01
46
+
47
+ 01 01 01 01 01 01 01 01
48
+ 01 01 01 01 01 01 01 01
49
+ ^,
50
+ :rhodes_1 => %w^
51
+ 00 00 00 00
52
+ 01 02 03 04
53
+
54
+ 01 02 03 04
55
+ 01 02 03 04
56
+ ^,
57
+ :rhodes_2 => %w^
58
+ 00 00 00 00
59
+ 01 02 03 04
60
+
61
+ 01 02 03 04
62
+ 01 02 03 04
63
+ ^,
64
+ :rhodes_3 => %w^
65
+ 00 00 00 00
66
+ 01 02 03 04
67
+
68
+ 01 02 03 04
69
+ 01 02 03 04
70
+ ^,
71
+ :rhodes_4 => %w^
72
+ 00 00 00 00
73
+ 01 02 03 04
74
+
75
+ 01 02 03 04
76
+ 01 02 03 04
77
+ ^,
78
+ :silent => %w^
79
+ 00
80
+ 00
81
+
82
+ 01
83
+ 01
84
+ ^,
85
+ :naughty => %w^
86
+ 00
87
+ 00
88
+
89
+ 00
90
+ 01
91
+ ^
92
+ }
93
+
94
+ ###
95
+ ### patterns
96
+ ###
97
+
98
+ PATTERNS = {
99
+
100
+ :bass => {
101
+ 01 => %q^
102
+ 32a1[attack 0.1][sustain 0.05] 32a
103
+ 32a 32a
104
+ 32a 32a2
105
+ 32a1 32a
106
+
107
+ 32a[sustain 0.1] 32a
108
+ 32a 32a
109
+ 32a[sustain 0.15] 32a
110
+ 32a2[sustain 0.1] 32a1
111
+ ^,
112
+ 02 => %q^
113
+ 8 16a[attack 0.2][psweep 0.5][square 0.2] 16a[attack 0.1]
114
+ 8 16a 16
115
+
116
+ 16a 8 16a
117
+ 16 16a 16 16a
118
+
119
+ 8 16a 32a 16a 32a
120
+ 32a 32 16a 32
121
+ ^
122
+ },
123
+
124
+ :base => {
125
+ 00 => %q^
126
+ 1
127
+ ^,
128
+ 01 => %q^
129
+ 8d2 8d 8d 8d
130
+ 8d 8d 8d 8d
131
+ ^
132
+ },
133
+
134
+ :snare => {
135
+ 00 => %q^
136
+ 1
137
+ ^,
138
+ 01 => %q^
139
+ 8 8a 8 8a
140
+ 8 8a 8 8a
141
+ ^,
142
+ 02 => %q^
143
+ 8 8a 8 8a
144
+ 16 16 8a 32 32a[volume 0.05] 16 8a[volume 0.25]
145
+ ^
146
+ },
147
+
148
+ :hihat => {
149
+ 00 => %q^
150
+ 1
151
+ ^,
152
+ 01 => %q^
153
+ 16 16a 16 16a 16 16a 16 16a
154
+ 16 16a 16 16a 16 16a 16 16a
155
+ ^
156
+ },
157
+
158
+ :rhodes_1 => {
159
+ 00 => %q^
160
+ 1 1
161
+ ^,
162
+ 01 => %q^
163
+ 1c4 1e4
164
+ ^,
165
+ 02 => %q^
166
+ 1c4 1e4
167
+ ^,
168
+ 03 => %q^
169
+ 1d4 1c4
170
+ ^,
171
+ 04 => %q^
172
+ 1e4 1eb4
173
+ ^
174
+ },
175
+
176
+ :rhodes_2 => {
177
+ 00 => %q^
178
+ 1 1
179
+ ^,
180
+ 01 => %q^
181
+ 1e4 1g4
182
+ ^,
183
+ 02 => %q^
184
+ 1e4 1g4
185
+ ^,
186
+ 03 => %q^
187
+ 1g4 1d4
188
+ ^,
189
+ 04 => %q^
190
+ 1gb4 1gb4
191
+ ^
192
+ },
193
+
194
+ :rhodes_3 => {
195
+ 00 => %q^
196
+ 1 1
197
+ ^,
198
+ 01 => %q^
199
+ 1g4 1b4
200
+ ^,
201
+ 02 => %q^
202
+ 1g4 1b4
203
+ ^,
204
+ 03 => %q^
205
+ 1a4 1g4
206
+ ^,
207
+ 04 => %q^
208
+ 1g4 1g4
209
+ ^
210
+ },
211
+
212
+ :rhodes_4 => {
213
+ 00 => %q^
214
+ 1 1
215
+ ^,
216
+ 01 => %q^
217
+ 1b4 1d4
218
+ ^,
219
+ 02 => %q^
220
+ 1b4 1d4
221
+ ^,
222
+ 03 => %q^
223
+ 1c4 1b4
224
+ ^,
225
+ 04 => %q^
226
+ 1c4 1b4
227
+ ^
228
+ },
229
+
230
+ :silent => {
231
+ 00 => %q^
232
+ 1 1 1 1
233
+ 1 1 1 1
234
+ ^,
235
+ 01 => %q^
236
+ 1b4 1d5
237
+ 2b4 2g4 1e4
238
+
239
+ 1c4 2gb5 2b4
240
+ 1c4 1b3
241
+ ^
242
+ },
243
+
244
+ :naughty => {
245
+ 00 => %q^
246
+ 1 1 1 1
247
+ 1 1 1 1
248
+ ^,
249
+ 01 => %q^
250
+ 2
251
+
252
+ 1b4 1e4
253
+ 2b3 2d4 2b4
254
+
255
+ 1a4 2gb4 2a3
256
+ 1eb4 1gb4
257
+ ^
258
+ }
259
+
260
+ }
261
+
262
+ end
263
+
264
+ ###
265
+ ### playroutine
266
+ ###
267
+
268
+ require 'yaml'
269
+ require './bloops'
270
+
271
+ extend self
272
+
273
+ def init
274
+ @bloops ||= Bloops.new
275
+ @bloops.tempo = Tune::BPM
276
+
277
+ return if @sounds
278
+
279
+ @sounds = {}
280
+ YAML.load(DATA.read).each do |track,instrument|
281
+ @sounds[track] = @bloops.sound instrument['sound'].split("::").inject(Object) { |c1,c2| c1.const_get(c2) }
282
+ instrument.reject{|k,v| k == 'sound'}.each do |sound,value|
283
+ @sounds[track].send "#{sound}=", value
284
+ end
285
+ end
286
+
287
+ Tune::SEQUENCES.each do |track,sequences|
288
+ instr = track.to_s.split('_')[0]
289
+ next unless @sounds[instr]
290
+ next unless Tune::PATTERNS[track]
291
+
292
+ notes = ''
293
+ sequences.each do |seq|
294
+ seq = seq.to_i
295
+ next unless Tune::PATTERNS[track][seq]
296
+ notes << Tune::PATTERNS[track][seq]
297
+ end
298
+ @bloops.tune @sounds[instr], notes
299
+ end
300
+ end
301
+
302
+ def play
303
+ init unless @bloops
304
+ @bloops.play
305
+ sleep 0.05 while !@bloops.stopped?
306
+ end
307
+
308
+ def play_endless
309
+ while true do play; end
310
+ end
311
+
312
+ end
313
+
314
+ LousyBloopMachine.play_endless if $0 == __FILE__
315
+
316
+ ###
317
+ ### instruments
318
+ ###
319
+
320
+ __END__
321
+
322
+ bass:
323
+ sound: Bloops::SQUARE
324
+ volume: 0.9
325
+ attack: 0.1
326
+ decay: 0.15
327
+ sustain: 0.05
328
+ square: 0.05
329
+ phase: 0.5
330
+ psweep: -0.255
331
+
332
+ base:
333
+ sound: Bloops::SINE
334
+ volume: 0.6
335
+ attack: 0.0
336
+ decay: 0.25
337
+ sustain: 0.15
338
+ lpf: 0.45
339
+ resonance: 0.4
340
+ dslide: -0.3
341
+
342
+ snare:
343
+ sound: Bloops::NOISE
344
+ volume: 0.25
345
+ attack: 0.01
346
+ decay: 0.305
347
+ sustain: 0
348
+ hpf: 0.65
349
+ resonance: 0.24
350
+ dslide: -0.452
351
+
352
+ hihat:
353
+ sound: Bloops::NOISE
354
+ volume: 0.25
355
+ attack: 0.150
356
+ decay: 0.105
357
+ sustain: 0.205
358
+ hpf: 0.95
359
+
360
+ rhodes:
361
+ sound: Bloops::SAWTOOTH
362
+ volume: 0.09
363
+ attack: 0.55
364
+ decay: 1.0
365
+ sustain: 0.45
366
+ lpf: 0.55
367
+ lsweep: -0.005
368
+ resonance: 0.35
369
+ vibe: 0.035
370
+ vspeed: 0.292
371
+ phase: 0.305
372
+ psweep: -0.025
373
+ vdelay: 0.9
374
+
375
+ silent:
376
+ sound: Bloops::SINE
377
+ volume: 0.45
378
+ attack: 0.35
379
+ decay: 0.95
380
+ sustain: 0.85
381
+ lpf: 0.25
382
+ lsweep: -0.025
383
+ hpf: 0.25
384
+ hsweep: -0.025
385
+ resonance: 0.75
386
+ vibe: 0.055
387
+ vspeed: -0.325
388
+ phase: 0.505
389
+ psweep: -0.025
390
+
391
+ naughty:
392
+ sound: Bloops::SQUARE
393
+ volume: 0.15
394
+ attack: 0.45
395
+ decay: 0.95
396
+ sustain: 0.85
397
+ lpf: 0.25
398
+ lsweep: -0.025
399
+ hpf: 0.25
400
+ hsweep: -0.025
401
+ resonance: 0.65
402
+ vibe: 0.065
403
+ vspeed: -0.325
404
+ phase: 0.305
405
+ psweep: -0.025
406
+ square: 0.75
407
+ phase: 0.0
408
+ psweep: 0.555
data/misc/Makefile-dll ADDED
@@ -0,0 +1,91 @@
1
+ # Project: portaudio-dll
2
+ # Makefile created by Dev-C++ 4.9.8.2
3
+ # modified 2009-01-25 by Mateusz Czaplinski for MinGW and PortAudio V19.
4
+ # http://www.musescore.org/en/handbook/compile-instructions-windows-mingw
5
+
6
+ TMPOBJ = ./pa_asio.o ./iasiothiscallresolver.o ./pa_win_ds.o ./dsound_wrapper.o
7
+ TMPLINKOBJ = ./pa_asio.o ./iasiothiscallresolver.o ./pa_win_ds.o ./dsound_wrapper.o
8
+
9
+ CPP = g++.exe
10
+ CC = gcc.exe
11
+ WINDRES = windres.exe
12
+ RES =
13
+ OBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_wmme.o ./pa_win_waveformat.o $(RES)
14
+ LINKOBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_wmme.o ./pa_win_waveformat.o $(RES)
15
+ LIBS = -fmessage-length=0 -export-all-symbols --add-stdcall-alias -O3 -s -lwinmm
16
+ INCS = -I"../../src/common" -I"../../include"
17
+ CXXINCS = -I"../../src/common" -I"../../include"
18
+ BIN = portaudio.dll
19
+ CXXFLAGS = $(CXXINCS) -DBUILDING_DLL=1 -O3 -fmessage-length=0 -Wall -DPA_NO_DS -DPA_NO_ASIO
20
+ CFLAGS = $(CXXFLAGS)
21
+
22
+ .PHONY: all all-before all-after clean clean-custom
23
+
24
+ all: all-before $(BIN) all-after
25
+
26
+
27
+ clean: clean-custom
28
+ rm -f $(OBJ) $(BIN)
29
+
30
+ DLLWRAP=dllwrap.exe
31
+ DEFFILE=libportaudio.def
32
+ STATICLIB=libportaudio.a
33
+
34
+ $(BIN): $(LINKOBJ)
35
+ $(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(LINKOBJ) $(LIBS) -o $(BIN)
36
+
37
+ ./pa_skeleton.o: ../../src/common/pa_skeleton.c
38
+ $(CPP) -c ../../src/common/pa_skeleton.c -o ./pa_skeleton.o $(CXXFLAGS)
39
+
40
+ ./pa_stream.o: ../../src/common/pa_stream.c
41
+ $(CPP) -c ../../src/common/pa_stream.c -o ./pa_stream.o $(CXXFLAGS)
42
+
43
+ ./pa_trace.o: ../../src/common/pa_trace.c
44
+ $(CPP) -c ../../src/common/pa_trace.c -o ./pa_trace.o $(CXXFLAGS)
45
+
46
+ ./pa_allocation.o: ../../src/common/pa_allocation.c
47
+ $(CPP) -c ../../src/common/pa_allocation.c -o ./pa_allocation.o $(CXXFLAGS)
48
+
49
+ ./pa_converters.o: ../../src/common/pa_converters.c
50
+ $(CPP) -c ../../src/common/pa_converters.c -o ./pa_converters.o $(CXXFLAGS)
51
+
52
+ ./pa_cpuload.o: ../../src/common/pa_cpuload.c
53
+ $(CPP) -c ../../src/common/pa_cpuload.c -o ./pa_cpuload.o $(CXXFLAGS)
54
+
55
+ ./pa_dither.o: ../../src/common/pa_dither.c
56
+ $(CPP) -c ../../src/common/pa_dither.c -o ./pa_dither.o $(CXXFLAGS)
57
+
58
+ ./pa_front.o: ../../src/common/pa_front.c
59
+ $(CPP) -c ../../src/common/pa_front.c -o ./pa_front.o $(CXXFLAGS)
60
+
61
+ ./pa_process.o: ../../src/common/pa_process.c
62
+ $(CPP) -c ../../src/common/pa_process.c -o ./pa_process.o $(CXXFLAGS)
63
+
64
+ #./pa_asio.o: ../../pa_asio/pa_asio.cpp
65
+ # $(CPP) -c ../../pa_asio/pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS)
66
+
67
+ ./pa_win_util.o: ../../src/os/win/pa_win_util.c
68
+ $(CPP) -c ../../src/os/win/pa_win_util.c -o ./pa_win_util.o $(CXXFLAGS)
69
+
70
+ ./pa_win_hostapis.o: ../../src/os/win/pa_win_hostapis.c
71
+ $(CPP) -c ../../src/os/win/pa_win_hostapis.c -o ./pa_win_hostapis.o $(CXXFLAGS)
72
+
73
+ #./pa_win_ds.o: ../../pa_win_ds/pa_win_ds.c
74
+ # $(CPP) -c ../../pa_win_ds/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS)
75
+ #./pa_win_ds.o: ../../src/hostapi/dsound/pa_win_ds.c
76
+ # $(CPP) -c ../../src/hostapi/dsound/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS)
77
+
78
+ #./dsound_wrapper.o: ../../pa_win_ds/dsound_wrapper.c
79
+ # $(CPP) -c ../../pa_win_ds/dsound_wrapper.c -o ./dsound_wrapper.o $(CXXFLAGS)
80
+ #./dsound_wrapper.o: ../../src/hostapi/dsound/pa_win_ds_dynlink.c
81
+ # $(CPP) -c ../../src/hostapi/dsound/pa_win_ds_dynlink.c -o ./dsound_wrapper.o $(CXXFLAGS)
82
+
83
+ ./pa_win_wmme.o: ../../src/hostapi/wmme/pa_win_wmme.c
84
+ $(CPP) -c ../../src/hostapi/wmme/pa_win_wmme.c -o ./pa_win_wmme.o $(CXXFLAGS)
85
+
86
+ #./iasiothiscallresolver.o: ../../pa_asio/iasiothiscallresolver.cpp
87
+ # $(CPP) -c ../../pa_asio/iasiothiscallresolver.cpp -o ./iasiothiscallresolver.o $(CXXFLAGS)
88
+
89
+ ./pa_win_waveformat.o: ../../src/os/win/pa_win_waveformat.c
90
+ $(CPP) -c ../../src/os/win/pa_win_waveformat.c -o ./pa_win_waveformat.o $(CXXFLAGS)
91
+
data/sounds/dart.blu ADDED
@@ -0,0 +1,10 @@
1
+ type noise
2
+ punch 0.524
3
+ sustain 0.160
4
+ decay 0.367
5
+ freq 0.296
6
+ slide -0.373
7
+ vibe 0.665
8
+ vspeed 0.103
9
+ phase 0.141
10
+ psweep -0.005
data/sounds/error.blu ADDED
@@ -0,0 +1,13 @@
1
+ type square
2
+ sustain 0.333
3
+ decay 0.380
4
+ freq 0.336
5
+ slide 0.292
6
+ square 0.289
7
+ sweep 0.020
8
+ vibe 0.002
9
+ lpf 0.220
10
+ lsweep 0.015
11
+ resonance 0.875
12
+ aspeed 0.035
13
+ repeat 0.551
data/sounds/ice.blu ADDED
@@ -0,0 +1,5 @@
1
+ type square
2
+ punch 0.441
3
+ sustain 0.067
4
+ decay 0.197
5
+ freq 0.499
data/sounds/jump.blu ADDED
@@ -0,0 +1,8 @@
1
+ type square
2
+ sustain 0.266
3
+ decay 0.187
4
+ freq 0.268
5
+ slide 0.179
6
+ square 0.326
7
+ vibe 0.227
8
+ vspeed 0.231
data/sounds/pogo.blu ADDED
@@ -0,0 +1,19 @@
1
+ type square
2
+ volume 0.977
3
+ punch 0.190
4
+ sustain 0.165
5
+ slide 0.100
6
+ dslide 0.030
7
+ square 0.048
8
+ sweep -0.055
9
+ vibe 0.437
10
+ vspeed 0.310
11
+ lpf 0.355
12
+ resonance 0.185
13
+ hpf 0.205
14
+ hsweep 0.255
15
+ arp 0.677
16
+ aspeed 0.275
17
+ phase 0.200
18
+ psweep -0.565
19
+ repeat 0.500
data/sounds/stun.blu ADDED
@@ -0,0 +1,6 @@
1
+ type sawtooth
2
+ sustain 0.306
3
+ decay 0.477
4
+ freq 0.429
5
+ slide 0.217
6
+ repeat 0.677
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bloops
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.5'
5
+ platform: ruby
6
+ authors:
7
+ - why the lucky stiff
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2009-02-12 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions:
17
+ - ext/ruby/extconf.rb
18
+ extra_rdoc_files:
19
+ - README
20
+ - COPYING
21
+ files:
22
+ - COPYING
23
+ - Makefile
24
+ - README
25
+ - c/bloopsaphone-internal.h
26
+ - c/bloopsaphone.c
27
+ - c/bloopsaphone.h
28
+ - c/bloopsawhat.c
29
+ - c/notation.c
30
+ - c/notation.rl
31
+ - ext/ruby/extconf.rb
32
+ - ext/ruby/rubyext.c
33
+ - ext/ruby/test.rb
34
+ - ext/ruby/test_load.rb
35
+ - ext/ruby/tune_cheeky_drat.rb
36
+ - ext/ruby/tune_warp.rb
37
+ - misc/Makefile-dll
38
+ - sounds/dart.blu
39
+ - sounds/error.blu
40
+ - sounds/ice.blu
41
+ - sounds/jump.blu
42
+ - sounds/pogo.blu
43
+ - sounds/stun.blu
44
+ homepage: http://github.com/scarpe-team/bloopsaphone
45
+ licenses: []
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubygems_version: 3.4.10
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: arcade sounds and chiptunes
66
+ test_files: []