«Stylophone tone simulation» by na

on 31 Mar'20 05:59 in synthdefstylophonevintage

Basic tone simulator of a stylophone. Sugestions//improvements are welcome :)

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
/*
Retro Stylophone

Reverse engineered from: https://www.waitingforfriday.com/?p=334

1. Relaxation oscillator (UJT)

- generated by a combination of two oscillators. The primary oscillator is a
  current controlled PUT (Programmable Uni-Junction Transistor) relaxation oscillator which is
  responsible for generating the overall tone of the instrument.
  A secondary LFO phase-shifted provides the vibrato
  (the relative slow wavering of a sound around the notes centre pitch)

- around 10 VPP

2. LFO phase-shift (vibrato)

- generated by a low-frequency oscillator made with a transistor and several capacitors,
  which produces a triangle/sine wave fed into the frequency control voltage operating the UJT

- frequency of about 8.5Hz, phased shifted of 180 degree, around 4.2 VPP
*/

(
SynthDef(\stylophone, { |freq = 220, vibAmp = 2, toneAmp = 5, atkTime = 0.01, trigger = 0|

    var lfo = OnePole.kr(LFPar.kr(8, mul: vibAmp, add: freq), 0.9); // 180 degree inversion
    var relaxOsc = LFPulse.ar(lfo, width: 0.9, mul: toneAmp);

    var asr = EnvGen.kr(Env.asr(atkTime * 5, releaseTime: 0.001, curve: \lin), gate: trigger);

    Out.ar(0, relaxOsc * asr)
}).add
)

f = Synth(\stylophone);

f.set(\freq, 208.2);
f.set(\freq, 233.4);

f.set(\trigger, 1);
f.set(\trigger, 0);
f.free;
raw 1333 chars (focus & ctrl+a+c to copy)
reception
comments