// title: Stylophone tone simulation // author: na // description: // Basic tone simulator of a stylophone. Sugestions//improvements are welcome :) // code: /* 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;