viking-bloopsaphone 0.4 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/c/bloopsaphone.h CHANGED
@@ -7,44 +7,17 @@
7
7
 
8
8
  #define BLOOPSAPHONE_VERSION "1.0"
9
9
 
10
- typedef enum {
11
- BLOOPS_STOP = 0,
12
- BLOOPS_PLAY = 1
13
- } bloopsastate;
10
+ #define BLOOPS_STOP 0
11
+ #define BLOOPS_PLAY 1
12
+ #define BLOOPS_MUTE 2
14
13
 
15
- typedef enum {
16
- BLOOPS_SQUARE = 0,
17
- BLOOPS_SAWTOOTH = 1,
18
- BLOOPS_SINE = 2,
19
- BLOOPS_NOISE = 3
20
- } bloopswaveform;
21
-
22
- typedef enum {
23
- BLOOPS_FX_VOLUME = 0,
24
- BLOOPS_FX_PUNCH = 1,
25
- BLOOPS_FX_ATTACK = 2,
26
- BLOOPS_FX_SUSTAIN = 3,
27
- BLOOPS_FX_DECAY = 4,
28
- BLOOPS_FX_SWEEP = 5,
29
- BLOOPS_FX_SQUARE = 6,
30
- BLOOPS_FX_VIBE = 7,
31
- BLOOPS_FX_VSPEED = 8,
32
- BLOOPS_FX_VDELAY = 9,
33
- BLOOPS_FX_LPF = 10,
34
- BLOOPS_FX_LSWEEP = 11,
35
- BLOOPS_FX_RESONANCE = 12,
36
- BLOOPS_FX_HPF = 13,
37
- BLOOPS_FX_HSWEEP = 14,
38
- BLOOPS_FX_ARP = 15,
39
- BLOOPS_FX_ASPEED = 16,
40
- BLOOPS_FX_PHASE = 17,
41
- BLOOPS_FX_PSWEEP = 18,
42
- BLOOPS_FX_REPEAT = 19
43
- } bloopsafxcmd;
14
+ #define BLOOPS_SQUARE 0
15
+ #define BLOOPS_SAWTOOTH 1
16
+ #define BLOOPS_SINE 2
17
+ #define BLOOPS_NOISE 3
44
18
 
45
19
  typedef struct {
46
- bloopswaveform type;
47
- unsigned char pan;
20
+ unsigned char type, pan;
48
21
  float volume;
49
22
  float punch;
50
23
  float attack;
@@ -58,40 +31,22 @@ typedef struct {
58
31
  float arp, aspeed; // arpeggiator
59
32
  float phase, psweep; // phaser
60
33
  float repeat; // repeats?
61
- } bloopsaparams;
62
-
63
- typedef struct {
64
- unsigned refcount;
65
- bloopsaparams params;
66
34
  } bloopsaphone;
67
35
 
68
36
  #define BLOOPS_HI_OCTAVE 8
69
37
 
70
- typedef struct bloopsafx_tag {
71
- bloopsafxcmd cmd;
72
- float val;
73
- char mod;
74
- struct bloopsafx_tag *next;
75
- } bloopsafx;
76
-
77
38
  typedef struct {
78
39
  char tone, octave, duration;
79
- bloopsafx *FX;
80
40
  } bloopsanote;
81
41
 
82
42
  typedef struct {
83
- unsigned refcount;
43
+ bloopsaphone *P;
84
44
  int nlen, capa;
85
45
  bloopsanote *notes;
86
- bloopsaparams params;
87
- } bloopsatrack;
88
46
 
89
- typedef struct {
90
- bloopsatrack *track;
91
- bloopsaparams params;
92
- int frames, nextnote[2];
47
+ int frames;
93
48
  float volume, freq;
94
- bloopsastate state;
49
+ unsigned char playing;
95
50
  int stage, time, length[3];
96
51
  double period, maxperiod, slide, dslide;
97
52
  float square, sweep;
@@ -104,51 +59,37 @@ typedef struct {
104
59
  int repeat, limit;
105
60
  double arp;
106
61
  int atime, alimit;
107
- } bloopsavoice;
62
+ } bloopsatrack;
108
63
 
109
64
  #define BLOOPS_MAX_TRACKS 64
110
- #define BLOOPS_MAX_CHANNELS 64
111
65
 
112
66
  typedef struct {
113
- unsigned refcount;
67
+ void *stream;
114
68
  int tempo;
115
69
  float volume;
116
- bloopsavoice voices[BLOOPS_MAX_TRACKS];
117
- bloopsastate state;
70
+ bloopsatrack *tracks[BLOOPS_MAX_TRACKS];
71
+ unsigned char play;
118
72
  } bloops;
119
73
 
120
- typedef struct {
121
- bloops *B[BLOOPS_MAX_CHANNELS];
122
- void *stream;
123
- } bloopsmix;
124
-
125
74
  //
126
75
  // the api
127
76
  //
128
77
  bloops *bloops_new();
129
- void bloops_ref(bloops *);
130
78
  void bloops_destroy(bloops *);
131
-
79
+ bloopsaphone *bloops_square();
80
+ bloopsaphone *bloops_load(char *);
132
81
  void bloops_clear(bloops *);
133
82
  void bloops_tempo(bloops *, int tempo);
83
+ void bloops_track_at(bloops *, bloopsatrack *, int);
84
+ void bloops_track_destroy(bloopsatrack *);
134
85
  void bloops_play(bloops *);
135
- void bloops_stop(bloops *);
86
+ int bloops_record(bloops *, char *);
136
87
  int bloops_is_done(bloops *);
137
-
138
88
  bloopsatrack *bloops_track(bloops *, bloopsaphone *, char *, int);
139
89
  bloopsatrack *bloops_track2(bloops *, bloopsaphone *, char *);
140
- void bloops_track_ref(bloopsatrack *);
141
- void bloops_track_destroy(bloopsatrack *);
142
-
143
- bloopsaphone *bloops_square();
144
- bloopsaphone *bloops_sound_file(bloops *, char *);
145
- void bloops_sound_copy(bloopsaphone *, bloopsaphone const *);
146
- void bloops_sound_ref(bloopsaphone *);
147
- void bloops_sound_destroy(bloopsaphone *);
148
-
149
90
  char *bloops_track_str(bloopsatrack *);
150
- char *bloops_fxcmd_name(bloopsafxcmd fxcmd);
151
91
  float bloops_note_freq(char, int);
152
- char *bloops_sound_str(bloopsaphone *);
153
-
92
+ bloopsaphone *bloops_sound_file(bloops *, char *);
93
+ char *bloops_sound_str(bloops *, bloopsaphone *);
94
+
154
95
  #endif
data/c/notation.c CHANGED
@@ -35,372 +35,101 @@
35
35
  mod = 0; \
36
36
  tone = 0; \
37
37
  len = 4; \
38
- fxval = 0; \
39
- fxmod = 0; \
40
38
  S->nlen++
41
39
 
42
40
 
43
- #line 44 "c/notation.c"
41
+ #line 42 "c/notation.c"
44
42
  static const char _bloopnotes_actions[] = {
45
- 0, 1, 1, 1, 3, 1, 4, 1,
46
- 6, 1, 8, 1, 9, 1, 10, 1,
47
- 11, 1, 12, 1, 13, 1, 14, 1,
48
- 15, 1, 16, 1, 17, 1, 18, 1,
49
- 19, 1, 20, 1, 21, 1, 22, 1,
50
- 23, 1, 24, 1, 25, 1, 26, 1,
51
- 27, 1, 28, 1, 29, 1, 30, 1,
52
- 31, 1, 32, 1, 33, 1, 34, 1,
53
- 35, 1, 36, 1, 41, 2, 0, 37,
54
- 2, 0, 39, 2, 0, 40, 2, 28,
55
- 39, 2, 29, 40, 2, 35, 0, 2,
56
- 35, 5, 2, 35, 30, 2, 35, 32,
57
- 3, 1, 2, 38, 3, 3, 2, 38,
58
- 3, 30, 2, 38, 3, 32, 2, 38,
59
- 3, 35, 4, 5, 3, 35, 5, 7,
60
- 4, 35, 4, 5, 7
43
+ 0, 1, 0, 1, 3, 1, 4, 1,
44
+ 5, 1, 6, 1, 7, 1, 8, 1,
45
+ 9, 2, 0, 10, 2, 0, 12, 2,
46
+ 0, 13, 2, 3, 12, 2, 4, 13,
47
+ 3, 1, 2, 11, 3, 5, 2, 11,
48
+ 3, 6, 2, 11
61
49
  };
62
50
 
63
- static const short _bloopnotes_key_offsets[] = {
64
- 0, 0, 8, 11, 12, 20, 27, 31,
65
- 37, 39, 43, 45, 48, 52, 54, 57,
66
- 60, 66, 70, 71, 72, 73, 74, 82,
67
- 83, 84, 85, 86, 94, 95, 96, 97,
68
- 98, 106, 108, 109, 117, 118, 119, 120,
69
- 121, 129, 131, 132, 140, 141, 142, 143,
70
- 144, 152, 155, 156, 157, 158, 166, 167,
71
- 168, 169, 170, 178, 179, 180, 181, 189,
72
- 190, 192, 193, 194, 195, 203, 204, 205,
73
- 206, 207, 208, 209, 217, 220, 221, 222,
74
- 223, 224, 232, 233, 234, 235, 236, 237,
75
- 245, 246, 247, 248, 256, 260, 261, 262,
76
- 263, 264, 272, 273, 274, 282, 283, 284,
77
- 285, 286, 294, 295, 296, 297, 298, 306,
78
- 317, 319, 322, 323, 323, 325, 328, 329,
79
- 329, 336, 341, 345, 350, 353, 354
51
+ static const char _bloopnotes_key_offsets[] = {
52
+ 0, 0, 11, 13, 16, 17, 17, 19,
53
+ 22, 23, 23, 30, 35, 39, 43, 45
80
54
  };
81
55
 
82
56
  static const char _bloopnotes_trans_keys[] = {
83
- 97, 100, 104, 108, 112, 114, 115, 118,
84
- 114, 115, 116, 112, 32, 43, 45, 58,
85
- 9, 13, 48, 57, 32, 43, 45, 9,
86
- 13, 48, 57, 32, 58, 9, 13, 32,
87
- 45, 9, 13, 48, 57, 48, 57, 46,
88
- 93, 48, 57, 48, 57, 93, 48, 57,
89
- 46, 93, 48, 57, 48, 57, 93, 48,
90
- 57, 45, 48, 57, 32, 58, 9, 13,
91
- 48, 57, 43, 45, 48, 57, 112, 101,
92
- 101, 100, 32, 43, 45, 58, 9, 13,
93
- 48, 57, 116, 97, 99, 107, 32, 43,
94
- 45, 58, 9, 13, 48, 57, 101, 99,
95
- 97, 121, 32, 43, 45, 58, 9, 13,
96
- 48, 57, 112, 115, 102, 32, 43, 45,
97
- 58, 9, 13, 48, 57, 119, 101, 101,
98
- 112, 32, 43, 45, 58, 9, 13, 48,
99
- 57, 112, 115, 102, 32, 43, 45, 58,
100
- 9, 13, 48, 57, 119, 101, 101, 112,
101
- 32, 43, 45, 58, 9, 13, 48, 57,
102
- 104, 115, 117, 97, 115, 101, 32, 43,
103
- 45, 58, 9, 13, 48, 57, 119, 101,
104
- 101, 112, 32, 43, 45, 58, 9, 13,
105
- 48, 57, 110, 99, 104, 32, 43, 45,
106
- 58, 9, 13, 48, 57, 101, 112, 115,
107
- 101, 97, 116, 32, 43, 45, 58, 9,
108
- 13, 48, 57, 111, 110, 97, 110, 99,
109
- 101, 32, 43, 45, 58, 9, 13, 48,
110
- 57, 113, 117, 119, 117, 97, 114, 101,
111
- 32, 43, 45, 58, 9, 13, 48, 57,
112
- 115, 116, 97, 105, 110, 32, 43, 45,
113
- 58, 9, 13, 48, 57, 101, 101, 112,
114
- 32, 43, 45, 58, 9, 13, 48, 57,
115
- 100, 105, 111, 115, 101, 108, 97, 121,
116
- 32, 43, 45, 58, 9, 13, 48, 57,
117
- 98, 101, 32, 43, 45, 58, 9, 13,
118
- 48, 57, 108, 117, 109, 101, 32, 43,
119
- 45, 58, 9, 13, 48, 57, 112, 101,
120
- 101, 100, 32, 43, 45, 58, 9, 13,
121
- 48, 57, 32, 43, 45, 9, 13, 49,
122
- 57, 65, 71, 97, 103, 49, 57, 58,
123
- 48, 57, 58, 49, 57, 58, 48, 57,
124
- 58, 58, 48, 57, 65, 71, 97, 103,
125
- 58, 65, 71, 97, 103, 65, 71, 97,
126
- 103, 35, 91, 98, 49, 56, 91, 49,
127
- 56, 91, 91, 0
57
+ 32, 43, 45, 9, 13, 49, 57, 65,
58
+ 71, 97, 103, 49, 57, 58, 48, 57,
59
+ 58, 49, 57, 58, 48, 57, 58, 58,
60
+ 48, 57, 65, 71, 97, 103, 58, 65,
61
+ 71, 97, 103, 65, 71, 97, 103, 35,
62
+ 98, 49, 56, 49, 56, 0
128
63
  };
129
64
 
130
65
  static const char _bloopnotes_single_lengths[] = {
131
- 0, 8, 3, 1, 4, 3, 2, 2,
132
- 0, 2, 0, 1, 2, 0, 1, 1,
133
- 2, 2, 1, 1, 1, 1, 4, 1,
134
- 1, 1, 1, 4, 1, 1, 1, 1,
135
- 4, 2, 1, 4, 1, 1, 1, 1,
136
- 4, 2, 1, 4, 1, 1, 1, 1,
137
- 4, 3, 1, 1, 1, 4, 1, 1,
138
- 1, 1, 4, 1, 1, 1, 4, 1,
139
- 2, 1, 1, 1, 4, 1, 1, 1,
140
- 1, 1, 1, 4, 3, 1, 1, 1,
141
- 1, 4, 1, 1, 1, 1, 1, 4,
142
- 1, 1, 1, 4, 4, 1, 1, 1,
143
- 1, 4, 1, 1, 4, 1, 1, 1,
144
- 1, 4, 1, 1, 1, 1, 4, 3,
145
- 0, 1, 1, 0, 0, 1, 1, 0,
146
- 1, 1, 0, 3, 1, 1, 1
66
+ 0, 3, 0, 1, 1, 0, 0, 1,
67
+ 1, 0, 1, 1, 0, 2, 0, 0
147
68
  };
148
69
 
149
70
  static const char _bloopnotes_range_lengths[] = {
150
- 0, 0, 0, 0, 2, 2, 1, 2,
151
- 1, 1, 1, 1, 1, 1, 1, 1,
152
- 2, 1, 0, 0, 0, 0, 2, 0,
153
- 0, 0, 0, 2, 0, 0, 0, 0,
154
- 2, 0, 0, 2, 0, 0, 0, 0,
155
- 2, 0, 0, 2, 0, 0, 0, 0,
156
- 2, 0, 0, 0, 0, 2, 0, 0,
157
- 0, 0, 2, 0, 0, 0, 2, 0,
158
- 0, 0, 0, 0, 2, 0, 0, 0,
159
- 0, 0, 0, 2, 0, 0, 0, 0,
160
- 0, 2, 0, 0, 0, 0, 0, 2,
161
- 0, 0, 0, 2, 0, 0, 0, 0,
162
- 0, 2, 0, 0, 2, 0, 0, 0,
163
- 0, 2, 0, 0, 0, 0, 2, 4,
164
- 1, 1, 0, 0, 1, 1, 0, 0,
165
- 3, 2, 2, 1, 1, 0, 0
71
+ 0, 4, 1, 1, 0, 0, 1, 1,
72
+ 0, 0, 3, 2, 2, 1, 1, 0
166
73
  };
167
74
 
168
- static const short _bloopnotes_index_offsets[] = {
169
- 0, 0, 9, 13, 15, 22, 28, 32,
170
- 37, 39, 43, 45, 48, 52, 54, 57,
171
- 60, 65, 69, 71, 73, 75, 77, 84,
172
- 86, 88, 90, 92, 99, 101, 103, 105,
173
- 107, 114, 117, 119, 126, 128, 130, 132,
174
- 134, 141, 144, 146, 153, 155, 157, 159,
175
- 161, 168, 172, 174, 176, 178, 185, 187,
176
- 189, 191, 193, 200, 202, 204, 206, 213,
177
- 215, 218, 220, 222, 224, 231, 233, 235,
178
- 237, 239, 241, 243, 250, 254, 256, 258,
179
- 260, 262, 269, 271, 273, 275, 277, 279,
180
- 286, 288, 290, 292, 299, 304, 306, 308,
181
- 310, 312, 319, 321, 323, 330, 332, 334,
182
- 336, 338, 345, 347, 349, 351, 353, 360,
183
- 368, 370, 373, 375, 376, 378, 381, 383,
184
- 384, 389, 393, 396, 401, 404, 406
75
+ static const char _bloopnotes_index_offsets[] = {
76
+ 0, 0, 8, 10, 13, 15, 16, 18,
77
+ 21, 23, 24, 29, 33, 36, 40, 42
185
78
  };
186
79
 
187
80
  static const char _bloopnotes_trans_targs[] = {
188
- 2, 28, 33, 41, 49, 63, 76, 92,
189
- 111, 3, 18, 23, 111, 4, 111, 5,
190
- 6, 16, 17, 5, 12, 111, 5, 6,
191
- 16, 5, 12, 111, 7, 15, 7, 111,
192
- 7, 8, 7, 12, 111, 9, 111, 10,
193
- 126, 9, 111, 11, 111, 126, 11, 111,
194
- 13, 126, 12, 111, 14, 111, 126, 14,
195
- 111, 8, 12, 111, 7, 15, 7, 9,
196
- 111, 6, 16, 12, 111, 19, 111, 20,
197
- 111, 21, 111, 22, 111, 5, 6, 16,
198
- 17, 5, 12, 111, 24, 111, 25, 111,
199
- 26, 111, 27, 111, 5, 6, 16, 17,
200
- 5, 12, 111, 29, 111, 30, 111, 31,
201
- 111, 32, 111, 5, 6, 16, 17, 5,
202
- 12, 111, 34, 36, 111, 35, 111, 5,
203
- 6, 16, 17, 5, 12, 111, 37, 111,
204
- 38, 111, 39, 111, 40, 111, 5, 6,
205
- 16, 17, 5, 12, 111, 42, 44, 111,
206
- 43, 111, 5, 6, 16, 17, 5, 12,
207
- 111, 45, 111, 46, 111, 47, 111, 48,
208
- 111, 5, 6, 16, 17, 5, 12, 111,
209
- 50, 54, 59, 111, 51, 111, 52, 111,
210
- 53, 111, 5, 6, 16, 17, 5, 12,
211
- 111, 55, 111, 56, 111, 57, 111, 58,
212
- 111, 5, 6, 16, 17, 5, 12, 111,
213
- 60, 111, 61, 111, 62, 111, 5, 6,
214
- 16, 17, 5, 12, 111, 64, 111, 65,
215
- 69, 111, 66, 111, 67, 111, 68, 111,
216
- 5, 6, 16, 17, 5, 12, 111, 70,
217
- 111, 71, 111, 72, 111, 73, 111, 74,
218
- 111, 75, 111, 5, 6, 16, 17, 5,
219
- 12, 111, 77, 82, 88, 111, 78, 111,
220
- 79, 111, 80, 111, 81, 111, 5, 6,
221
- 16, 17, 5, 12, 111, 83, 111, 84,
222
- 111, 85, 111, 86, 111, 87, 111, 5,
223
- 6, 16, 17, 5, 12, 111, 89, 111,
224
- 90, 111, 91, 111, 5, 6, 16, 17,
225
- 5, 12, 111, 93, 98, 101, 106, 111,
226
- 94, 111, 95, 111, 96, 111, 97, 111,
227
- 5, 6, 16, 17, 5, 12, 111, 99,
228
- 111, 100, 111, 5, 6, 16, 17, 5,
229
- 12, 111, 102, 111, 103, 111, 104, 111,
230
- 105, 111, 5, 6, 16, 17, 5, 12,
231
- 111, 107, 111, 108, 111, 109, 111, 110,
232
- 111, 5, 6, 16, 17, 5, 12, 111,
233
- 111, 112, 116, 111, 120, 123, 123, 0,
234
- 113, 111, 115, 114, 111, 115, 111, 111,
235
- 117, 111, 119, 118, 111, 119, 111, 111,
236
- 122, 121, 123, 123, 111, 122, 123, 123,
237
- 111, 123, 123, 111, 124, 1, 124, 125,
238
- 111, 1, 125, 111, 1, 111, 1, 111,
239
- 111, 111, 111, 111, 111, 111, 111, 111,
240
- 111, 111, 111, 111, 111, 111, 111, 111,
241
- 111, 111, 111, 111, 111, 111, 111, 111,
242
- 111, 111, 111, 111, 111, 111, 111, 111,
243
- 111, 111, 111, 111, 111, 111, 111, 111,
244
- 111, 111, 111, 111, 111, 111, 111, 111,
245
- 111, 111, 111, 111, 111, 111, 111, 111,
246
- 111, 111, 111, 111, 111, 111, 111, 111,
247
- 111, 111, 111, 111, 111, 111, 111, 111,
248
- 111, 111, 111, 111, 111, 111, 111, 111,
249
- 111, 111, 111, 111, 111, 111, 111, 111,
250
- 111, 111, 111, 111, 111, 111, 111, 111,
251
- 111, 111, 111, 111, 111, 111, 111, 111,
252
- 111, 111, 111, 111, 111, 111, 111, 111,
253
- 111, 111, 111, 111, 111, 111, 111, 111,
254
- 111, 111, 111, 111, 111, 0
81
+ 1, 2, 6, 1, 10, 13, 13, 0,
82
+ 3, 1, 5, 4, 1, 5, 1, 1,
83
+ 7, 1, 9, 8, 1, 9, 1, 1,
84
+ 12, 11, 13, 13, 1, 12, 13, 13,
85
+ 1, 13, 13, 1, 14, 14, 15, 1,
86
+ 15, 1, 1, 1, 1, 1, 1, 1,
87
+ 1, 1, 1, 1, 1, 1, 1, 1,
88
+ 1, 0
255
89
  };
256
90
 
257
91
  static const char _bloopnotes_trans_actions[] = {
258
- 0, 0, 0, 0, 0, 0, 0, 0,
259
- 67, 0, 0, 0, 67, 0, 67, 39,
260
- 39, 39, 39, 39, 39, 67, 0, 0,
261
- 0, 0, 0, 67, 55, 55, 55, 67,
262
- 0, 0, 0, 0, 67, 0, 67, 5,
263
- 120, 0, 67, 7, 67, 116, 0, 67,
264
- 5, 112, 0, 67, 7, 67, 87, 0,
265
- 67, 0, 0, 67, 55, 55, 55, 0,
266
- 67, 0, 0, 0, 67, 0, 67, 0,
267
- 67, 0, 67, 0, 67, 41, 41, 41,
268
- 41, 41, 41, 67, 0, 67, 0, 67,
269
- 0, 67, 0, 67, 13, 13, 13, 13,
270
- 13, 13, 67, 0, 67, 0, 67, 0,
271
- 67, 0, 67, 17, 17, 17, 17, 17,
272
- 17, 67, 0, 0, 67, 0, 67, 35,
273
- 35, 35, 35, 35, 35, 67, 0, 67,
274
- 0, 67, 0, 67, 0, 67, 37, 37,
275
- 37, 37, 37, 37, 67, 0, 0, 67,
276
- 0, 67, 29, 29, 29, 29, 29, 29,
277
- 67, 0, 67, 0, 67, 0, 67, 0,
278
- 67, 31, 31, 31, 31, 31, 31, 67,
279
- 0, 0, 0, 67, 0, 67, 0, 67,
280
- 0, 67, 43, 43, 43, 43, 43, 43,
281
- 67, 0, 67, 0, 67, 0, 67, 0,
282
- 67, 45, 45, 45, 45, 45, 45, 67,
283
- 0, 67, 0, 67, 0, 67, 11, 11,
284
- 11, 11, 11, 11, 67, 0, 67, 0,
285
- 0, 67, 0, 67, 0, 67, 0, 67,
286
- 47, 47, 47, 47, 47, 47, 67, 0,
287
- 67, 0, 67, 0, 67, 0, 67, 0,
288
- 67, 0, 67, 33, 33, 33, 33, 33,
289
- 33, 67, 0, 0, 0, 67, 0, 67,
290
- 0, 67, 0, 67, 0, 67, 19, 19,
291
- 19, 19, 19, 19, 67, 0, 67, 0,
292
- 67, 0, 67, 0, 67, 0, 67, 15,
293
- 15, 15, 15, 15, 15, 67, 0, 67,
294
- 0, 67, 0, 67, 21, 21, 21, 21,
295
- 21, 21, 67, 0, 0, 0, 0, 67,
296
- 0, 67, 0, 67, 0, 67, 0, 67,
297
- 27, 27, 27, 27, 27, 27, 67, 0,
298
- 67, 0, 67, 23, 23, 23, 23, 23,
299
- 23, 67, 0, 67, 0, 67, 0, 67,
300
- 0, 67, 9, 9, 9, 9, 9, 9,
301
- 67, 0, 67, 0, 67, 0, 67, 0,
302
- 67, 25, 25, 25, 25, 25, 25, 67,
303
- 65, 0, 0, 65, 0, 63, 63, 0,
304
- 49, 78, 0, 0, 72, 0, 72, 72,
305
- 51, 81, 0, 0, 75, 0, 75, 75,
306
- 0, 0, 84, 84, 69, 0, 84, 84,
307
- 69, 84, 84, 69, 93, 57, 93, 93,
308
- 108, 53, 90, 104, 1, 96, 3, 100,
309
- 67, 67, 67, 67, 67, 67, 67, 67,
310
- 67, 67, 67, 67, 67, 67, 67, 67,
311
- 67, 67, 67, 67, 67, 67, 67, 67,
312
- 67, 67, 67, 67, 67, 67, 67, 67,
313
- 67, 67, 67, 67, 67, 67, 67, 67,
314
- 67, 67, 67, 67, 67, 67, 67, 67,
315
- 67, 67, 67, 67, 67, 67, 67, 67,
316
- 67, 67, 67, 67, 67, 67, 67, 67,
317
- 67, 67, 67, 67, 67, 67, 67, 67,
318
- 67, 67, 67, 67, 67, 67, 67, 67,
319
- 67, 67, 67, 67, 67, 67, 67, 67,
320
- 67, 67, 67, 67, 67, 67, 67, 67,
321
- 67, 67, 67, 67, 67, 67, 67, 67,
322
- 67, 67, 67, 67, 67, 67, 78, 72,
323
- 72, 72, 81, 75, 75, 75, 69, 69,
324
- 69, 108, 104, 96, 100, 0
92
+ 15, 0, 0, 15, 0, 0, 0, 0,
93
+ 3, 26, 0, 0, 20, 0, 20, 20,
94
+ 5, 29, 0, 0, 23, 0, 23, 23,
95
+ 0, 0, 1, 1, 17, 0, 1, 1,
96
+ 17, 1, 1, 17, 9, 9, 9, 40,
97
+ 7, 36, 32, 26, 20, 20, 20, 29,
98
+ 23, 23, 23, 17, 17, 17, 40, 36,
99
+ 32, 0
325
100
  };
326
101
 
327
102
  static const char _bloopnotes_to_state_actions[] = {
328
- 0, 0, 0, 0, 0, 0, 0, 0,
329
- 0, 0, 0, 0, 0, 0, 0, 0,
330
- 0, 0, 0, 0, 0, 0, 0, 0,
331
- 0, 0, 0, 0, 0, 0, 0, 0,
332
- 0, 0, 0, 0, 0, 0, 0, 0,
333
- 0, 0, 0, 0, 0, 0, 0, 0,
334
- 0, 0, 0, 0, 0, 0, 0, 0,
335
- 0, 0, 0, 0, 0, 0, 0, 0,
336
- 0, 0, 0, 0, 0, 0, 0, 0,
337
- 0, 0, 0, 0, 0, 0, 0, 0,
338
- 0, 0, 0, 0, 0, 0, 0, 0,
339
- 0, 0, 0, 0, 0, 0, 0, 0,
340
- 0, 0, 0, 0, 0, 0, 0, 0,
341
- 0, 0, 0, 0, 0, 0, 0, 59,
342
- 0, 0, 0, 0, 0, 0, 0, 0,
343
- 0, 0, 0, 0, 0, 0, 0
103
+ 0, 11, 0, 0, 0, 0, 0, 0,
104
+ 0, 0, 0, 0, 0, 0, 0, 0
344
105
  };
345
106
 
346
107
  static const char _bloopnotes_from_state_actions[] = {
347
- 0, 0, 0, 0, 0, 0, 0, 0,
348
- 0, 0, 0, 0, 0, 0, 0, 0,
349
- 0, 0, 0, 0, 0, 0, 0, 0,
350
- 0, 0, 0, 0, 0, 0, 0, 0,
351
- 0, 0, 0, 0, 0, 0, 0, 0,
352
- 0, 0, 0, 0, 0, 0, 0, 0,
353
- 0, 0, 0, 0, 0, 0, 0, 0,
354
- 0, 0, 0, 0, 0, 0, 0, 0,
355
- 0, 0, 0, 0, 0, 0, 0, 0,
356
- 0, 0, 0, 0, 0, 0, 0, 0,
357
- 0, 0, 0, 0, 0, 0, 0, 0,
358
- 0, 0, 0, 0, 0, 0, 0, 0,
359
- 0, 0, 0, 0, 0, 0, 0, 0,
360
- 0, 0, 0, 0, 0, 0, 0, 61,
361
- 0, 0, 0, 0, 0, 0, 0, 0,
362
- 0, 0, 0, 0, 0, 0, 0
108
+ 0, 13, 0, 0, 0, 0, 0, 0,
109
+ 0, 0, 0, 0, 0, 0, 0, 0
363
110
  };
364
111
 
365
- static const short _bloopnotes_eof_trans[] = {
366
- 0, 518, 518, 518, 518, 518, 518, 518,
367
- 518, 518, 518, 518, 518, 518, 518, 518,
368
- 518, 518, 518, 518, 518, 518, 518, 518,
369
- 518, 518, 518, 518, 518, 518, 518, 518,
370
- 518, 518, 518, 518, 518, 518, 518, 518,
371
- 518, 518, 518, 518, 518, 518, 518, 518,
372
- 518, 518, 518, 518, 518, 518, 518, 518,
373
- 518, 518, 518, 518, 518, 518, 518, 518,
374
- 518, 518, 518, 518, 518, 518, 518, 518,
375
- 518, 518, 518, 518, 518, 518, 518, 518,
376
- 518, 518, 518, 518, 518, 518, 518, 518,
377
- 518, 518, 518, 518, 518, 518, 518, 518,
378
- 518, 518, 518, 518, 518, 518, 518, 518,
379
- 518, 518, 518, 518, 518, 518, 518, 0,
380
- 519, 522, 522, 522, 523, 526, 526, 526,
381
- 529, 529, 529, 530, 531, 532, 533
112
+ static const char _bloopnotes_eof_trans[] = {
113
+ 0, 0, 44, 47, 47, 47, 48, 51,
114
+ 51, 51, 54, 54, 54, 55, 56, 57
382
115
  };
383
116
 
384
- static const int bloopnotes_start = 111;
117
+ static const int bloopnotes_start = 1;
385
118
  static const int bloopnotes_error = 0;
386
119
 
387
- static const int bloopnotes_en_main = 111;
120
+ static const int bloopnotes_en_main = 1;
388
121
 
389
- #line 154 "c/notation.rl"
122
+ #line 109 "c/notation.rl"
390
123
 
391
124
 
392
- extern void _bloops_track_add(bloops *B, bloopsatrack *track);
393
-
394
125
  bloopsatrack *
395
126
  bloops_track(bloops *B, bloopsaphone *P, char *track, int tracklen)
396
127
  {
397
128
  int cs, act, oct = 4, len = 4;
398
129
  bloopsatrack *S = (bloopsatrack *)malloc(sizeof(bloopsatrack));
399
- char tone, mod, fxmod, *p, *pe, *pf, *ts, *te, *eof = 0;
400
- bloopsafxcmd fxcmd = (bloopsafxcmd)0;
401
- float fxval = 0;
130
+ char tone, mod, *p, *pe, *ts, *te, *eof = 0;
402
131
 
403
- S->refcount = 1;
132
+ S->P = P;
404
133
  S->nlen = 0;
405
134
  S->capa = 1024;
406
135
  S->notes = (bloopsanote *)calloc(sizeof(bloopsanote), 1024);
@@ -409,16 +138,16 @@ bloops_track(bloops *B, bloopsaphone *P, char *track, int tracklen)
409
138
  pe = track + tracklen + 1;
410
139
 
411
140
 
412
- #line 413 "c/notation.c"
141
+ #line 142 "c/notation.c"
413
142
  {
414
143
  cs = bloopnotes_start;
415
144
  ts = 0;
416
145
  te = 0;
417
146
  act = 0;
418
147
  }
419
- #line 176 "c/notation.rl"
148
+ #line 127 "c/notation.rl"
420
149
 
421
- #line 422 "c/notation.c"
150
+ #line 151 "c/notation.c"
422
151
  {
423
152
  int _klen;
424
153
  unsigned int _trans;
@@ -435,11 +164,11 @@ _resume:
435
164
  _nacts = (unsigned int) *_acts++;
436
165
  while ( _nacts-- > 0 ) {
437
166
  switch ( *_acts++ ) {
438
- case 34:
167
+ case 8:
439
168
  #line 1 "c/notation.rl"
440
169
  {ts = p;}
441
170
  break;
442
- #line 443 "c/notation.c"
171
+ #line 172 "c/notation.c"
443
172
  }
444
173
  }
445
174
 
@@ -505,19 +234,19 @@ _eof_trans:
505
234
  switch ( *_acts++ )
506
235
  {
507
236
  case 0:
508
- #line 44 "c/notation.rl"
237
+ #line 42 "c/notation.rl"
509
238
  {
510
239
  len = ATOI(ts, p - ts);
511
240
  }
512
241
  break;
513
242
  case 1:
514
- #line 48 "c/notation.rl"
243
+ #line 46 "c/notation.rl"
515
244
  {
516
245
  oct = ATOI(p - 1, 1);
517
246
  }
518
247
  break;
519
248
  case 2:
520
- #line 52 "c/notation.rl"
249
+ #line 50 "c/notation.rl"
521
250
  {
522
251
  switch (tone) {
523
252
  case 'a': case 'A':
@@ -559,169 +288,45 @@ _eof_trans:
559
288
  }
560
289
  break;
561
290
  case 3:
562
- #line 92 "c/notation.rl"
563
- {
564
- bloopsafx *fx = (bloopsafx *)malloc(sizeof(bloopsafx));
565
- fx->next = NOTE.FX;
566
- fx->cmd = fxcmd;
567
- fx->val = fxval;
568
- fx->mod = fxmod;
569
- fxval = fxmod = 0;
570
- NOTE.FX = fx;
571
- }
572
- break;
573
- case 4:
574
- #line 102 "c/notation.rl"
575
- {
576
- fxval = atoi(p-1) * 1.0f;
577
- }
578
- break;
579
- case 5:
580
- #line 106 "c/notation.rl"
581
- {
582
- fxval += ATOI(pf, p - pf) * pow(0.1f, p - pf);
583
- }
584
- break;
585
- case 6:
586
- #line 110 "c/notation.rl"
587
- { pf = p; }
588
- break;
589
- case 7:
590
- #line 111 "c/notation.rl"
591
- { fxval *= -1.0f; }
592
- break;
593
- case 8:
594
- #line 112 "c/notation.rl"
595
- { fxcmd = BLOOPS_FX_VOLUME; }
596
- break;
597
- case 9:
598
- #line 113 "c/notation.rl"
599
- { fxcmd = BLOOPS_FX_PUNCH; }
600
- break;
601
- case 10:
602
- #line 114 "c/notation.rl"
603
- { fxcmd = BLOOPS_FX_ATTACK; }
604
- break;
605
- case 11:
606
- #line 115 "c/notation.rl"
607
- { fxcmd = BLOOPS_FX_SUSTAIN; }
608
- break;
609
- case 12:
610
- #line 116 "c/notation.rl"
611
- { fxcmd = BLOOPS_FX_DECAY; }
612
- break;
613
- case 13:
614
- #line 117 "c/notation.rl"
615
- { fxcmd = BLOOPS_FX_SQUARE; }
616
- break;
617
- case 14:
618
- #line 118 "c/notation.rl"
619
- { fxcmd = BLOOPS_FX_SWEEP; }
620
- break;
621
- case 15:
622
- #line 119 "c/notation.rl"
623
- { fxcmd = BLOOPS_FX_VIBE; }
624
- break;
625
- case 16:
626
- #line 120 "c/notation.rl"
627
- { fxcmd = BLOOPS_FX_VSPEED; }
628
- break;
629
- case 17:
630
- #line 121 "c/notation.rl"
631
- { fxcmd = BLOOPS_FX_VDELAY; }
632
- break;
633
- case 18:
634
- #line 122 "c/notation.rl"
635
- { fxcmd = BLOOPS_FX_LPF; }
636
- break;
637
- case 19:
638
- #line 123 "c/notation.rl"
639
- { fxcmd = BLOOPS_FX_LSWEEP; }
640
- break;
641
- case 20:
642
- #line 124 "c/notation.rl"
643
- { fxcmd = BLOOPS_FX_RESONANCE; }
644
- break;
645
- case 21:
646
- #line 125 "c/notation.rl"
647
- { fxcmd = BLOOPS_FX_HPF; }
648
- break;
649
- case 22:
650
- #line 126 "c/notation.rl"
651
- { fxcmd = BLOOPS_FX_HSWEEP; }
652
- break;
653
- case 23:
654
- #line 127 "c/notation.rl"
655
- { fxcmd = BLOOPS_FX_ARP; }
656
- break;
657
- case 24:
658
- #line 128 "c/notation.rl"
659
- { fxcmd = BLOOPS_FX_ASPEED; }
660
- break;
661
- case 25:
662
- #line 129 "c/notation.rl"
663
- { fxcmd = BLOOPS_FX_PHASE; }
664
- break;
665
- case 26:
666
- #line 130 "c/notation.rl"
667
- { fxcmd = BLOOPS_FX_PSWEEP; }
668
- break;
669
- case 27:
670
- #line 131 "c/notation.rl"
671
- { fxcmd = BLOOPS_FX_REPEAT; }
672
- break;
673
- case 28:
674
- #line 134 "c/notation.rl"
291
+ #line 91 "c/notation.rl"
675
292
  { len = 1; }
676
293
  break;
677
- case 29:
678
- #line 135 "c/notation.rl"
294
+ case 4:
295
+ #line 92 "c/notation.rl"
679
296
  { len = 1; }
680
297
  break;
681
- case 30:
682
- #line 136 "c/notation.rl"
298
+ case 5:
299
+ #line 93 "c/notation.rl"
683
300
  { mod = p[-1]; }
684
301
  break;
685
- case 31:
686
- #line 138 "c/notation.rl"
687
- { fxmod = p[-1]; }
688
- break;
689
- case 32:
690
- #line 140 "c/notation.rl"
302
+ case 6:
303
+ #line 95 "c/notation.rl"
691
304
  { tone = p[-1]; }
692
305
  break;
693
- case 35:
694
- #line 1 "c/notation.rl"
695
- {te = p+1;}
696
- break;
697
- case 36:
698
- #line 150 "c/notation.rl"
306
+ case 9:
307
+ #line 105 "c/notation.rl"
699
308
  {te = p+1;}
700
309
  break;
701
- case 37:
702
- #line 143 "c/notation.rl"
310
+ case 10:
311
+ #line 98 "c/notation.rl"
703
312
  {te = p;p--;{
704
313
  NOTE.tone = 0;
705
314
  NEXT();
706
315
  }}
707
316
  break;
708
- case 38:
709
- #line 147 "c/notation.rl"
317
+ case 11:
318
+ #line 102 "c/notation.rl"
710
319
  {te = p;p--;{ NEXT(); }}
711
320
  break;
712
- case 39:
713
- #line 148 "c/notation.rl"
321
+ case 12:
322
+ #line 103 "c/notation.rl"
714
323
  {te = p;p--;{ oct++; len = 4; }}
715
324
  break;
716
- case 40:
717
- #line 149 "c/notation.rl"
325
+ case 13:
326
+ #line 104 "c/notation.rl"
718
327
  {te = p;p--;{ oct--; len = 4; }}
719
328
  break;
720
- case 41:
721
- #line 147 "c/notation.rl"
722
- {{p = ((te))-1;}{ NEXT(); }}
723
- break;
724
- #line 725 "c/notation.c"
329
+ #line 330 "c/notation.c"
725
330
  }
726
331
  }
727
332
 
@@ -730,11 +335,11 @@ _again:
730
335
  _nacts = (unsigned int) *_acts++;
731
336
  while ( _nacts-- > 0 ) {
732
337
  switch ( *_acts++ ) {
733
- case 33:
338
+ case 7:
734
339
  #line 1 "c/notation.rl"
735
340
  {ts = 0;}
736
341
  break;
737
- #line 738 "c/notation.c"
342
+ #line 343 "c/notation.c"
738
343
  }
739
344
  }
740
345
 
@@ -753,11 +358,7 @@ _again:
753
358
 
754
359
  _out: {}
755
360
  }
756
- #line 177 "c/notation.rl"
757
-
758
- memcpy(&S->params, &P->params, sizeof(bloopsaparams));
759
-
760
- _bloops_track_add(B, S);
361
+ #line 128 "c/notation.rl"
761
362
 
762
363
  return S;
763
364
  }
@@ -771,22 +372,11 @@ bloops_track2(bloops *B, bloopsaphone *P, char *track)
771
372
  char *
772
373
  bloops_track_str(bloopsatrack *track)
773
374
  {
774
- int bufsize = sizeof(char) * (track->nlen * 6 + 1024);
775
- char *str = (char *)malloc(bufsize), *ptr = str;
776
- int i, adv = 0;
375
+ char *str = (char *)malloc(sizeof(char) * track->nlen * 6), *ptr = str;
376
+ int i, adv;
777
377
 
778
378
  for (i = 0; i < track->nlen; i++)
779
379
  {
780
- if (ptr - str + adv + sizeof(char) * 256 > bufsize) {
781
- char *new_str;
782
- bufsize += sizeof(char) * 1024;
783
- new_str = realloc(str, bufsize);
784
- if (new_str == NULL) {
785
- free(str);
786
- return NULL;
787
- }
788
- }
789
-
790
380
  if (ptr > str)
791
381
  strcat(ptr++, " ");
792
382
 
@@ -812,49 +402,12 @@ bloops_track_str(bloopsatrack *track)
812
402
 
813
403
  adv = sprintf(ptr, "%d", (int)track->notes[i].octave);
814
404
  ptr += adv;
815
- bloopsafx *fx = (bloopsafx *)track->notes[i].FX;
816
- while (fx) {
817
- if (fx->mod == 0)
818
- adv = sprintf(ptr, "[%s %0.3f]", bloops_fxcmd_name(fx->cmd), fx->val);
819
- else
820
- adv = sprintf(ptr, "[%s %c %0.3f]", bloops_fxcmd_name(fx->cmd), fx->mod, fx->val);
821
- ptr += adv;
822
- fx = (bloopsafx *)fx->next;
823
- }
824
405
  }
825
406
  }
826
407
 
827
408
  return str;
828
409
  }
829
410
 
830
- char *
831
- bloops_fxcmd_name(bloopsafxcmd fxcmd) {
832
- char *fxname = "\0";
833
- switch (fxcmd) {
834
- case BLOOPS_FX_VOLUME: fxname = "volume"; break;
835
- case BLOOPS_FX_PUNCH: fxname = "punch"; break;
836
- case BLOOPS_FX_ATTACK: fxname = "attack"; break;
837
- case BLOOPS_FX_SUSTAIN: fxname = "sustain"; break;
838
- case BLOOPS_FX_DECAY: fxname = "decay"; break;
839
- case BLOOPS_FX_SQUARE: fxname = "square"; break;
840
- case BLOOPS_FX_SWEEP: fxname = "sweep"; break;
841
- case BLOOPS_FX_VIBE: fxname = "vibe"; break;
842
- case BLOOPS_FX_VSPEED: fxname = "vspeed"; break;
843
- case BLOOPS_FX_VDELAY: fxname = "vdelay"; break;
844
- case BLOOPS_FX_LPF: fxname = "lpf"; break;
845
- case BLOOPS_FX_LSWEEP: fxname = "lsweep"; break;
846
- case BLOOPS_FX_RESONANCE: fxname = "resonance"; break;
847
- case BLOOPS_FX_HPF: fxname = "hpf"; break;
848
- case BLOOPS_FX_HSWEEP: fxname = "hsweep"; break;
849
- case BLOOPS_FX_ARP: fxname = "arp"; break;
850
- case BLOOPS_FX_ASPEED: fxname = "aspeed"; break;
851
- case BLOOPS_FX_PHASE: fxname = "phase"; break;
852
- case BLOOPS_FX_PSWEEP: fxname = "psweep"; break;
853
- case BLOOPS_FX_REPEAT: fxname = "repeat"; break;
854
- }
855
- return fxname;
856
- }
857
-
858
411
  float
859
412
  bloops_note_freq(char note, int octave)
860
413
  {
@@ -968,10 +521,10 @@ bloops_note_freq(char note, int octave)
968
521
  return 0.0;
969
522
  }
970
523
 
971
- #define KEY(name) key = (void *)&P->params.name
524
+ #define KEY(name) key = (void *)&P->name
972
525
 
973
526
 
974
- #line 975 "c/notation.c"
527
+ #line 528 "c/notation.c"
975
528
  static const char _bloopserial_actions[] = {
976
529
  0, 1, 0, 1, 1, 1, 2, 1,
977
530
  5, 1, 6, 1, 7, 1, 8, 1,
@@ -1278,7 +831,7 @@ static const int bloopserial_error = 0;
1278
831
 
1279
832
  static const int bloopserial_en_main = 142;
1280
833
 
1281
- #line 446 "c/notation.rl"
834
+ #line 345 "c/notation.rl"
1282
835
 
1283
836
 
1284
837
  bloopsaphone *
@@ -1310,16 +863,16 @@ bloops_sound_file(bloops *B, char *fname)
1310
863
 
1311
864
  P = bloops_square();
1312
865
 
1313
- #line 1314 "c/notation.c"
866
+ #line 867 "c/notation.c"
1314
867
  {
1315
868
  cs = bloopserial_start;
1316
869
  ts = 0;
1317
870
  te = 0;
1318
871
  act = 0;
1319
872
  }
1320
- #line 477 "c/notation.rl"
873
+ #line 376 "c/notation.rl"
1321
874
 
1322
- #line 1323 "c/notation.c"
875
+ #line 876 "c/notation.c"
1323
876
  {
1324
877
  int _klen;
1325
878
  unsigned int _trans;
@@ -1340,7 +893,7 @@ _resume:
1340
893
  #line 1 "c/notation.rl"
1341
894
  {ts = p;}
1342
895
  break;
1343
- #line 1344 "c/notation.c"
896
+ #line 897 "c/notation.c"
1344
897
  }
1345
898
  }
1346
899
 
@@ -1406,150 +959,150 @@ _eof_trans:
1406
959
  switch ( *_acts++ )
1407
960
  {
1408
961
  case 0:
1409
- #line 400 "c/notation.rl"
962
+ #line 299 "c/notation.rl"
1410
963
  {
1411
964
  fval = ATOI(ts, p - ts) * 1.0f;
1412
965
  }
1413
966
  break;
1414
967
  case 1:
1415
- #line 404 "c/notation.rl"
968
+ #line 303 "c/notation.rl"
1416
969
  {
1417
970
  fval = ATOI(pf, p - pf) * pow(0.1f, p - pf);
1418
971
  }
1419
972
  break;
1420
973
  case 2:
1421
- #line 408 "c/notation.rl"
974
+ #line 307 "c/notation.rl"
1422
975
  { pf = p; }
1423
976
  break;
1424
977
  case 3:
1425
- #line 409 "c/notation.rl"
978
+ #line 308 "c/notation.rl"
1426
979
  { fval *= -1.0f; }
1427
980
  break;
1428
981
  case 4:
1429
- #line 410 "c/notation.rl"
982
+ #line 309 "c/notation.rl"
1430
983
  { KEY(volume); }
1431
984
  break;
1432
985
  case 5:
1433
- #line 411 "c/notation.rl"
986
+ #line 310 "c/notation.rl"
1434
987
  { KEY(arp); }
1435
988
  break;
1436
989
  case 6:
1437
- #line 412 "c/notation.rl"
990
+ #line 311 "c/notation.rl"
1438
991
  { KEY(aspeed); }
1439
992
  break;
1440
993
  case 7:
1441
- #line 413 "c/notation.rl"
994
+ #line 312 "c/notation.rl"
1442
995
  { KEY(attack); }
1443
996
  break;
1444
997
  case 8:
1445
- #line 414 "c/notation.rl"
998
+ #line 313 "c/notation.rl"
1446
999
  { KEY(decay); }
1447
1000
  break;
1448
1001
  case 9:
1449
- #line 415 "c/notation.rl"
1002
+ #line 314 "c/notation.rl"
1450
1003
  { KEY(dslide); }
1451
1004
  break;
1452
1005
  case 10:
1453
- #line 416 "c/notation.rl"
1006
+ #line 315 "c/notation.rl"
1454
1007
  { KEY(freq); }
1455
1008
  break;
1456
1009
  case 11:
1457
- #line 417 "c/notation.rl"
1010
+ #line 316 "c/notation.rl"
1458
1011
  { KEY(hpf); }
1459
1012
  break;
1460
1013
  case 12:
1461
- #line 418 "c/notation.rl"
1014
+ #line 317 "c/notation.rl"
1462
1015
  { KEY(hsweep); }
1463
1016
  break;
1464
1017
  case 13:
1465
- #line 419 "c/notation.rl"
1018
+ #line 318 "c/notation.rl"
1466
1019
  { KEY(limit); }
1467
1020
  break;
1468
1021
  case 14:
1469
- #line 420 "c/notation.rl"
1022
+ #line 319 "c/notation.rl"
1470
1023
  { KEY(lpf); }
1471
1024
  break;
1472
1025
  case 15:
1473
- #line 421 "c/notation.rl"
1026
+ #line 320 "c/notation.rl"
1474
1027
  { KEY(lsweep); }
1475
1028
  break;
1476
1029
  case 16:
1477
- #line 422 "c/notation.rl"
1030
+ #line 321 "c/notation.rl"
1478
1031
  { KEY(phase); }
1479
1032
  break;
1480
1033
  case 17:
1481
- #line 423 "c/notation.rl"
1034
+ #line 322 "c/notation.rl"
1482
1035
  { KEY(psweep); }
1483
1036
  break;
1484
1037
  case 18:
1485
- #line 424 "c/notation.rl"
1038
+ #line 323 "c/notation.rl"
1486
1039
  { KEY(repeat); }
1487
1040
  break;
1488
1041
  case 19:
1489
- #line 425 "c/notation.rl"
1042
+ #line 324 "c/notation.rl"
1490
1043
  { KEY(resonance); }
1491
1044
  break;
1492
1045
  case 20:
1493
- #line 426 "c/notation.rl"
1046
+ #line 325 "c/notation.rl"
1494
1047
  { KEY(slide); }
1495
1048
  break;
1496
1049
  case 21:
1497
- #line 427 "c/notation.rl"
1050
+ #line 326 "c/notation.rl"
1498
1051
  { KEY(square); }
1499
1052
  break;
1500
1053
  case 22:
1501
- #line 428 "c/notation.rl"
1054
+ #line 327 "c/notation.rl"
1502
1055
  { KEY(sustain); }
1503
1056
  break;
1504
1057
  case 23:
1505
- #line 429 "c/notation.rl"
1058
+ #line 328 "c/notation.rl"
1506
1059
  { KEY(sweep); }
1507
1060
  break;
1508
1061
  case 24:
1509
- #line 430 "c/notation.rl"
1062
+ #line 329 "c/notation.rl"
1510
1063
  { KEY(punch); }
1511
1064
  break;
1512
1065
  case 25:
1513
- #line 431 "c/notation.rl"
1066
+ #line 330 "c/notation.rl"
1514
1067
  { KEY(vibe); }
1515
1068
  break;
1516
1069
  case 26:
1517
- #line 432 "c/notation.rl"
1070
+ #line 331 "c/notation.rl"
1518
1071
  { KEY(vspeed); }
1519
1072
  break;
1520
1073
  case 27:
1521
- #line 433 "c/notation.rl"
1074
+ #line 332 "c/notation.rl"
1522
1075
  { KEY(vdelay); }
1523
1076
  break;
1524
1077
  case 28:
1525
- #line 434 "c/notation.rl"
1078
+ #line 333 "c/notation.rl"
1526
1079
  { KEY(volume); }
1527
1080
  break;
1528
1081
  case 31:
1529
- #line 438 "c/notation.rl"
1530
- {te = p+1;{ P->params.type = BLOOPS_SQUARE; }}
1082
+ #line 337 "c/notation.rl"
1083
+ {te = p+1;{ P->type = BLOOPS_SQUARE; }}
1531
1084
  break;
1532
1085
  case 32:
1533
- #line 439 "c/notation.rl"
1534
- {te = p+1;{ P->params.type = BLOOPS_SAWTOOTH; }}
1086
+ #line 338 "c/notation.rl"
1087
+ {te = p+1;{ P->type = BLOOPS_SAWTOOTH; }}
1535
1088
  break;
1536
1089
  case 33:
1537
- #line 440 "c/notation.rl"
1538
- {te = p+1;{ P->params.type = BLOOPS_SINE; }}
1090
+ #line 339 "c/notation.rl"
1091
+ {te = p+1;{ P->type = BLOOPS_SINE; }}
1539
1092
  break;
1540
1093
  case 34:
1541
- #line 441 "c/notation.rl"
1542
- {te = p+1;{ P->params.type = BLOOPS_NOISE; }}
1094
+ #line 340 "c/notation.rl"
1095
+ {te = p+1;{ P->type = BLOOPS_NOISE; }}
1543
1096
  break;
1544
1097
  case 35:
1545
- #line 437 "c/notation.rl"
1098
+ #line 336 "c/notation.rl"
1546
1099
  {te = p;p--;{ *((float *)key) = fval; }}
1547
1100
  break;
1548
1101
  case 36:
1549
- #line 442 "c/notation.rl"
1102
+ #line 341 "c/notation.rl"
1550
1103
  {te = p;p--;}
1551
1104
  break;
1552
- #line 1553 "c/notation.c"
1105
+ #line 1106 "c/notation.c"
1553
1106
  }
1554
1107
  }
1555
1108
 
@@ -1562,7 +1115,7 @@ _again:
1562
1115
  #line 1 "c/notation.rl"
1563
1116
  {ts = 0;}
1564
1117
  break;
1565
- #line 1566 "c/notation.c"
1118
+ #line 1119 "c/notation.c"
1566
1119
  }
1567
1120
  }
1568
1121
 
@@ -1581,7 +1134,7 @@ _again:
1581
1134
 
1582
1135
  _out: {}
1583
1136
  }
1584
- #line 478 "c/notation.rl"
1137
+ #line 377 "c/notation.rl"
1585
1138
 
1586
1139
  done:
1587
1140
  fclose(fp);
@@ -1589,68 +1142,68 @@ done:
1589
1142
  }
1590
1143
 
1591
1144
  char *
1592
- bloops_sound_str(bloopsaphone *P)
1145
+ bloops_sound_str(bloops *B, bloopsaphone *P)
1593
1146
  {
1594
1147
  char *lines = (char *)malloc(4096), *str = lines;
1595
1148
  bloopsaphone *sq = bloops_square();
1596
- if (P->params.type == BLOOPS_SQUARE)
1149
+ if (P->type == BLOOPS_SQUARE)
1597
1150
  str += sprintf(str, "type square\n");
1598
- else if (P->params.type == BLOOPS_SAWTOOTH)
1151
+ else if (P->type == BLOOPS_SAWTOOTH)
1599
1152
  str += sprintf(str, "type sawtooth\n");
1600
- else if (P->params.type == BLOOPS_SINE)
1153
+ else if (P->type == BLOOPS_SINE)
1601
1154
  str += sprintf(str, "type sine\n");
1602
- else if (P->params.type == BLOOPS_NOISE)
1155
+ else if (P->type == BLOOPS_NOISE)
1603
1156
  str += sprintf(str, "type noise\n");
1604
1157
 
1605
- if (P->params.volume != sq->params.volume)
1606
- str += sprintf(str, "volume %0.3f\n", P->params.volume);
1607
- if (P->params.punch != sq->params.punch)
1608
- str += sprintf(str, "punch %0.3f\n", P->params.punch);
1609
- if (P->params.attack != sq->params.attack)
1610
- str += sprintf(str, "attack %0.3f\n", P->params.attack);
1611
- if (P->params.sustain != sq->params.sustain)
1612
- str += sprintf(str, "sustain %0.3f\n", P->params.sustain);
1613
- if (P->params.decay != sq->params.decay)
1614
- str += sprintf(str, "decay %0.3f\n", P->params.decay);
1615
- if (P->params.freq != sq->params.freq)
1616
- str += sprintf(str, "freq %0.3f\n", P->params.freq);
1617
- if (P->params.limit != sq->params.limit)
1618
- str += sprintf(str, "limit %0.3f\n", P->params.limit);
1619
- if (P->params.slide != sq->params.slide)
1620
- str += sprintf(str, "slide %0.3f\n", P->params.slide);
1621
- if (P->params.dslide != sq->params.dslide)
1622
- str += sprintf(str, "dslide %0.3f\n", P->params.dslide);
1623
- if (P->params.square != sq->params.square)
1624
- str += sprintf(str, "square %0.3f\n", P->params.square);
1625
- if (P->params.sweep != sq->params.sweep)
1626
- str += sprintf(str, "sweep %0.3f\n", P->params.sweep);
1627
- if (P->params.vibe != sq->params.vibe)
1628
- str += sprintf(str, "vibe %0.3f\n", P->params.vibe);
1629
- if (P->params.vspeed != sq->params.vspeed)
1630
- str += sprintf(str, "vspeed %0.3f\n", P->params.vspeed);
1631
- if (P->params.vdelay != sq->params.vdelay)
1632
- str += sprintf(str, "vdelay %0.3f\n", P->params.vdelay);
1633
- if (P->params.lpf != sq->params.lpf)
1634
- str += sprintf(str, "lpf %0.3f\n", P->params.lpf);
1635
- if (P->params.lsweep != sq->params.lsweep)
1636
- str += sprintf(str, "lsweep %0.3f\n", P->params.lsweep);
1637
- if (P->params.resonance != sq->params.resonance)
1638
- str += sprintf(str, "resonance %0.3f\n", P->params.resonance);
1639
- if (P->params.hpf != sq->params.hpf)
1640
- str += sprintf(str, "hpf %0.3f\n", P->params.hpf);
1641
- if (P->params.hsweep != sq->params.hsweep)
1642
- str += sprintf(str, "hsweep %0.3f\n", P->params.hsweep);
1643
- if (P->params.arp != sq->params.arp)
1644
- str += sprintf(str, "arp %0.3f\n", P->params.arp);
1645
- if (P->params.aspeed != sq->params.aspeed)
1646
- str += sprintf(str, "aspeed %0.3f\n", P->params.aspeed);
1647
- if (P->params.phase != sq->params.phase)
1648
- str += sprintf(str, "phase %0.3f\n", P->params.phase);
1649
- if (P->params.psweep != sq->params.psweep)
1650
- str += sprintf(str, "psweep %0.3f\n", P->params.psweep);
1651
- if (P->params.repeat != sq->params.repeat)
1652
- str += sprintf(str, "repeat %0.3f\n", P->params.repeat);
1653
-
1654
- bloops_sound_destroy(sq);
1158
+ if (P->volume != sq->volume)
1159
+ str += sprintf(str, "volume %0.3f\n", P->volume);
1160
+ if (P->punch != sq->punch)
1161
+ str += sprintf(str, "punch %0.3f\n", P->punch);
1162
+ if (P->attack != sq->attack)
1163
+ str += sprintf(str, "attack %0.3f\n", P->attack);
1164
+ if (P->sustain != sq->sustain)
1165
+ str += sprintf(str, "sustain %0.3f\n", P->sustain);
1166
+ if (P->decay != sq->decay)
1167
+ str += sprintf(str, "decay %0.3f\n", P->decay);
1168
+ if (P->freq != sq->freq)
1169
+ str += sprintf(str, "freq %0.3f\n", P->freq);
1170
+ if (P->limit != sq->limit)
1171
+ str += sprintf(str, "limit %0.3f\n", P->limit);
1172
+ if (P->slide != sq->slide)
1173
+ str += sprintf(str, "slide %0.3f\n", P->slide);
1174
+ if (P->dslide != sq->dslide)
1175
+ str += sprintf(str, "dslide %0.3f\n", P->dslide);
1176
+ if (P->square != sq->square)
1177
+ str += sprintf(str, "square %0.3f\n", P->square);
1178
+ if (P->sweep != sq->sweep)
1179
+ str += sprintf(str, "sweep %0.3f\n", P->sweep);
1180
+ if (P->vibe != sq->vibe)
1181
+ str += sprintf(str, "vibe %0.3f\n", P->vibe);
1182
+ if (P->vspeed != sq->vspeed)
1183
+ str += sprintf(str, "vspeed %0.3f\n", P->vspeed);
1184
+ if (P->vdelay != sq->vdelay)
1185
+ str += sprintf(str, "vdelay %0.3f\n", P->vdelay);
1186
+ if (P->lpf != sq->lpf)
1187
+ str += sprintf(str, "lpf %0.3f\n", P->lpf);
1188
+ if (P->lsweep != sq->lsweep)
1189
+ str += sprintf(str, "lsweep %0.3f\n", P->lsweep);
1190
+ if (P->resonance != sq->resonance)
1191
+ str += sprintf(str, "resonance %0.3f\n", P->resonance);
1192
+ if (P->hpf != sq->hpf)
1193
+ str += sprintf(str, "hpf %0.3f\n", P->hpf);
1194
+ if (P->hsweep != sq->hsweep)
1195
+ str += sprintf(str, "hsweep %0.3f\n", P->hsweep);
1196
+ if (P->arp != sq->arp)
1197
+ str += sprintf(str, "arp %0.3f\n", P->arp);
1198
+ if (P->aspeed != sq->aspeed)
1199
+ str += sprintf(str, "aspeed %0.3f\n", P->aspeed);
1200
+ if (P->phase != sq->phase)
1201
+ str += sprintf(str, "phase %0.3f\n", P->phase);
1202
+ if (P->psweep != sq->psweep)
1203
+ str += sprintf(str, "psweep %0.3f\n", P->psweep);
1204
+ if (P->repeat != sq->repeat)
1205
+ str += sprintf(str, "repeat %0.3f\n", P->repeat);
1206
+
1207
+ free(sq);
1655
1208
  return lines;
1656
1209
  }