Image processing and manipulation
Working with bitmap data (images and videos)

s.boot;
s.quit;
// see available audio devices
ServerOptions.outDevices;
// define output device
Server.default.options.outDevice_("Scarlett 8i6 USB");
// Set up NetAddr for OSC communication
n = NetAddr("localhost", 12000);
// Define the SynthDef
SynthDef(\randomFilterSaw, {
arg out=0, freq=220, amp=0.3;
var sig, filterFreq, trigger;
// Create trigger for random timing (between 0.5 and 3 seconds)
trigger = Dust.kr(LFNoise0.kr(0.1).range(1/3, 2));
// Generate random filter frequency (between 80 and 300 Hz)
filterFreq = TRand.kr(80, 300, trigger);
// Saw oscillator
sig = Saw.ar(freq);
// Apply low pass filter with random cutoff
sig = LPF.ar(sig, filterFreq);
// Apply amplitude envelope
sig = sig * amp;
// Send OSC message with current filter frequency
SendReply.kr(trigger, '/filter_freq', filterFreq);
Out.ar(out, sig!2);
}).add;
OSCdef(\filterFreqReporter, {|msg|
var freq = msg[3];
"Current filter frequency: % Hz".format(freq).postln;
n.sendMsg("/filter_freq", freq);
}, '/filter_freq');
// Start synth on first output (channel 0)
x = Synth(\randomFilterSaw, [\out, 0]);
x.free;Manipulation of values in the bitmap: Color adjustments + Manipulation of the bitmap structure







Last updated