-
Notifications
You must be signed in to change notification settings - Fork 2
/
13-tb-303.Rmd
449 lines (379 loc) · 52.5 KB
/
13-tb-303.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# (PART) Sound Design 2 {-}
# TB-303
This chapter examines a new sound design problem using the problem solving approach introduced in Chapter \@ref(designing-a-kick-drum).
The problem is to make a lead by recreating the fundamental characteristics of the Roland TB-303, an iconic instrument in acid house and subsequent genres of electronic music.
Thus the problem is not only about recreating a particular sound but also involves emulating the key features of the instrument in order to produce the sound.
## History
The [TB-303](https://en.wikipedia.org/wiki/Roland_TB-303) (hereafter 303; see Figure \@ref(fig:303)), was released in 1981 and withdrawn in 1984 as a commercial failure.
The original purpose of the 303 was to replace a bass guitar in much the same way a drum machine like the [TR-808](https://en.wikipedia.org/wiki/Roland_TR-808) was meant to replace drums.
The 303 was widely considered as difficult to use, which together with a $1300 price tag^[In 2022 dollars.], likely led to its demise.
(ref:303) A Roland TB-303. Image [public domain](https://commons.wikimedia.org/wiki/File:Roland_TB-303_Panel.jpg).
```{r 303, echo=F, out.width="100%", fig.cap="(ref:303)"}
knitr::include_graphics("images/Roland_TB-303_Panel-wp-cc0.jpg")
```
The 303's failure in the marketplace, however, meant that it was cheaply available in the secondhand market.
Dance music artists, most notably in Chicago, began incorporating the 303 into their performances, and the 303 became a signature sound of [acid house](https://en.wikipedia.org/wiki/Acid_house).
While the 303 was designed for bass guitar sounds, which are a common element of [disco](https://en.wikipedia.org/wiki/Disco) dance music, the 303 could also easily (and perhaps more easily) produce sounds that are nothing like a bass guitar or any other instrument from that time.^[Squelch, chirp, and scream are common descriptors of the 303 sound.]
The way the 303 was used in acid house may be due to its extremely limited sequencer.
The 303 sequencer stored pitch and time information separately, and each of these were entered using separate modes.
As a result, it was not possible to edit the complete sequence in real time, i.e. during performance.^[It is possible to [live-play](https://tinyloops.com/tb303/quick_results.html#02) the 303 and [switch between tracks](https://tinyloops.com/tb303/quick_results.html#07), but this is not the same as editing a running sequence.]
However, it was very easy to change the timbre of an existing sequence using various parameter knobs (mostly across the top in Figure \@ref(fig:303)).
The combined difficulty of sequencing and the ease of using parameter knobs to sculpt timbres led early acid house pioneers to focus on the later.^[https://www.dwrl.utexas.edu/2016/11/22/rhetorical-synthesis-the-story-of-the-roland-tb-303/]
Thus repeating sequences with shifting timbres became a defining feature of acid house, as shown by the early example in Figure \@ref(fig:acid-tracks).
(ref:acid-tracks) [*Acid Tracks*](https://en.wikipedia.org/wiki/Acid_Tracks) by [Phuture](https://en.wikipedia.org/wiki/Phuture). *Acid Tracks* helped define the sound of acid house.
```{r, acid-tracks, out.width='100%', fig.cap="(ref:acid-tracks)", dev='png', cache=TRUE, screenshot.opts=list(vwidth=400,cliprect = c(0, 0, 400, 300)), echo=F}
# embed_youtube("igNBeo3QSqc",75) #copyright restriction on embedding
knitr::include_url("https://olney.ai/ct-modular-book/images/acid-tracks.html", height = "60px")
```
## Problem solving approach
The problem solving stages elaborated for sound design in Chapter \@ref(designing-a-kick-drum) mostly apply to emulating a 303 but with some slight variation given the goal of creating a specific sound by emulating the key features of a 303.
Recall the problem solving stages are:
- Understand the problem
- Make a plan
- Implement the plan
- Evaluate the solution
For the understanding the problem stage, we need to know the defining characteristics of the 303 and what makes it special.
According to Robin Whittle, developer of the Devil Fish 303 mod, the most important aspects of the 303 sound are its sequencer, filter, filter envelope, and the oscillator to a minor extent.^[Most information is on Robin's [main website](https://www.firstpr.com.au/rwi/dfish/index.html) including the Devil Fish manual. Additional information is on the [Analogue Heaven mailing list](http://www.retrosynth.com/ah/).]
For the making a plan stage, Whittle's observations suggest a plan based around decomposition, namely that the 303 can be considered as a collection of modules.
Any 303 function that is generic can be satisfied with generic modules, while the functions contributing to the 303's distinctive sound can be addressed independently as subproblems.
Figure \@ref(fig:tb303-annotated) shows how the 303 interface is loosely organized around modular concepts like oscillators, filters, and envelopes, further supporting an overall decomposition strategy for emulating a 303 in modular.
(ref:tb303-annotated) A Roland TB-303 annotated to group interface elements according to modular concepts. Note the accent knob affects both filter and volume envelopes.
```{r tb303-annotated, echo=F, out.width="100%", fig.cap="(ref:tb303-annotated)"}
knitr::include_graphics("images/tb303-annotated.jpg")
```
For the implementing a plan stage, we need evaluation criteria in order to assess alternate solutions and gauge our progress.
A simple and straightforward evaluation criterion is to use a well-known song with a 303 line.
Ideally, the 303 line should be easy to sequence and easy to listen to repeatedly throughout our design process.
*Da Funk* by Daft Punk seems suitable for this purpose ([listen here](https://youtu.be/PwILkY9gRrc?t=145)).
Another source of evaluation material has been provided by Din Sync, whose [reference recordings of a 303](http://www.dinsync.info/2010/02/tb-303-reference-recordings-for-x0xb0x.html) systematically map the sound of a C note across 303 knob positions.
The Din Sync materials are useful for isolating parameters of the 303 as an instrument, which is very difficult to do from a live performance.
A 1-10 scale for both criteria seem appropriate at first glance.
Using these materials, we can address the subproblems of sequencing, oscillators, filter, and envelopes independently using the same four problem solving stages.
The evaluation stage, which we will cycle through iteratively, will use the *Da Funk* evaluation to determine overall success.
If we were trying to recreate the 303 in a broad sense, then additional evaluation materials would be necessary, but for the purposes of this chapter, this should be sufficient.
## Sequencing
Let's begin with understanding the sequencing problem.
The 303 has a maximum pattern length of 16 steps.
Because reducing the pattern length is somewhat tedious, many 303 patterns are 16 steps.
By default, the steps are staccato 16th notes in 4/4 time.^[The 303 also has a triplet mode, but that is not generally considered a signature component of the sound.]
As previously stated, the 303 sequencer has a timing mode and a pitch mode.
In timing mode, each step is identified as beginning a new note, beginning a rest, or continuing the previous step (which may be a note or a rest).
In pitch mode, each note is identified, whether it is transposed up/down an octave, whether is has an accent, and whether it has a slide.
For now, think of the accent as producing a slightly louder note, and a slide as a glide in pitch from one note to the next.
According to Whittle, the accent and slide are the two components of the sequencer that are the most important to the overall sound of a 303.
Figure \@ref(fig:tb303-slide)^[Adapted from https://www.firstpr.com.au/rwi/dfish/303-slide.html.] shows an example 303 clock and gate pattern modified by a slide.
Each step in the example has a different note and is represented by a clock color.
Gates for a single 16th note extend less than a full step's worth of clock pulses, specifically three pulses and the positive portion of the fourth pulse.
Short gates relative to steps give the 303 its staccato note feel.
Extended gates, in contrast to regular gates, extend through the step on which they are placed and into the next step.
In the example's second row, a slide has been placed on the red note, causing its gate to extend through the blue note's gate.
Regular gates and extended gates control the envelopes for the filter and volume.
In addition to these gates, slide gates control the portamento from one note to the next.
In the example's third row, the red note begins its slide into the blue note when the blue note starts, and the slide circuit stays on until the purple note.
Accents (not shown) are in time with the gates and further affect the filter and volume envelopes.
(ref:tb303-slide) Clock, gate, and slide behavior of a 303 for four notes across four steps, indicated by different colors on the clock pulses. Note the gates are shorter than a step, gates can be extended across steps, and slide gates extend across an entire step.
```{r tb303-slide, echo=F, out.width="80%", fig.cap="(ref:tb303-slide)"}
knitr::include_graphics("images/303-slide.PNG")
```
Based on the above description, any solution to the 303 sequencer problem will need to somehow represent the following:
- Notes and rests
- Gates spanning steps in response to slides and extended steps
- Gates to control slide
- Presence of accents
To make a plan, let's consider some of our previous sequencing approaches from Chapter \@ref(complex-controllers).
First, clocks alone are clearly insufficient because sometimes we need rests.
We could accomplish rests using clock divisions and logic, but the variable length of notes and rests in the 303 would seem to make that approach very complicated, even if it is possible.
The two remaining obvious choices are modifying gates and using an LFO as a speed variable clock.
In the modifying gates approach, we could trigger gates on steps with notes and arbitrarily extend gate lengths for continued notes/slides and rests.
In the LFO clock approach, an LFO would be synced by a clock, and we'd increase/decrease the speed of the clock to change gate duration.
Comparing these two approaches with the sequencing needs of the 303, it seems that the speed variable clock has capabilities that aren't needed here, like adding multiple beats, e.g. subdividing 1/16th notes.
For the goal of emulating 303 sequencing, the modifying gates approach seems like it will accomplish the goals of variable length gates and rests with a minimum of complexity.
Returning to the list of sequencing elements we need to represent, most of the elements have an on/off flavor except for pitches: note/rest, accents, slides, and extended gates are either present or not.
This presence/absence flavor suggests that these elements are best represented using trigger sequencers that represent presence/absence of something at each step.
Because the 303 forces 16th notes in 16 steps as the minimal resolution, we are not sacrificing flexibility by using trigger sequencers in this case.
Altogether, this suggests one control voltage sequencer for pitch and four trigger sequencers for note/rest, accents, slides, and extended gate.
The pitch sequencing in this approach is handling three functions on the 303: defining a note, up transpositions, and down transpositions.
Try patching up *Da Funk* using a 16 step control voltage sequencer with some other placeholder modules to generate sound using the button in Figure \@ref(fig:tb303-seq).
The notation for the sequence is provided in the patch instructions.
(ref:tb303-seq) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=empty.vcv&solution=%3cimg+class%3d%27rack-image%27+src%3d%27images%2fpatch-solutions%2ftb303-seq.png%27%3e&instructions=%3cul%3e%0a%3cli%3eAdd+BPM+Clock%2c+ADDR-SEQ%2c+ASX+immediately+to+the+right+of+ADDR-SEQ%2c+four+TRG%2c+JW+Quantizer%2c+Four-View%2c+VCO%2c+SuperDrive%2c+and+Host+Audio%3c%2fli%3e%0a%3cli%3eConnect+the+Clock+reset+out+to+each+of+the+sequencers.+In+general%2c+you+will+need+to+hit+reset+on+every+patch+that+loads+because+they+will+not+load+in+sync+by+default%3c%2fli%3e%0a%3cli%3eConnect+Clock+16ths+out+to+each+of+the+sequencers%3c%2fli%3e%0a%3cli%3eConnect+ADDR-SEQ+out+to+the+V%2fOct+in+of+the+Quantizer%3c%2fli%3e%0a%3cli%3eConnect+the+Quantizer+out+to+the+first+input+of+the+Four-View+and+the+VCO+V%2fOct+in.+The+Four-View+will+show+the+note+corresponding+to+the+voltage+received+from+the+Quantizer%3c%2fli%3e%0a%3cli%3eConnect+the+VCO+saw+to+the+SuperDrive+in.+The+SuperDrive+is+a+distortion+module+that+technically+isn%27t+part+of+the+303%2c+but+was+a+common+effect+applied+to+303+sounds+%28including+in+Da+Funk%29.+The+bypass+button+allows+the+dry+sound+to+pass+through%2c+which+is+convenient+in+testing%3c%2fli%3e%0a%3cli%3eConnect+the+SuperDrive+out+to+the+Host+Audio+L+%3c%2fli%3e%0a%3cli%3eProgram+the+sequencers+as+specified+below%3cul%3e%0a%3cli%3eSet+the+Quantizer+to+G+Locrian+with+Octave+shift+-2.+%3c%2fli%3e%0a%3cli%3eDial+in+each+note+of+ADDR-SEQ%2c+noting+that+ASX+adds+notes+9-16.+The+first+note+should+be+G2.+The+down+notes+are+X1+and+the+up+notes+are+X3%3c%2fli%3e%0a%3cli%3eEnter+the+steps+for+each+trigger+sequencer.+The+order+of+sequencers+is+PRASE%3a+pitch%2c+rest%2c+accent%2c+slide%2c+extend.+Each+TRG+should+have+16+steps.+All+steps+for+the+rest+TRG+should+be+active+%28rests+are+empty%29.+For+Da+Funk%2c+all+steps+for+extend+should+be+empty%3c%2fli%3e%0a%3cli%3eListen+to+the+song+periodically+as+you+enter+steps.+This+should+help+you+catch+mistakes%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a%3cdiv+class%3d%27d-flex+flex-row+justify-content-around%27%3e%0a%3cimg+class%3d%27instruction-wide-image%27+src%3d%27images%2f303-da-funk-pattern.png%27%3e%0a%3c%2fdiv%3e%0a%3cdiv+class%3d%27d-flex+flex-row+justify-content-around%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2fasx-solo.png%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2ffourview-solo.png%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2fsuperdrive-solo.png%27%3e%0a%3c%2fdiv%3e%0a) for a 303-style sequencer.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("tb303-seq", starter_file="empty.vcv", instructions_html="<ul>
<li>Add BPM Clock, ADDR-SEQ, ASX immediately to the right of ADDR-SEQ, four TRG, JW Quantizer, Four-View, VCO, SuperDrive, and Host Audio</li>
<li>Connect the Clock reset out to each of the sequencers. In general, you will need to hit reset on every patch that loads because they will not load in sync by default</li>
<li>Connect Clock 16ths out to each of the sequencers</li>
<li>Connect ADDR-SEQ out to the V/Oct in of the Quantizer</li>
<li>Connect the Quantizer out to the first input of the Four-View and the VCO V/Oct in. The Four-View will show the note corresponding to the voltage received from the Quantizer</li>
<li>Connect the VCO saw to the SuperDrive in. The SuperDrive is a distortion module that technically isn't part of the 303, but was a common effect applied to 303 sounds (including in Da Funk). The bypass button allows the dry sound to pass through, which is convenient in testing</li>
<li>Connect the SuperDrive out to the Host Audio L </li>
<li>Program the sequencers as specified below<ul>
<li>Set the Quantizer to G Locrian with Octave shift -2. </li>
<li>Dial in each note of ADDR-SEQ, noting that ASX adds notes 9-16. The first note should be G2. The down notes are X1 and the up notes are X3</li>
<li>Enter the steps for each trigger sequencer. The order of sequencers is PRASE: pitch, rest, accent, slide, extend. Each TRG should have 16 steps. All steps for the rest TRG should be active (rests are empty). For Da Funk, all steps for extend should be empty</li>
<li>Listen to the song periodically as you enter steps. This should help you catch mistakes</li>
</ul></li>
</ul>
<div class='d-flex flex-row justify-content-around'>
<img class='instruction-wide-image' src='images/303-da-funk-pattern.png'>
</div>
<div class='d-flex flex-row justify-content-around'>
<img class='rack-image' src='images/solo-modules/asx-solo.png'>
<img class='rack-image' src='images/solo-modules/fourview-solo.png'>
<img class='rack-image' src='images/solo-modules/superdrive-solo.png'>
</div>
",solution_html="<img class='rack-image' src='images/patch-solutions/tb303-seq.png'>")
```
<!-- CAPTION BLOCK -->
```{r tb303-seq, echo=F, out.width="100%", fig.cap="(ref:tb303-seq)"}
modular_caption()
```
At this point, the song should be somewhat recognizable but also recognizably not right.
The 16th note gates generated by the clock are the right length for the 303's regular gates, but 9/16 of the steps have slides, and these should be implemented as extended gates and not short gates.
Extended gates should happen either when a step has been marked as a slide gate or when it has been marked as an extended gate.
Additionally, the extended gate should only occur when the step has a note.
The flavor of these conditions suggest logic should be used to decide when an extended gate should fire.
Try extending the last patch by adding logic to trigger extended gates and then tune those gates to the correct length using the button in Figure \@ref(fig:tb303-seq-extendgate).
(ref:tb303-seq-extendgate) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=tb303-seq.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2ftb303-seq-extendgate.png%27%3e&instructions=%3cul%3e%0a%3cli%3eStop%2c+reset%2c+and+run+the+sequencers+to+make+sure+they+are+in+sync%3c%2fli%3e%0a%3cli%3eOn+the+row+below%2c+add+dualOR%2c+dualAND%2c+DGATE%2c+filtah%2c+and+Scope%3c%2fli%3e%0a%3cli%3eConnect+the+TRG+slide+out+and+extended+out+to+dualOR+inputs+1+and+2.+The+dualOR+will+be+high+when+either+of+these+gates+is+active%3c%2fli%3e%0a%3cli%3eConnect+the+dualOR+out+to+dualAND+input+1+and+TRG+rest+out+to+dualAND+input+2.+The+dualAND+will+be+high+when+it+receives+a+gate+from+either+slide+or+extend+and+simultaneously+receives+a+gate+from+the+active+step%3c%2fli%3e%0a%3cli%3eConnect+dualAND+out+to+DGATE+trigger+in+and+DGATE+gate+out+to+Scope+in+1%3c%2fli%3e%0a%3cli%3eConnect+TRG+rest+out+to+Scope+in+2%3c%2fli%3e%0a%3cli%3eListen+to+the+song+and+make+the+following+adjustments+on+the+Scope%3cul%3e%0a%3cli%3eThe+default+gate+length+is+1s.+Reduce+it+until+the+length+spans+the+high%2flow+of+a+gate+and+the+high+of+the+next+gate.+Note+this+is+tempo-driven%2c+so+a+change+in+tempo+will+require+recallibration%3c%2fli%3e%0a%3cli%3eNote+that+the+extended+gate+sometimes+has+a+downward+line+in+the+middle.+This+is+because+multiple+gates+are+overlapping%2c+which+we+expect+because+the+TRG+slide+sometimes+has+multiple+steps+in+a+row.+To+fix+this%2c+we+need+to+run+the+extended+gate+through+a+LPF+to+slow+the+control+voltage+enough+to+remove+these+downward+transitions%2c+which+otherwise+would+trigger+an+envelope%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3cli%3eConnect+filtah+in+between+DGATE+and+the+Scope+and+turn+the+cutoff+down+until+the+downward+transitions+disappear%3c%2fli%3e%0a%3cli%3eAdd+ADSR+and+VCA+to+the+right+of+the+VCO%3c%2fli%3e%0a%3cli%3eConnect+the+VCO+saw+out+to+the+VCA+in%3c%2fli%3e%0a%3cli%3eConnect+the+ADSR+out+to+the+VCA+CV+in%3c%2fli%3e%0a%3cli%3eConnect+the+VCA+out+to+the+SuperDrive+in%3c%2fli%3e%0a%3cli%3eConnect+filtah+out+to+ADSR+gate+in+and+listen+to+the+song%3c%2fli%3e%0a%3c%2ful%3e%0a) for improving the 303 patch with extended gates.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("tb303-seq-extendgate", starter_file="tb303-seq.vcv", instructions_html="<ul>
<li>Stop, reset, and run the sequencers to make sure they are in sync</li>
<li>On the row below, add dualOR, dualAND, DGATE, filtah, and Scope</li>
<li>Connect the TRG slide out and extended out to dualOR inputs 1 and 2. The dualOR will be high when either of these gates is active</li>
<li>Connect the dualOR out to dualAND input 1 and TRG rest out to dualAND input 2. The dualAND will be high when it receives a gate from either slide or extend and simultaneously receives a gate from the active step</li>
<li>Connect dualAND out to DGATE trigger in and DGATE gate out to Scope in 1</li>
<li>Connect TRG rest out to Scope in 2</li>
<li>Listen to the song and make the following adjustments on the Scope<ul>
<li>The default gate length is 1s. Reduce it until the length spans the high/low of a gate and the high of the next gate. Note this is tempo-driven, so a change in tempo will require recallibration</li>
<li>Note that the extended gate sometimes has a downward line in the middle. This is because multiple gates are overlapping, which we expect because the TRG slide sometimes has multiple steps in a row. To fix this, we need to run the extended gate through a LPF to slow the control voltage enough to remove these downward transitions, which otherwise would trigger an envelope</li>
</ul></li>
<li>Connect filtah in between DGATE and the Scope and turn the cutoff down until the downward transitions disappear</li>
<li>Add ADSR and VCA to the right of the VCO</li>
<li>Connect the VCO saw out to the VCA in</li>
<li>Connect the ADSR out to the VCA CV in</li>
<li>Connect the VCA out to the SuperDrive in</li>
<li>Connect filtah out to ADSR gate in and listen to the song</li>
</ul>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/tb303-seq-extendgate.png'>")
```
<!-- CAPTION BLOCK -->
```{r tb303-seq-extendgate, echo=F, out.width="100%", fig.cap="(ref:tb303-seq-extendgate)"}
modular_caption()
```
With the patch in Figure \@ref(fig:tb303-seq-extendgate), the song may sound more correct but flawed in a different way.
This is because the last patch replaced all gates with extended gates.
Since a few gates are regular gates, they are currently not being generated at all.
Ideally, we'd use logic to define the length of the gate to generate and use the same mechanism to generate both regular and extended gates.
Unfortunately, the module being used to generate extended gates does not accept CV to control gate length.
As a result, we need two sources of gates and to send gates from both sources to the ADSR.
One option would be to use a sequential switch that accepted the gates from both sources and then selected one to send through using logic.
This would require several additional modules.
A simpler approach is to use a mixer to mix extended gates and regular gates from the step/rest sequencer.
This creates lumpy gates, but envelopes generally only pay attention to the rising and falling edges of a gate, so the lumpiness often won't matter.
Try extending the last patch by mixing in regular gates using the button in Figure \@ref(fig:tb303-seq-extendgate-reggate).
We'll throw in some logic in order to show that the logic doesn't actually matter in this case.
(ref:tb303-seq-extendgate-reggate) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=tb303-seq-extendgate.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2ftb303-seq-extendgate-reggate.png%27%3e&instructions=%3cul%3e%0a%3cli%3eStop%2c+reset%2c+and+run+the+sequencers+to+make+sure+they+are+in+sync%3c%2fli%3e%0a%3cli%3eLet%27s+start+with+the+assumption+that+logic+is+needed+to+solve+this+problem%3c%2fli%3e%0a%3cli%3eAdd+dualOR%2c+dualNOT%2c+dualAND%2c+and+QuadVCA%2fMixer+to+the+bottom+row%3c%2fli%3e%0a%3cli%3eConnect+TRG+slide+and+extend+outs+to+the+dualOR+like+the+last+patch.+The+dualOR+will+be+high+if+either+is+active%3c%2fli%3e%0a%3cli%3eConnect+the+dualOR+output+to+dualNOT+input+1.+Then+dualNOT+will+be+high+when+neither+is+active%3c%2fli%3e%0a%3cli%3eConnect+dualNOT+output+to+dualAND+input+1+and+TRG+step%2frest+out+to+dualAND+input+2.+The+dualAND+will+be+high+when+there+is+a+regular+step+and+there+is+no+extended+gate%3c%2fli%3e%0a%3cli%3eConnect+the+DGATE+out+QuadVCA%2fMixer+input+1+and+TRG+step%2frest+out+to+QuadVCA%2fMixer+input+2%3c%2fli%3e%0a%3cli%3eConnect+the+dualAND+out+to+QuadVCA%2fMixer+gain+CV+input+2.+This+will+throttle+back+the+regular+gates+when+there+is+an+extended+gate%3c%2fli%3e%0a%3cli%3eMove%2fconnect+filtah+to+QuadVCA%2fMixer+mix+out+to+remove+glitches+from+the+gates%3c%2fli%3e%0a%3cli%3eListen+to+the+song+and+watch+the+Scope%3cul%3e%0a%3cli%3eYou+should+see+a+peak+at+the+end+of+each+extended+gate.+This+is+the+regular+gate+being+mixed+on+top+of+the+extended+gate%3c%2fli%3e%0a%3cli%3eYou+should+see+an+occasional+solitary+regular+gate+at+the+same+height+as+the+extended+gates.+This+occurs+on+step+2+%28step+16+extends+its+gate+into+step+1%29%3c%2fli%3e%0a%3cli%3eRemove+the+dualAND+connection+to+QuadVCA%2fMixer+gain+CV+input+2+%3c%2fli%3e%0a%3cli%3eYou+should+see+that+the+extended+gates+are+even+lumpier+than+before%2c+but+there+is+no+change+in+the+behavior+of+the+ADSR+%3c%2fli%3e%0a%3cli%3eThus+the+additional+logic+modules+for+regular+gates+that+we+added+are+unnecessary+-+only+the+mixer+was+needed%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a) for extending the 303 patch by mixing regular and extended gates.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("tb303-seq-extendgate-reggate", starter_file="tb303-seq-extendgate.vcv", instructions_html="<ul>
<li>Stop, reset, and run the sequencers to make sure they are in sync</li>
<li>Let's start with the assumption that logic is needed to solve this problem</li>
<li>Add dualOR, dualNOT, dualAND, and QuadVCA/Mixer to the bottom row</li>
<li>Connect TRG slide and extend outs to the dualOR like the last patch. The dualOR will be high if either is active</li>
<li>Connect the dualOR output to dualNOT input 1. Then dualNOT will be high when neither is active</li>
<li>Connect dualNOT output to dualAND input 1 and TRG step/rest out to dualAND input 2. The dualAND will be high when there is a regular step and there is no extended gate</li>
<li>Connect the DGATE out QuadVCA/Mixer input 1 and TRG step/rest out to QuadVCA/Mixer input 2</li>
<li>Connect the dualAND out to QuadVCA/Mixer gain CV input 2. This will throttle back the regular gates when there is an extended gate</li>
<li>Move/connect filtah to QuadVCA/Mixer mix out to remove glitches from the gates</li>
<li>Listen to the song and watch the Scope<ul>
<li>You should see a peak at the end of each extended gate. This is the regular gate being mixed on top of the extended gate</li>
<li>You should see an occasional solitary regular gate at the same height as the extended gates. This occurs on step 2 (step 16 extends its gate into step 1)</li>
<li>Remove the dualAND connection to QuadVCA/Mixer gain CV input 2 </li>
<li>You should see that the extended gates are even lumpier than before, but there is no change in the behavior of the ADSR </li>
<li>Thus the additional logic modules for regular gates that we added are unnecessary - only the mixer was needed</li>
</ul></li>
</ul>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/tb303-seq-extendgate-reggate.png'>")
```
<!-- CAPTION BLOCK -->
```{r tb303-seq-extendgate-reggate, echo=F, out.width="100%", fig.cap="(ref:tb303-seq-extendgate-reggate)"}
modular_caption()
```
The final element of the sequencer we need to implement are the slide gates.
Recall that slide gates start on the step after the marked step.
For example, if step 8 is marked for a slide, step 8 will have its gate extended, but the slide gate which controls the portamento doesn't start until step 9.
Delayed gates again offer a convenient solution, but again they need to be tuned to the length of a step as well as filtering to glue together overlapping gates.
Unfortunately, it's less clear what the actual slide should look like in terms of its shape, which is important to know for slewing the V/Oct during the duration of the gate.
The Din Sync reference recordings do not have an example of slide.
Plotting the frequency spectrum of the song in Audacity is one way to get the frequencies of a window of audio, but extrapolating that to the change of frequencies over time seems so fraught with error that it is better to attempt setting the slew by ear.
Try extending the last patch with slide gates and tune the V/Oct slew using the button in Figure \@ref(fig:tb303-seq-extendgate-reggate-slidegate).
(ref:tb303-seq-extendgate-reggate-slidegate) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=tb303-seq-extendgate-reggate.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2ftb303-seq-extendgate-reggate-slidegate.png%27%3e&instructions=%3cul%3e%0a%3cli%3eStop%2c+reset%2c+and+run+the+sequencers+to+make+sure+they+are+in+sync%3c%2fli%3e%0a%3cli%3eOn+the+bottom+row+to+the+right+of+the+regular+gate+section%2c+add+dualAND%2c+DGATE%2c+filtah%2c+Slew+Limiter%2c+and+Scope%3c%2fli%3e%0a%3cli%3eConnect+TRG+step%2frest+gate+out+to+dualAND+input+1+and+TRG+slide+gate+out+to+dualAND+input+2.+The+dualAND+will+be+high+when+both+have+active+steps%3c%2fli%3e%0a%3cli%3eConnect+dualAND+out+to+DGATE+triggger+in%3c%2fli%3e%0a%3cli%3eConnect+DGATE+gate+out+to+filtah+in%3c%2fli%3e%0a%3cli%3eConnect+filtah+out+to+the+rise%2ffall+CV+in+of+the+Slew+Limiter%3c%2fli%3e%0a%3cli%3eConnect+the+Quantizer+out+to+the+Slew+Limiter+in+and+the+Slew+Limiter+out+to+VCO+V%2fOct.+This+will+slew+the+V%2fOct+on+slide+gates%3c%2fli%3e%0a%3cli%3eConnect+TRG+step%2frest+gate+out+to+Scope+input+1+and+filtah+out+to+Scope+input+2%3c%2fli%3e%0a%3cli%3eListen+to+the+song+and+make+the+following+adjustments+on+the+Scope%3cul%3e%0a%3cli%3eThe+default+gate+length+is+1s+and+the+default+delay+is+0s.+From+the+extended+gate+patch+we+know+that+a+step+and+a+half+is+around+.2s%2c+so+a+step+is+around+.135s.+Since+the+gate+should+be+delayed+1+step+and+last+1+step%2c+both+of+these+parameters+should+be+.135s%3c%2fli%3e%0a%3cli%3eCheck+the+length+of+the+slide+gate+on+the+scope.+Note+that+some+slide+gates+are+consecutive+and+will+be+longer%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3cli%3eListen+to+the+song+and+make+the+following+adjustments+to+the+Slew+Limiter.+You+may+need+to+have+the+song+open+so+you+can+compare+back+and+forth%3cul%3e%0a%3cli%3eIncrease+the+rise+and+fall+sliders+in+equal+amounts.+At+what+point+does+it+no+longer+sound+correct%3f%3c%2fli%3e%0a%3cli%3eIf+the+slew+extends+the+length+of+a+step%2c+then+we+expect+that+a+value+around+.135s+will+sound+correct%3c%2fli%3e%0a%3cli%3eThe+Slew+Limiter+also+has+a+shape+parameter+that+goes+from+linear+slew+on+the+left+to+logarithmic+slew+on+the+right.+At+what+point+does+it+no+longer+sound+correct%3f%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a) for extending the 303 patch using slide gates and slewed V/Oct.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("tb303-seq-extendgate-reggate-slidegate", starter_file="tb303-seq-extendgate-reggate.vcv", instructions_html="<ul>
<li>Stop, reset, and run the sequencers to make sure they are in sync</li>
<li>On the bottom row to the right of the regular gate section, add dualAND, DGATE, filtah, Slew Limiter, and Scope</li>
<li>Connect TRG step/rest gate out to dualAND input 1 and TRG slide gate out to dualAND input 2. The dualAND will be high when both have active steps</li>
<li>Connect dualAND out to DGATE triggger in</li>
<li>Connect DGATE gate out to filtah in</li>
<li>Connect filtah out to the rise/fall CV in of the Slew Limiter</li>
<li>Connect the Quantizer out to the Slew Limiter in and the Slew Limiter out to VCO V/Oct. This will slew the V/Oct on slide gates</li>
<li>Connect TRG step/rest gate out to Scope input 1 and filtah out to Scope input 2</li>
<li>Listen to the song and make the following adjustments on the Scope<ul>
<li>The default gate length is 1s and the default delay is 0s. From the extended gate patch we know that a step and a half is around .2s, so a step is around .135s. Since the gate should be delayed 1 step and last 1 step, both of these parameters should be .135s</li>
<li>Check the length of the slide gate on the scope. Note that some slide gates are consecutive and will be longer</li>
</ul></li>
<li>Listen to the song and make the following adjustments to the Slew Limiter. You may need to have the song open so you can compare back and forth<ul>
<li>Increase the rise and fall sliders in equal amounts. At what point does it no longer sound correct?</li>
<li>If the slew extends the length of a step, then we expect that a value around .135s will sound correct</li>
<li>The Slew Limiter also has a shape parameter that goes from linear slew on the left to logarithmic slew on the right. At what point does it no longer sound correct?</li>
</ul></li>
</ul>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/tb303-seq-extendgate-reggate-slidegate.png'>")
```
<!-- CAPTION BLOCK -->
```{r tb303-seq-extendgate-reggate-slidegate, echo=F, out.width="100%", fig.cap="(ref:tb303-seq-extendgate-reggate-slidegate)"}
modular_caption()
```
## Oscillator
The waveshapes produced by the 303 are a bit unusual in the reference recordings, as shown in the top row of Figure \@ref(fig:tb303-square-saw-hpf-compare).
Curiously, each of these waves is very similar to high pass filtered versions of the other wave, as shown in the bottom two rows of Figure \@ref(fig:tb303-square-saw-hpf-compare).
Based on the reference recordings, we may achieve a more accurate sound by high pass filtering the opposing wave.
That's not to say that this is how it was done in the hardware but rather that it could be a reasonable strategy for recreating the sound in modular.
Because the reference recordings are all at a single note, it's unclear how the filtering could or should track V/Oct.
(ref:tb303-square-saw-hpf-compare) Top row: square (left) and saw (right) waves for a C note from the Din Sync 303 reference recordings. Note neither waveshape matches the canonical form. Middle row: square wave (left) that is high pass filtered (right), creating a shape similar to the reference recording saw wave. Bottom row: saw wave (left) that is high pass filtered (right), creating a shape similar to the reference recording square wave.
```{r tb303-square-saw-hpf-compare, echo=F, out.width="100%", fig.cap="(ref:tb303-square-saw-hpf-compare)"}
knitr::include_graphics("images/tb303-square-saw-hpf-compare.png")
```
Another quirk of the 303 oscillator is that, according to Whittle, the duty cycle of the square wave at high pitches is about 45% but about 71% at the lowest pitches.
We can approximate this change in duty cycle by modulating the PWM input of the oscillator using the same voltage that is controlling pitch.
Try extending the last patch with these oscillator modifications using the button in Figure \@ref(fig:tb303-seq-extendgate-reggate-slidegate-osc).
(ref:tb303-seq-extendgate-reggate-slidegate-osc) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=tb303-seq-extendgate-reggate-slidegate.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2ftb303-seq-extendgate-reggate-slidegate-osc.png%27%3e&instructions=%3cul%3e%0a%3cli%3eStop%2c+reset%2c+and+run+the+sequencers+to+make+sure+they+are+in+sync%3c%2fli%3e%0a%3cli%3eMove+the+VCO+down+to+the+right+of+the+slide+gate+section%3c%2fli%3e%0a%3cli%3eAdd+two+VCFs+to+the+right+of+the+VCO+and+tune+their+cutoffs+to+82+Hz%3c%2fli%3e%0a%3cli%3eAdd+Bog+Audio+Switch81+and+Scope+to+the+right+of+the+two+VCFs+%3c%2fli%3e%0a%3cli%3eConnect+VCO+square+and+saw+outs+to+the+respective+ins+of+the+VCFs%3c%2fli%3e%0a%3cli%3eConnect+the+VCF+HPF+outs+to+the+first+two+inputs+of+the+Switch.+Right+click+the+Switch+and+select+exclusive+switching+so+we+can+choose+one+oscillator+or+the+other%3c%2fli%3e%0a%3cli%3eConnect+Switch+out+to+the+Scope+input+1+and+to+the+VCA+in+on+the+row+above+%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scope+waveshape%3cul%3e%0a%3cli%3eAdjust+the+VCF+cutoffs+to+approximately+match+the+reference+wave+shapes+%28I+set+mine+at+115+Hz%29%3c%2fli%3e%0a%3cli%3eConnect+the+V%2fOct+to+the+cutoff+inputs+of+both+VCFs+and+adjust+the+attenuverter+to+match+the+reference+wave+shape+%28I+set+mine+to+100%25%29%3c%2fli%3e%0a%3cli%3eConnect+the+V%2fOct+to+the+VCO+PWM+input+and+adjust+the+attenuverter+to+match+the+45%25-71%25+range+described+by+Whittle+%28I+set+mine+to+-64%25%29%3c%2fli%3e%0a%3cli%3eWhat+effect+does+the+filtering+have+on+the+sound%3f+Does+it+sound+more+or+less+correct+to+you%3f%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a%3cdiv+class%3d%27d-flex+flex-row+justify-content-around%27%3e%0a%3cimg+class%3d%27rack-image%27+src%3d%27images%2fsolo-modules%2fswitch81-solo.png%27%3e%0a%3c%2fdiv%3e%0a) for extending the 303 patch with oscillator modifications for V/Oct driven PWM and HPF.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("tb303-seq-extendgate-reggate-slidegate-osc", starter_file="tb303-seq-extendgate-reggate-slidegate.vcv", instructions_html="<ul>
<li>Stop, reset, and run the sequencers to make sure they are in sync</li>
<li>Move the VCO down to the right of the slide gate section</li>
<li>Add two VCFs to the right of the VCO and tune their cutoffs to 82 Hz</li>
<li>Add Bog Audio Switch81 and Scope to the right of the two VCFs </li>
<li>Connect VCO square and saw outs to the respective ins of the VCFs</li>
<li>Connect the VCF HPF outs to the first two inputs of the Switch. Right click the Switch and select exclusive switching so we can choose one oscillator or the other</li>
<li>Connect Switch out to the Scope input 1 and to the VCA in on the row above </li>
<li>Try the following and note the differences in the sound and scope waveshape<ul>
<li>Adjust the VCF cutoffs to approximately match the reference wave shapes (I set mine at 115 Hz)</li>
<li>Connect the V/Oct to the cutoff inputs of both VCFs and adjust the attenuverter to match the reference wave shape (I set mine to 100%)</li>
<li>Connect the V/Oct to the VCO PWM input and adjust the attenuverter to match the 45%-71% range described by Whittle (I set mine to -64%)</li>
<li>What effect does the filtering have on the sound? Does it sound more or less correct to you?</li>
</ul></li>
</ul>
<div class='d-flex flex-row justify-content-around'>
<img class='rack-image' src='images/solo-modules/switch81-solo.png'>
</div>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/tb303-seq-extendgate-reggate-slidegate-osc.png'>")
```
<!-- CAPTION BLOCK -->
```{r tb303-seq-extendgate-reggate-slidegate-osc, echo=F, out.width="100%", fig.cap="(ref:tb303-seq-extendgate-reggate-slidegate-osc)"}
modular_caption()
```
## Filter and envelope generators
The filter on the 303 has been the subject of much debate and speculation.
Tim Stinchcombe has done [extensive analysis of the filter and its transfer function](https://www.timstinchcombe.co.uk/index.php?pge=diode
).
His results indicate that the filter is a 24 dB, 4-pole filter, and he suggests that perhaps the reason it is commonly described as an 18 dB filter is that it behaves more like an 18 dB filter over much of its audible range.^[Perhaps there were legal reasons for Roland to go along with the 18 dB description. The 303 diode ladder filter is seen as similar to the Moog transistor ladder filter, which was protected by patent at the time the 303 was developed.]
The 303's filter no doubt plays a significant role in its sound, but in our virtual modular environment we are rather constrained by a lack of filter options.
Another diode ladder filter would likely be the best choice, but short of that, a 24 dB transistor ladder filter seems the best alternative.
The 303 has two envelopes, which Whittle calls the main envelope generator (MEG) and the volume envelope generator (VEG).^[https://www.firstpr.com.au/rwi/dfish/303-unique.html]
Both envelopes are attack-decay with very fast attack.
The MEG controls the filter cutoff, and the VEG controls the final VCA.
The MEG and VEG have additional complexities involving accents, but we will address those in the next section.
Try extending the last patch with the filter and envelope generators using the button in Figure \@ref(fig:tb303-seq-extendgate-reggate-slidegate-osc-megveg).
(ref:tb303-seq-extendgate-reggate-slidegate-osc-megveg) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=tb303-seq-extendgate-reggate-slidegate-osc.vcv&solution=%3cimg+class%3d%27rack-image-6u%27+src%3d%27images%2fpatch-solutions%2ftb303-seq-extendgate-reggate-slidegate-osc-megveg.png%27%3e&instructions=%3cul%3e%0a%3cli%3eStop%2c+reset%2c+and+run+the+sequencers+to+make+sure+they+are+in+sync%3c%2fli%3e%0a%3cli%3eTo+the+right+of+Four-View%2c+add+ADSR%2c+VCR%2c+ADSR%2c+and+Scope+%3c%2fli%3e%0a%3cli%3eConnect+the+extended+gate+out+to+the+first+ADSR+gate+in.+This+is+the+MEG.+The+decay+on+the+MEG+corresponds+to+the+303+%27decay%27+knob%3c%2fli%3e%0a%3cli%3eConnect+the+MEG+out+to+VCF+cutoff+in.+The+cutoff+on+the+VCF+corresponds+to+the+303+%27cut+off+freq%27+knob%2c+the+resonance+on+the+VCF+corresponds+to+the+303+%27resonance%27+knob%2c+and+the+cutoff+attenuator+correponds+to+the+303+%27env+mod%27+knob%3c%2fli%3e%0a%3cli%3eConnect+Switch+out+to+VCF+in+and+VCF+LPF+out+to+VCA+in+%3c%2fli%3e%0a%3cli%3eConnect+the+extended+gate+out+to+the+second+ADSR.+This+is+the+VEG%3c%2fli%3e%0a%3cli%3eConnect+VEG+out+to+the+adjacent+Scope+input+1+and+to+the+VCA+cv+in%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scope+waveshape%3cul%3e%0a%3cli%3eAdjust+the+MEG+ADSR+parameters+for+a+short+attack+and+long+decay%3c%2fli%3e%0a%3cli%3eAdjust+the+VEG+ADSR+parameters+for+a+short+attack+and+long+decay%3c%2fli%3e%0a%3cli%3eAdjust+the+VCF+cutoff%2c+resonance%2c+and+cutoff+attenuator+to+match+the+reference+recording%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a) for extending the 303 patch with filter and envelope generators.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("tb303-seq-extendgate-reggate-slidegate-osc-megveg", starter_file="tb303-seq-extendgate-reggate-slidegate-osc.vcv", instructions_html="<ul>
<li>Stop, reset, and run the sequencers to make sure they are in sync</li>
<li>To the right of Four-View, add ADSR, VCR, ADSR, and Scope </li>
<li>Connect the extended gate out to the first ADSR gate in. This is the MEG. The decay on the MEG corresponds to the 303 'decay' knob</li>
<li>Connect the MEG out to VCF cutoff in. The cutoff on the VCF corresponds to the 303 'cut off freq' knob, the resonance on the VCF corresponds to the 303 'resonance' knob, and the cutoff attenuator correponds to the 303 'env mod' knob</li>
<li>Connect Switch out to VCF in and VCF LPF out to VCA in </li>
<li>Connect the extended gate out to the second ADSR. This is the VEG</li>
<li>Connect VEG out to the adjacent Scope input 1 and to the VCA cv in</li>
<li>Try the following and note the differences in the sound and scope waveshape<ul>
<li>Adjust the MEG ADSR parameters for a short attack and long decay</li>
<li>Adjust the VEG ADSR parameters for a short attack and long decay</li>
<li>Adjust the VCF cutoff, resonance, and cutoff attenuator to match the reference recording</li>
</ul></li>
</ul>
",solution_html="<img class='rack-image-6u' src='images/patch-solutions/tb303-seq-extendgate-reggate-slidegate-osc-megveg.png'>")
```
<!-- CAPTION BLOCK -->
```{r tb303-seq-extendgate-reggate-slidegate-osc-megveg, echo=F, out.width="100%", fig.cap="(ref:tb303-seq-extendgate-reggate-slidegate-osc-megveg)"}
modular_caption()
```
## Accent
The 303 accent system alters the behavior of the MEG and VEG.
The accented changes and be broadly thought of as a pluckier sound that is shorter, louder, and slightly brighter.
On an accented note:
- The MEG decay is shortened
- The MEG sends additional control voltage to the VCA, making it louder
- The filter cutoff is raised
Whittle [describes the effect on the filter](https://www.firstpr.com.au/rwi/dfish/303-unique.html) as an accent sweep circuit that smooths the control voltage driving the filter cutoff.
The smoothed voltage has a slow decay, so if there are multiple accent notes in a row, the voltage will continue to increase, creating a series of increasing peaks in filter cutoff, as shown in Figure \@ref(fig:accent-sweep).^[Based on [Whittle's diagram.](https://www.firstpr.com.au/rwi/dfish/303-unique.html)]
(ref:accent-sweep) Conceptual diagram of the effect of the 303 accent sweep circuit on filter cutoff control voltage. The accent sweep circuit does not fully discharge before the next step, creating increasing peaks when consecutive steps are accented.
```{r accent-sweep, echo=F, out.width="95%", fig.cap="(ref:accent-sweep)"}
knitr::include_graphics("images/accent-sweep.png")
```
The accent system can be conceptualized in modular by incorporating a module that does smoothing and by incorporating a module that gives regular envelopes when no accents are received and modified envelopes when accents are received.
Smoothing can normally be accomplished using a slew limiter.
Modifying envelopes when accents are received can be accomplished similarly to how we modified gates, i.e. by creating step-length gates when accents are received, and using those gates to decide when to alternate between accented voltages and regular MEG voltages.
However, there seems to be a point of ambiguity in Whittle's description on how the smooth voltages is used.
It could be that there is a switch controlled by accents that determines whether to use the smoothed voltage or the regular MEG voltage.
The apparent problem with that is that the smoothed voltage will have a much longer decay than normal, which is the opposite of the behavior the accented envelope is supposed to have.
For this reason, it seems a better solution is to mix the smoothed voltage with the regular envelope on accented steps.
Try extending the last patch with the accents using the button in Figure \@ref(fig:tb303-seq-extendgate-reggate-slidegate-osc-megveg-accents).
(ref:tb303-seq-extendgate-reggate-slidegate-osc-megveg-accents) [Virtual modular](https://olney.ai/ct-modular-book/modular-for-pdf.html?starter=tb303-seq-extendgate-reggate-slidegate-osc-megveg.vcv&solution=%3cimg+class%3d%27rack-image-9u%27+src%3d%27images%2fpatch-solutions%2ftb303-seq-extendgate-reggate-slidegate-osc-megveg-accents.png%27%3e&instructions=%3cul%3e%0a%3cli%3eStop%2c+reset%2c+and+run+the+sequencers+to+make+sure+they+are+in+sync%3c%2fli%3e%0a%3cli%3eOn+the+row+above+the+sequencer+row%2c+add+DGATE%2c+filtah+%28you+can+copy+these+from+the+slide+window%29%2c+Scope%2c+Slew+Limiter%2c+Offset%2c+QuadVCA%2fMixer%2c+and+Scope+for+the+MEG+and+QuadVCA%2fMixer+and+Scope+for+the+VEG%3c%2fli%3e%0a%3cli%3eConnect+the+accent+sequencer+%28the+order+is+PRASE%29+to+DGATE+trigger+in+and+DGATE+gate+out+to+filtah+input.+This+will+create+single+gates+for+accents+that+cross+several+steps%3c%2fli%3e%0a%3cli%3eConnect+filtah+out+to+input+1+of+both+Scopes%3c%2fli%3e%0a%3cli%3eConnect+filtah+out+to+MEG+ADSR+decay.++This+will+control+decay+on+accented+notes%3c%2fli%3e%0a%3cli%3eConnect+MEG+ADSR+out+to+Slew+in+and+Slew+out+to+Offset+in%3c%2fli%3e%0a%3cli%3eConnect+Offset+out+to+VEG+QuadVCA%2fMixer+input+1.+This+will+send+extra+volume+voltage+on+accented+notes%3c%2fli%3e%0a%3cli%3eConnect+the+Offset+out+to+the+MEG+QuadVCA%2fMixer+input+1+and+the+MEG+ADSR+out+to+the+same+QuadVCA%2fMixer+input+2%3c%2fli%3e%0a%3cli%3eConnect+filtah+out+to+MEG+QuadVCA%2fMixer+input+1+gain.+This+will+gate+the+smoothed+voltage+so+it+is+added+only+on+accents%3c%2fli%3e%0a%3cli%3eConnect+MEG+QuadVCA%2fMixer+mix+out+to+VEG+Scope+input+2+and+VCF+cutoff%3c%2fli%3e%0a%3cli%3eConnect+Slew+out+to+MEG+Scope+input+2%3c%2fli%3e%0a%3cli%3eConnect+VEG+ADSR+to+VEG+QuadVCA%2fMixer+input+2%3c%2fli%3e%0a%3cli%3eConnect+VEG+QuadVCA%2fMixer+mix+out+to+VEG+Scope+input+1+and+VCA+cv+in%3c%2fli%3e%0a%3cli%3eConnect+VEG+ADSR+out+to+VEG+Scope+input+2%3c%2fli%3e%0a%3cli%3eTry+the+following+and+note+the+differences+in+the+sound+and+scope+waveshape%3cul%3e%0a%3cli%3eAdjust+DGATE+and+filtah+to+match+a+step%2c+using+the+slide+window+parameters+as+a+model.+You+should+see+a+long+gate+that+covers+4+accented+steps+and+a+short+gate+that+covers+1+on+the+scope%3c%2fli%3e%0a%3cli%3eAdjust+the+Slew+rise%2ffall+to+get+a+curve+like+the+diagram+on+the+text%2c+i.e.+multiple+peaks.+Notet+the+Scope+will+show+all+envelopes%2c+not+just+the+accented+ones%2c+which+align+with+the+accent+gates+%3c%2fli%3e%0a%3cli%3eAdjust+the+MEG+mixer+levels+to+combine+the+smoothed+and+regular+envelopes+using+the+second+scope.+You+should+see+higher+peaks+when+the+offset+scale+knob+is+turned+up.+This+knob+corresponds+to+the+303+accent+knob.+If+the+signal+is+too+hot%2c+it+will+be+flat+on+top+to+indicate+clipping%3c%2fli%3e%0a%3cli%3eAdjust+the+decay+attenuverter+on+the+MEG+ADSR+and+the+cutoff+knob+on+the+MEG+VCF%3c%2fli%3e%0a%3cli%3eAdjust+the+mixer+levels+on+the+VEG+using+the+scope+as+a+guide.+You+should+see+a+bump+on+the+VEG+scope+for+accented+notes+relative+to+unaccented+notes%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3cli%3eHave+a+jam+and+test+out+the+sound.+The+following+correspond+to+the+303+knobs%3cul%3e%0a%3cli%3eMEG+VCF+cutoff+is+the+303+cutoff+frequency%3c%2fli%3e%0a%3cli%3eMEG+VCF+resonance+is+the+303+resonance%3c%2fli%3e%0a%3cli%3eMEG+VCF+cutoff+attenuverter+is+the+303+env+mod%3c%2fli%3e%0a%3cli%3eMEG+ADSR+decay+is+the+303+decay%3c%2fli%3e%0a%3cli%3eAccent+Offset+is+the+accent%3c%2fli%3e%0a%3c%2ful%3e%3c%2fli%3e%0a%3c%2ful%3e%0a) for for extending the 303 patch with accents.
<!-- MODAL HTML BLOCK -->
```{r echo=F, out.width="100%"}
modular_modal("tb303-seq-extendgate-reggate-slidegate-osc-megveg-accents", starter_file="tb303-seq-extendgate-reggate-slidegate-osc-megveg.vcv", instructions_html="<ul>
<li>Stop, reset, and run the sequencers to make sure they are in sync</li>
<li>On the row above the sequencer row, add DGATE, filtah (you can copy these from the slide window), Scope, Slew Limiter, Offset, QuadVCA/Mixer, and Scope for the MEG and QuadVCA/Mixer and Scope for the VEG</li>
<li>Connect the accent sequencer (the order is PRASE) to DGATE trigger in and DGATE gate out to filtah input. This will create single gates for accents that cross several steps</li>
<li>Connect filtah out to input 1 of both Scopes</li>
<li>Connect filtah out to MEG ADSR decay. This will control decay on accented notes</li>
<li>Connect MEG ADSR out to Slew in and Slew out to Offset in</li>
<li>Connect Offset out to VEG QuadVCA/Mixer input 1. This will send extra volume voltage on accented notes</li>
<li>Connect the Offset out to the MEG QuadVCA/Mixer input 1 and the MEG ADSR out to the same QuadVCA/Mixer input 2</li>
<li>Connect filtah out to MEG QuadVCA/Mixer input 1 gain. This will gate the smoothed voltage so it is added only on accents</li>
<li>Connect MEG QuadVCA/Mixer mix out to VEG Scope input 2 and VCF cutoff</li>
<li>Connect Slew out to MEG Scope input 2</li>
<li>Connect VEG ADSR to VEG QuadVCA/Mixer input 2</li>
<li>Connect VEG QuadVCA/Mixer mix out to VEG Scope input 1 and VCA cv in</li>
<li>Connect VEG ADSR out to VEG Scope input 2</li>
<li>Try the following and note the differences in the sound and scope waveshape<ul>
<li>Adjust DGATE and filtah to match a step, using the slide window parameters as a model. You should see a long gate that covers 4 accented steps and a short gate that covers 1 on the scope</li>
<li>Adjust the Slew rise/fall to get a curve like the diagram on the text, i.e. multiple peaks. Notet the Scope will show all envelopes, not just the accented ones, which align with the accent gates </li>
<li>Adjust the MEG mixer levels to combine the smoothed and regular envelopes using the second scope. You should see higher peaks when the offset scale knob is turned up. This knob corresponds to the 303 accent knob. If the signal is too hot, it will be flat on top to indicate clipping</li>
<li>Adjust the decay attenuverter on the MEG ADSR and the cutoff knob on the MEG VCF</li>
<li>Adjust the mixer levels on the VEG using the scope as a guide. You should see a bump on the VEG scope for accented notes relative to unaccented notes</li>
</ul></li>
<li>Have a jam and test out the sound. The following correspond to the 303 knobs<ul>
<li>MEG VCF cutoff is the 303 cutoff frequency</li>
<li>MEG VCF resonance is the 303 resonance</li>
<li>MEG VCF cutoff attenuverter is the 303 env mod</li>
<li>MEG ADSR decay is the 303 decay</li>
<li>Accent Offset is the accent</li>
</ul></li>
</ul>
",solution_html="<img class='rack-image-9u' src='images/patch-solutions/tb303-seq-extendgate-reggate-slidegate-osc-megveg-accents.png'>")
```
<!-- CAPTION BLOCK -->
```{r tb303-seq-extendgate-reggate-slidegate-osc-megveg-accents, echo=F, out.width="100%", fig.cap="(ref:tb303-seq-extendgate-reggate-slidegate-osc-megveg-accents)"}
modular_caption()
```
## Looking back
Overall this seems like a decent approximation to a 303.
My biggest reservations are around the accent system, which seems to capture some but not all of Whittle's descriptions.
Improving the accent system would require additional research and probably studying the circuit itself.
It would also be nice to have a diode ladder filter module rather than a transistor ladder module.
The transistor ladder seems to a pretty good job at low to medium resonance, but I'm not as convinced at higher resonance.
Probably the best way to make continued progress on this patch would be to obtain a real 303 and then make reference recordings for our target song and then use those to better tune parameters and make design decisions.