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
| //-- top level sound directory | |
| d = (thisProcess.platform.recordingsDir ++ "/ftrack/").standardizePath; | |
| //-- dictionary associating subdir names to path arrays | |
| p = Dictionary.new; | |
| PathName(d).folders.do({ |f| p.add(f.folderName.asSymbol -> f.files); }); | |
| //-- runtime state stored in this Event | |
| e = ( |
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
| s = Server.local; | |
| s.waitForBoot { | |
| ~bufsize = s.sampleRate; | |
| ~graphsize = ~bufsize / 100; | |
| ~buf = Buffer.alloc(s, ~bufsize, 1); | |
| ~in = { RecordBuf.ar(SoundIn.ar(0), ~buf.bufnum); }.play; | |
| ~delta = 0.5; |
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
| // testing audible differences between VOsc.ar and Osc.ar under frequency/phase modulation | |
| // press '1' to hear VOsc, '2' to hear Osc | |
| // drag mouse on window to change mod hz and depth | |
| // VOsc is set to interpolate between identical sine buffers | |
| Routine { | |
| SynthDef.new(\vosc_test, { | |
| arg out=0, buf=0, amp=0.25, hz_car=240, hz_mod=60, mod_idx=1.0, fade=0.0; | |
| var mod, car; |
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
| Routine { | |
| /* // continuous white noise | |
| ~noise = { arg out=1, amp=0.125; Out.ar(out, WhiteNoise.ar * amp) }.play; | |
| ~noise.free; | |
| */ | |
| SynthDef.new(\ping_noise_decay, { | |
| arg out=1, amp=0.25, atk=0.0, rel=0.001; | |
| Out.ar(out, | |
| WhiteNoise.ar |
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
| CfGridRaw { | |
| var <>p; // serial port | |
| var <>q; // rx data queue | |
| var <>r; // rx read loop | |
| // responder functions | |
| var <>keyUp, <>keyDown; | |
| *new { arg port_ = '/dev/ttyUSB0', baud_ = 115200; | |
| ^super.new.init(port_, baud_); |
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 to make a sine | |
| var export_sine = { | |
| arg hz, dur, amp = 0.5, sr = 48000; | |
| var sf, path; | |
| var cycles = dur * hz; | |
| var samplesPerCycle = sr / hz; | |
| // specify some other array of harmonics here for richer waveforms | |
| var signal = Signal.sineFill(samplesPerCycle, [1.0]) * amp; |
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
| // outlets: input index, output index, connection value | |
| outlets = 3; | |
| sketch.default2d(); | |
| // I/O count, should be an argument | |
| var num_ins = 4; | |
| var num_outs = 4; | |
| // mouse state (world coordinates) |
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
| 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
| #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; |
OlderNewer