This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Gerasene { | |
| classvar fft_bufsize; | |
| var <buf; | |
| var <out_bus; | |
| var <syn; | |
| var <out_syn; | |
| *initClass { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local factory = include('lib/factory') | |
| function init() | |
| --- add parameters here... | |
| -- this will copy .pset and .pmap from dust/code/example/data/*, to dust/data/example/*, | |
| -- (without overwriting existing files) | |
| factory.init() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // CroneEngine_TestNoise | |
| // variante of TestSine, for switching | |
| // Inherit methods from CroneEngine | |
| Engine_TestNoise : CroneEngine { | |
| var <synth; | |
| *new { arg context, doneCallback; | |
| ^super.new(context, doneCallback); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function y = tanc(x, a) | |
| g = 1 - a; | |
| y = 1 - g * (1 - tanhx((x - a) / g)); | |
| endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Engine_Drumf : CroneEngine { | |
| classvar <numVoices = 4; | |
| var <trig_bus; | |
| var <drum_synth; | |
| var <drum_def; | |
| *new { arg context, doneCallback; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdint.h> | |
| #include <stdio.h> | |
| // perform a logical bit shift with rotation on a signed 16-bit integer | |
| // second argument is number of bits: | |
| // positive to shift right, negative shift left | |
| int16_t bitrot16(int16_t x, int n) { | |
| // use a union with unsigned type, | |
| // so all our bitwise ops ignore sign | |
| union { int16_t si; uint16_t ui; } u; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 8-voice paraphonic synth, | |
| // _very loosely_ inspired by ARP Solina architecture | |
| Routine { | |
| // first element is an oscillator. | |
| // classically this is a sawtooth, with some nonlinear lowpass filtering | |
| // we'll expand on it with: | |
| // - triangle->saw width control |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MIDIClient.init; // initialize MIDI | |
| m = MIDIOut(0); // get the first output device | |
| Routine { // use a Routine (aka a thread) for synchronization with the server | |
| s = Server.default; | |
| s.boot; | |
| s.sync; // wait for the server to be ready | |
| // a control-rate bus which our synth will write to | |
| ~lfo_out_bus = Bus.control(s, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PolyLevelTest { | |
| // homework: experiment with this value | |
| var <>estimatedGainPerVoiceDb = 3; | |
| var <activeVoiceCount = 0; | |
| var outputBus; | |
| var <outputSynth; | |
| init { arg server; | |
| SynthDef.new(\fm_noise_1shot, { | |
| arg out=0, amp=0.5, pan=0.0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // utility func to "wrap: a value to a range, by octave division | |
| var geoWrap = { arg x, max=2, min=1; | |
| var y = x; | |
| while ({y>max}, {y=y/2}); | |
| while ({y<min}, {y=y*2}); | |
| y | |
| }; | |
| var synthFunc = { | |
| arg hz=110, amp=0.125, out=0, |