one reason why i love sc

140 characters (sc3.5 only)...

play{Splay.ar(SinOsc.ar(9,SinOsc.ar(midicps((Sweep.ar(0,(33..3))%128&(Sweep.ar(0,(3..9))%(LFSaw.ar(3)*9+99)))+33),0,pi)))/3}//#SuperCollider

if we run this line in supercollider we hear this...


and using Rohan Drape's great rd_dot quark and swap play{} with draw{} in the line above, this mess gets revealed...

so with a single line of code - short enough to fit in a twitter tweet - we've built this amazingly complex sound synthesis patch. i can not imagine a system with greater code-to-noise ratio than supercollider.

and this one is pretty fun to .draw as well...

play{f={|o,i|if(i>0,{SinOsc.ar([i,i+1e-4]**2*f.(o,i-1),f.(o,i-1)*1e-4,f.(o,i-1))},o)};f.(60,6)/60}//#SuperCollider


a heavily recursive patch that looks almost fractal. the pdf file generated from this line of code is 300kb! the number 6 in the code means recursion depth and 60 is the base frequency.

to run the rd_dot quark in supercollider on a mac you'll need Graphviz (i use 2.28 on my osx 10.6.8). you also need to make sure the resulting .dot files opens automatically in graphviz and not photoshop, word or something (get info on a .dot file in Finder and change all filetypes to open with graphiviz. you'll find the .dot files from rd_dot in your hidden /tmp directory)

AttachmentSize
PDF icon 637231982.pdf85.87 KB
PDF icon 1909609728.pdf300.44 KB

analog video in/out on a recent macbook pro

for a project i needed to take in and send out realtime analog (composite) video. analog video input has always been a problem, but on recent laptops apple even removed the video output via dvi adapter option (i.e. there is no displayport to video/s-video adapter).
so after experimenting and going through some old hardware i had laying around, i found a solution using two devices that i last used around 10years ago.

* dfg1394 bus powered s-video/composite video to uncompressed firewire converter from imagingsource (firewire version not longer available).
* mac osx drivers for the dfg1394 from outcastsoft. works with max/jitter etc.
* an old TView Gold scanconverter from Focus enhancements. used in combo with a 5v power from usb hack and a displayport to vga adapter.

broderi

wireless sensor for embroidery.

the sensor is a tilt compensated compass i.e. a 3d accelerometer in combo with a 3d magnetometer. compared to my other wireless boxes, this one runs on 3.0V (two AAA batteries) and not 3.6V. this due to the LSM303DLH sensor's lack of onboard voltage regulators and 1.8V i2c data lines.
the mega168 has an arduino sketch loaded as firmware and is using the internal 8mhz oscillator. so the circuit is pretty minimal.

as part of the project knyppel with ann rosén.

schematics, arduino firmware, partslist, maxpatches, supercollider class attached.

AttachmentSize
Package icon broderi.zip57.14 KB

soft modem

this summer i build 8 small circuits that can control a bunch of leds (6 channels pwm) from basically any idevice or android phone. the circuit connects to the audio jack of the phone and uses the right channel to send data commands (in the form of a modem signal).

we use rjdj (and pdlib, supercollider, etc) to generate the data signal on the phone in realtime. and it's relatively easy to connect for example the built-in accelerometer in the phone to control some leds, or to run amplitude/pitch tracking on the microphone and let that flash some leds.

the circuits will be used in the rhyme research project as well as in the upcoming e-textile workshop in oslo (oct 2011).

the design is based on SoftModem by arms22. attached below are my schematics, pd fsk abstraction and arduino firmware.

the modem signal is generated using frequency-shift keying and here's how to do that in supercollider...

(
c= "how are you?";
{var t= 1/1225; var m= Duty.ar(Dseq([t*100]++t.dup(11*c.size)), 0, Dseq([1]++c.ascii.collect{|cc| [0]++(cc.asBinaryString.ascii-48).reverse++[1, 1]}.flat), 2); SinOsc.ar(m*(7350-4900)+4900)!2}.play(fadeTime:0);
)

this will send the characters "how are you?" at a baudrate of 1225. this is of course not a valid command for the circuit above, just something to demonstrate how it sounds. below is an mp3...


AttachmentSize
Package icon softModem.zip61.64 KB

monijonsyn3

things to do with an ipod case... instead of throwing it away, i took some spare parts and built a new synth based on my monijonsyn2. the new synth has a push-button and one can now step through a few different programs. and the 2-way switch set different 'modes'. in this 1.0 version there is only 3 programs and 2 modes.
the programs basically just maps the 3 analog inputs differently, and the modes switches left/right output channels.

it's very cheap and easy to build. 2 aa-batteris provide power, the inputs are 3 touch points, 2 potentiometers, 1 button and a combined on/off/mode switch. all the sound generation (2 pwm pins) and program logic happens inside the 8bit avr mega8 chip and the code is easy to hack (see main.c in the zip below).

todo: add more fun programs to the firmware


AttachmentSize
Package icon monijonsyn3.zip13.97 KB

droneSines

a very simple supercollider drone instrument i wrote for a friend. the gui is automatically generated from the node proxy using the .edit method. most of the code is defining specs (min, max curve, stepsize and default values) for all the parameters. the synthesis part is very simple - just an oscillator going through a reverb and the oscillator is frequency, phase and amplitude modulated by other oscillators.

(
//redFrik 2011
s.waitForBoot{
        Spec.add(\freq1, #[20, 10000, \exp, 0, 100]);
        Spec.add(\freq2, #[20, 10000, \exp, 0, 200]);
        Spec.add(\freq3, #[20, 10000, \exp, 0, 300]);
        Spec.add(\fmod1, #[0.001, 100, \exp, 0, 0.11]);
        Spec.add(\fmod2, #[0.001, 100, \exp, 0, 0.22]);
        Spec.add(\fmod3, #[0.001, 100, \exp, 0, 0.33]);
        Spec.add(\fmoda1, #[0, 100, \lin, 0, 1]);
        Spec.add(\fmoda2, #[0, 100, \lin, 0, 1]);
        Spec.add(\fmoda3, #[0, 100, \lin, 0, 1]);
        Spec.add(\pmod1, #[0.001, 100, \exp, 0, 0.1]);
        Spec.add(\pmod2, #[0.001, 100, \exp, 0, 0.2]);
        Spec.add(\pmod3, #[0.001, 100, \exp, 0, 0.3]);
        Spec.add(\amod1, #[0.001, 100, \exp, 0, 0.01]);
        Spec.add(\amod2, #[0.001, 100, \exp, 0, 0.02]);
        Spec.add(\amod3, #[0.001, 100, \exp, 0, 0.03]);
        Spec.add(\amoda1, #[0, 10, \lin, 0, 0.05]);
        Spec.add(\amoda2, #[0, 10, \lin, 0, 0.05]);
        Spec.add(\amoda3, #[0, 10, \lin, 0, 0.05]);
        Spec.add(\smod, #[0.001, 100, \exp, 0, 0.13]);
        Spec.add(\smoda, #[0, 100, \lin, 0, 5]);
        Spec.add(\smodm, #[0, 100, \lin, 0, 6]);
        Spec.add(\smodaa, #[0, 100, \lin, 0, 8]);
        Spec.add(\smodmm, #[0, 100, \lin, 0, 50]);
        Spec.add(\cmod, #[0.001, 100, \exp, 0, 1.2]);
        Spec.add(\cmoda, #[0, 10, \lin, 0, 0.6]);
        Spec.add(\room, #[0, 300, \lin, 1, 20]);
        Spec.add(\reverb, #[0, 30, \lin, 0, 5]);
        Spec.add(\damp, #[0, 1, \lin, 0, 1]);
        Spec.add(\input, #[0, 1, \lin, 0, 0.5]);
        Spec.add(\spread, #[0, 100, \lin, 0, 25]);
        Spec.add(\dry, #[0, 1, \lin, 0, 0]);
        Spec.add(\early, #[0, 1, \lin, 0, 1]);
        Spec.add(\tail, #[0, 1, \lin, 0, 1]);
        Ndef(\droneSines).play;
        Ndef(\droneSines, {|freq1= 100, freq2= 200, freq3= 300, fmod1= 0.11, fmod2= 0.22, fmod3= 0.33, fmoda1= 1, fmoda2= 1, fmoda3= 1, pmod1= 0.1, pmod2= 0.2, pmod3= 0.3, amod1= 0.01, amod2= 0.02, amod3= 0.03, amoda1= 0.05, amoda2= 0.05, amoda3= 0.05, smod= 0.13, smoda= 5, smodm= 6, smodaa= 8, smodmm= 50, cmod= 1.2, cmoda= 0.6, room= 20, reverb= 5, damp= 1, input= 0.5, spread= 25, dry= 0, early= 1, tail= 1, amp= 0.7|
                Limiter.ar(LeakDC.ar(GVerb.ar(Splay.ar(SinOsc.ar([freq1, freq2, freq3]+SinOsc.ar([fmod1, fmod2, fmod3], 0, [fmoda1, fmoda2, fmoda3]), SinOsc.ar([pmod1, pmod2, pmod3], 0, 2pi), SinOsc.ar([amod1, amod2, amod3], 0, [amoda1, amoda2, amoda3])), SinOsc.ar(SinOsc.ar(SinOsc.ar(smod, 0, smoda, smodm), 0, smodaa, smodmm), 0, 1, 1), amp, SinOsc.ar(cmod, 0, cmoda)), room, reverb, damp, input, spread, dry, early, tail)));
        });
        Ndef(\droneSines).edit;
        s.meter;
};
)
//Ndef(\droneSines).clear;
Ndef(\droneSines).stop;

//--save a preset
Ndef(\droneSines).nodeMap.writeArchive("pset1.txt")

//--recall a preset
Ndef(\droneSines).nodeMap= Object.readArchive("pset1.txt")

//--scramble settings
(
Ndef(\droneSines).set(\amp, 0.05);
Ndef(\droneSines).controlKeys.do{|k|
        if(k!=\amp, {
                Ndef(\droneSines).set(k, k.asSpec.map(1.0.rand));
        });};
)

Pages

Subscribe to f0blog RSS