visuals

spiral

just some hypnotic graphics...

the javascript code above is this...

<div style="background-color:black;">
<canvas id="can" width="800" height="600"></canvas>
<script>
var width, height;
var ctx, frameCount= 0;
(function() {
    var can= document.getElementById('can');
    ctx= can.getContext('2d');
    width= can.width;
    height= can.height;
    ctx.fillStyle= '#FFF';
    window.requestAnimationFrame(draw);
})();
function draw() {
    ctx.clearRect(0, 0, width, height);
    ctx.save();
    ctx.translate(width*0.5, height*0.5);
    ctx.beginPath();
    var theta= Math.sin(frameCount*0.001)*Math.PI*2*4;
    for(var y= 0; y<height; y++) {
        for(var i= 0; i<10; i++) {
            ctx.rotate(theta*0.001);
            ctx.fillRect((Math.sin(y*0.1+theta+(i*2))*100), y, 2, 2);
        }
    }
    ctx.restore();
    frameCount= frameCount+1;
    window.requestAnimationFrame(draw);
}
</script>
</div>

originally this was a quick sketch made in processing...

//spiral.pde - processing
void setup() {
  size(800, 600);
  noStroke();
}
void draw() {
  background(0);
  translate(width*0.5, height*0.5);
  float theta= sin(frameCount*0.001)*TWO_PI*4;
  for(int y= 0; y<height; y++) {
    for(int i= 0; i<10; i++) {
      rotate(theta*0.001);
      rect((sin(y*0.1+theta+(i*2))*100), y, 2, 2);
    }
  }
}

and then ported to supercollider...

//spiral.scd - supercollider
(
var width= 800, height= 600;
var win= Window("spiral", Rect(100, 100, width, height), false);
var usr= UserView(win, Rect(0, 0, width, height));
usr.background= Color.black;
usr.animate= true;
usr.drawFunc= {
        var theta= sin(usr.frame*0.001)*2pi*4;
        Pen.fillColor= Color.white;
        Pen.translate(width*0.5, height*0.5);
        height.do{|y|
                10.do{|i|
                        Pen.rotate(theta*0.001);
                        Pen.fillRect(Rect(sin(y*0.1+theta+(i*2))*100, y, 2, 2));
                };
        };
};
CmdPeriod.doOnce({win.close});
win.front;
)

more processing tweets

three new processing tweets...

//--0021

int s=900,i;void setup(){size(1200,s);strokeWeight(99);}void draw(){stroke(9,9);ellipse(i++%1200,millis()%750+99,i%s/350.,(20+i)%99);}// #p5

//--0022

int j,i;void setup(){size(1024,768);}void draw(){translate(512,384);i=frameCount;while(i-->1){rect(j++%i,j%i,3,i/9%9);rotate(0.009);}}// #p5

//--0023

float j=433,i=9e3;size(1024,768,P3D);fill(9,99);beginShape();while(i>0){vertex(sin(i--/99)*j+j,sin(i/j/8)*j*2,cos(i*2)*j);}endShape();// #p5

p50021
p50022
p50023

and more previously

p5 tweets

constrains - i love them. inspired by abe's twitter experiments, i've also played with creating small one line processing programs that are 140 characters long.

below is a video of number 0002, the twitter code tweets and screenshots. note that many but not all are animations. copy and paste the lines into processing (2.0) to try them out.

p5tweet0002 from redFrik on Vimeo.

//--0001

int i;noStroke();size(999,900);for(i=0;i<999;i++){fill(255,0,0,9);rect(i%99,i,i,i);}for(i=0;i<999;i++){fill(0,200,0,3);rect(i,i,i,i);}// #p5

//--0002

int j,i=0;void setup(){size(1200,900,P3D);frameRate(999);}void draw(){for(j=0;j<99;)rect(i++%(1199-j++),int(i/99)%(999-j),i%12,j%16);}// #p5

//--0003

int s=900,j,i=j=0;void setup(){size(s,s);fill(0,9);textSize(80);}void draw(){text(i+j,(sin(i++)/3+0.3)*s,(cos(j+++(i/4e3))/3+0.5)*s);}// #p5

//--0004

int s=900,j,i=j=0;void setup(){size(s,s);stroke(255,9);fill(9,3);}void draw(){quad(i++,j++,j,i,s-i,i-50,s-j,j);i=(i<<j%4)%1200;j=j%s;}// #p5

//--0005

int s=900,i=0;void setup(){size(s,s,P3D);stroke(255,0,0);fill(10,4);}void draw(){translate(i++%s,s/2);rotate(float(i)/s);sphere(i%s);}// #p5

//--0006

int s=900;float i=0;void setup(){size(s,s,P3D);stroke(99,9);fill(0,2);}void draw(){translate(i++%s,s/2);rotate(cos(i/50));box(i%s/3);}// #p5

//--0007

background(0);noStroke();for(float i=0;i<99;i=i+0.0252){size(1200,900,P3D);fill(255,0,0,60);translate(i+9,i);rotate(i*1.8);sphere(i);}// #p5

//--0008

void setup(){size(1600,900);background(255);}void draw(){textSize(millis()%1200);fill(second()*4,0,0,second());text(millis(),10,880);}// #p5

//--0009

float j,i=0;void setup(){size(1200,900,P3D);}void draw(){for(j=0;j<133;j++){rect(9*j+1,sin((i+++j)*0.75/cos(j/99)/5e3)*99+450,9,9);};}// #p5

//--0010

float i,k=450;void setup(){size(900,900,P3D);textSize(k);}void draw(){translate(k,k);fill(i%1*k/2,60);rotate(i+=+.01);text("$",99,0);}// #p5

//--0011

int i,j,k=1200;void setup(){size(k,900);fill(255,200);}void draw(){background(0);for(i=0;i<8e3;)text(i++*j/k%k,i%131*9,i/131*16);j++;}// #p5

//--0012

int j=200,i=900;size(j*6,i,P3D);lights();translate(700,540);for(i=1;i<j;){fill(i/2,50);rotate(j/i);translate(i,i,-2.7);sphere(i+++j);}// #p5

//--0013

int j=480,i=900;size(j*3,i,P3D);noStroke();lights();translate(660,j);for(i=1;i<j;){fill(i,0,0,10);rotate(i/4e4,1.1,2.2,3.3);box(i++);}// #p5

//--0014

int s=900,i=0;void setup(){size(1200,s,P3D);}void draw(){translate(600,450);rotateX(i*.0021);fill(i++%256,30);sphere(sin(i*.0014)*s);}// #p5

//--0015

int i,s=900;void setup(){size(s,s);frameRate(1e4);stroke(255,25);}void draw(){fill(i++%89,0,0,127);rect(i%90*9,i%91*9,i*i%92,i*i%93);}// #p5

//--0016

int i,s=900,t=1200;void setup(){size(t,s);noStroke();}void draw(){fill(i++%256,25);quad(i%t,i/3%s,i/4%t,i%s,i/5%t,i/4%s,i/3%t,i/2%s);}// #p5

//--0017

int t=0;void setup(){size(900,900);background(0);stroke(255,9);}void draw(){translate(450,450);line(sin(t)*421,cos(t++)*400,t%9,t%9);}// #p5

//--0018

int s=900;size(1600,s);fill(255,9);while(s>9){rotate(1e-3);arc(s+420,s,s,s,0,7);arc(1000-s,s+100,s,s,0,7);arc(s+500,400-s,s,s--,0,4);}// #p5

//--0019

int i,j,s=900;void setup(){size(s,s,P3D);smooth(8);}void draw(){stroke(i);line(i,j,s-j,i);if(j%5<1){i=(i+1)%s;}if(i%11<1){j=(j+i)%s;}}// #p5

//--0020

int s=900;void setup(){size(1200,s,P3D);}void draw(){fill(s,50);translate(sin(s)*110+600,cos(s)*99+450);rotate(s);box(s);s=(s+1)%900;}// #p5

p5tweet0001p5tweet0002p5tweet0003p5tweet0004p5tweet0005p5tweet0006p5tweet0007p5tweet0008p5tweet0009p5tweet0010p5tweet0011p5tweet0012p5tweet0013p5tweet0014p5tweet0015p5tweet0016p5tweet0017p5tweet0018p5tweet0019p5tweet0020

cheap 4-channel videoplayer

for the dance piece ich(a) by zufit simon i constructed a system with four raspberry pi mini-computers and buttons to trigger playback of four video streams. as the videos didn't need to run in exact frame-by-frame sync, this was a very cheap way to get four channel high-quality video playback. total cost was about (rpi 28*4)+(sdcard 6*4)+(5v power 1*7) ≈ 141 euro. i chose the model A of the raspberry pi to keep the cost and power consumption down. the four computers share a 5v power supply of 2 amps and are powered over the gpio pins. video cables run 50 meters down to the stage and in to separate flat screen monitors. the monitors are built in to boxes that can be piled up or rolled around independently.

the videos are stored on the 4GB sd cards that also holds the linux operating system. i converted the videos from dvd to mp4 using ffmpeg with the following settings...

ffmpeg -i concat:"/Volumes/MONITOR01_may2012_DVD/VIDEO_TS/VTS_01_1.VOB|/Volumes/MONITOR01_may2012_DVD/VIDEO_TS/VTS_01_2.VOB" -an -vcodec libx264 -profile:v high -preset fast -crf 18 -b-pyramid none -f mp4 MONITOR01_may2012.mp4

that'll take two chapters and convert to a single mp4 and skip the sound track (-an flag).

the python program running on each computer is here below. it plays a video to the end and waits for a button trigger. if a button is pressed before the video is finished, it'll stop and jump to the next video - all in a cyclic fashion.

#f0videoplayer.py
#for a raspberry pi running raspbian
#this script will cycle through videos in sequence when a GPIO pin is grounded

#pinSwi (pulled up internally) - gnd this pin to switch to the next video
#pinOff (pulled up internally) - gnd this to shut down the system

#--settings
videos= ['/home/pi/ICHA1.mp4', '/home/pi/MONITOR01_may2012.mp4', '/home/pi/BLACK.mp4', '/home/pi/FLESH.mp4', '/home/pi/TESTBILDER.mp4']
delays= [0, 0, 0, 0, 0] #extra start delay time in seconds - one value for each video
pinSwi= 23
pinOff= 24

#--
import pexpect
from time import sleep
import RPi.GPIO as GPIO
import os
GPIO.setmode(GPIO.BCM)
GPIO.setup(pinSwi, GPIO.IN, pull_up_down= GPIO.PUD_UP)
GPIO.setup(pinOff, GPIO.IN, pull_up_down= GPIO.PUD_UP)

def main():
        os.system("clear && tput civis")        #clear and hide cursor
        index= 0        #keeps track of which video to play
        while True:
                sleep(delays[index])
                omx= pexpect.spawn('/usr/bin/omxplayer -rp '+videos[index])
                omx.expect('Video')     #play
                while(GPIO.input(pinSwi)==True):
                        sleep(0.1)
                        if GPIO.input(pinOff)==False:
                                omx.send('q')   #quit
                                os.system("tput cnorm && sudo halt")
                                exit()
                omx.send('q')   #quit
                sleep(0.5)              #safety
                while(GPIO.input(pinSwi)==False):
                        sleep(0.01)
                index= (index+1)%len(videos)

if __name__ == "__main__":
        main()

//----------------------------
//--instructions for installing (you'll need a model B to prepare a sd-card, but then move it over to the model A raspberry)

//--prepare the rpi
* use Pi Filler to transfer 2013-05-25-wheezy-raspbian.img to the sdcard
* put the sdcard in rpi model B
* select 'Expand Filesystem' in and enable SSH under advanced in config menu
* select 'Finish' and reboot
* log in with pi/raspberry
* sudo apt-get update
* sudo apt-get upgrade
* sudo apt-get install python-pexpect avahi-daemon

//--copy files from osx
* open a terminal window on main computer
* cd to folder with videos
* edit the file f0videoplayer.py and select which videos to use
* optionally add delaytimes if some videos should start later
* scp f0videoplayer.py MONITOR01_may2012.mp4 ICHA1.mp4 BLACK.mp4 FLESH.mp4 TESTBILDER.mp4 pi@raspberrypi.local:/home/pi/

//--back to model B
* sudo pico /etc/rc.local
* add the following before the exit line: (sleep 1; python /home/pi/f0videoplayer.py) & # autostart video player
* press ctrl+o to save and ctrl+x to exit
* sudo halt

//--start model A
* take out the sdcard from model B and put it in model A
* connect hdmi or composite video, gpio pins and apply power - the first video should start
* ground pin 23 to cycle through the videos
* ground pin 24 to turn off the computer

//----------------------------
//--useful commands (connect keyboard to rpi model A, type pi/raspberry to log in)
sudo pkill omxplayer.bin     #might need to write this without the terminal being visible

if you get "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!"
ssh-keygen -R raspberrypi.local     #useful for resetting ssh/scp after changing sd cards

it's not pretty but it's working. some day i'll build it in to a real rackmount box.

//--references:
http://www.raspberrypi-spy.co.uk/2013/06/playing-videos-on-the-raspberry-pi-command-line
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=38&t=47520

ström

since the category 'visuals' is underrepresented in this blog and i don't like to embed video in my standard [html] pages, i thought i'd include this old piece here. this is the shorter abridged version of the full piece. the quality isn't the best - it's pixelated and stuttering. one day i should re-render it in 60fps at a higher resolution. it looks a lot better when running in realtime from a computer.

Ström by Mattias Petersson (music) and Fredrik Olofsson (video) is, in its full version, a 45 minute minimalistic piece for five loudspeakers, live-electronics and live-video, based on an open-minded, artistic approach towards electricity. The piece is an attempt to transfer electric currents via sound to the audience. The five speakers in the surround system struggles to take over the sonic stream like electro-magnets. Sine waves and noise rotates with breakneck speeds around the listeners, tries to charge them with static electricity and, as an ultimate goal, even make them levitate. The video part is in direct connection with the sound and is generated out of five discrete lines – one for each channel in the surround system. The lines are treated in different ways, and as the high voltage builds up in the music they look more and more like electric wires, inflicting each other with violent discharges and eruptions. This version was made for a promotional DVD release on Swedish sound art.

also see here

pact - februari

another 30days of daily experiments. this time with cairo 2d and cinder + supercollider for sound. one very simple sketch per day to learn.

update 120212: i ported them all to processing. see _here
update 120617: rendered 1min mp3 excerpts. attached below under the code snippets.

 

//--pakt29
osx binary
c++ code
processing

Ndef(\wrap).play
(
Ndef(\wrap, {var n= 29; Splay.ar({|i|
        var w= i+LFSaw.ar(i+1*SinOsc.ar(0.1, i/n*2pi, 1, 0.1), 0, 2, 2);
        Saw.ar(340+LFSaw.ar(0.1, i/n, 10, 10).round(20)+i)%Saw.ar(60+w, SinOsc.ar(0.01, i/n*2pi, 2, 2.05))*0.25;
}!n)});
)
Ndef(\wrap).stop


 

//--pakt28
osx binary
c++ code
processing

Ndef(\round).play
(
Ndef(\round, {var n= 28; GVerb.ar(Limiter.ar(LeakDC.ar(Mix({|i|
        var z= SinOsc.ar(i.linexp(0, n-1, 70, 1500), LFSaw.ar(i+1*5, 0, 0.5pi), LFSaw.ar(0.2+SinOsc.ar(i+1*0.001, 0, 0.5), i/n, 0.4).max(0))*SinOsc.ar(200+i, 0, SinOsc.ar(0.03, i+1, 0.5, 1))*SinOsc.ar(400+i, 0, SinOsc.ar(0.04, i+2, 0.5, 1))*SinOsc.ar(800+i, 0, SinOsc.ar(0.05, i+3, 0.5, 1));
        Pan2.ar(z, i.linlin(0, n-1, -0.925, 0.925), 1/n);
}!n))), 3, 5, 0.2, 0.8, 20, 0.1)});
)
Ndef(\round).stop


 

//--pakt27
osx binary
c++ code
processing

Ndef(\sweep).play
(
Ndef(\sweep, {var n= 9; GVerb.ar(Mix({|i|
        var t= i/n;
        var t2pi= t*2pi;
        var f= 2**i*10+100;
        var z= LeakDC.ar(VarSaw.ar(SinOsc.ar(i+1*0.005, SinOsc.ar(i+1*SinOsc.ar(0.05, t2pi, 0.2, 0.4), 0, 2pi), f*SinOsc.ar(0.002, t2pi, 0.3, 0.5), f), t, SinOsc.ar(i+1*0.006, t2pi, 0.4, 0.5), i.linlin(0, n-1, 0.4, 0.1)));
        Pan2.ar(z, SinOsc.ar(0.015, t2pi, i.linlin(0, n-1, 0.99, 0.2)), 1/n);
}!n), 30, 5, 0.3, 0.8, 10)});
)
Ndef(\sweep).stop


 

//--pakt26
osx binary
c++ code
processing

Ndef(\grid).play
(
Ndef(\grid, {var n= 8; Mix({|i|
        var t= i/n;
        var z= LeakDC.ar(VarSaw.ar(SinOsc.ar(VarSaw.ar(i+1*VarSaw.ar(0.048, 0, 0.5, 25, 150), t, 1/3, 150), VarSaw.ar(100+i, t, VarSaw.ar(0.024, t, 0.25, 0.475, 0.5))*pi, VarSaw.ar(0.012, t, 0.75, VarSaw.ar(0.064, t, 0.5, 25, 50), 200), VarSaw.ar(0.16, t, 2/3, VarSaw.ar(0.02, t, 0.5, 7.5).abs, 300)), t));
        Pan2.ar(z, VarSaw.ar(0.02, t, 0.5), 1/n);
}!n)});
)
Ndef(\grid).stop


 

//--pakt25
osx binary
c++ code
processing

Ndef(\wobble).play
(
Ndef(\wobble, {var n= 5; Mix({|i|
        var z= SinOsc.ar(0, SinOsc.ar(60+(i*SinOsc.ar(0.004, 0, 0.8, 1)), i/n*2pi, SinOsc.ar(0, SinOsc.ar(1, 0, 2pi), SinOsc.ar(0.006), 2pi)), 1/n);
        Pan2.ar(z, z);
}!n)});
)
Ndef(\wobble).stop


 

//--pakt24
osx binary
c++ code
processing

Ndef(\swoop).play
(
Ndef(\swoop, {var n= 24; Mix({|i|
        var t= i/n;
        var f= SinOsc.ar(0.01, t*0.5pi).exprange(i*22+100, i*44+1000);
        var a= SinOsc.ar(0.05*t, t*2pi, 0.15).max(0);
        var z= RLPF.ar(GrayNoise.ar(a), f*(a+1), 1.4-a-t);
        Pan2.ar(z, LFTri.ar(0.05, t*4, 0.95));
}!n)});
)
Ndef(\swoop).stop


 

//--pakt23
osx binary
c++ code
processing

Ndef(\sway).play
(
Ndef(\sway, {var n= 23; LeakDC.ar(Splay.ar({|i|
        var t= i/n;
        var f= t.linexp(0, 1, LFTri.ar(0.04, t*4, 400, 600), LFTri.ar(0.03, t*4, 400, 600));
        var a= SinOsc.ar(SinOsc.ar(0.02, t*pi, 0.5), 0, 0.5).max(0);
        SinOsc.ar(f+SinOsc.ar(f, 0, f*a), LFTri.ar(SinOsc.ar(t+0.01, t, 20), t*4, 4pi), a)
       
}!n))});
)
Ndef(\sway).stop


 

//--pakt22
osx binary
c++ code
processing

Ndef(\blob).play
(
Ndef(\blob, {var n= 33; Mix({|i|
        var t= i/n*2pi;
        Pan2.ar(
                LeakDC.ar(SinOsc.ar(Pulse.ar(0.0625, 2/3).range(0.0625, 0.125), SinOsc.ar(Pulse.ar(i+1, Pulse.ar(i+1*0.125, 0.4, 1/3, 0.5), i+1*n, i+1*n*2), t, SinOsc.ar(SinOsc.ar(0.0625, t), t, 2pi)), SinOsc.ar(i+1*0.125, t, i.linexp(0, n-1, 3/n, 0.001)))),
                SinOsc.ar(0.125, t, i.linlin(0, n-1, 0, 0.95))
        )
}!n)});
)
Ndef(\blob).stop


 

//--pakt21
osx binary
c++ code
processing

Ndef(\flush).play
(
Ndef(\flush, {var a= {|i| 2.pow(i)}!7; Mix(
        Pan2.ar(
                Resonz.ar(SinOsc.ar(0, GrayNoise.ar(a*30*pi), 0.5), a*300, SinOsc.ar(a*0.13, 0, 0.4, 0.5)),
                SinOsc.ar(a*0.03, 0, 0.95)
        )
)});
)
Ndef(\flush).stop


 

//--pakt20
osx binary
c++ code
processing

Ndef(\veil).play
(
Ndef(\veil, {var n= 15; GVerb.ar(Mix({|i|
        var t= i/n*2pi;
        var f= SinOsc.ar(SinOsc.ar(i*0.015+0.015, t), t);
        var a= SinOsc.ar(f*SinOsc.ar(i*0.15+0.15, t, 0.15, 0.3), t, 150, 300);
        var b= SinOsc.ar(f*SinOsc.ar(i*0.15+0.15, t, 0.15, 0.5), t, 1500, 3000);
        Pan2.ar(
                BPF.ar(
                        Saw.ar(SinOsc.ar(f, t).exprange(a, b), SinOsc.ar(f, t, SinOsc.ar(0.015*t+0.15, t, 0.15).max(0))),
                        a+b*0.5,
                        0.15
                ),
                i/(n-1)*2-1
        );
}!n), 15, 1.5, 0.15)});
)
Ndef(\veil).stop


 

//--pakt19
osx binary
c++ code
processing

Ndef(\bubbles).play
(
Ndef(\bubbles, {var n= 6;
        GVerb.ar(Mix({|i|
                var q= i/n*2pi;
                var t= Impulse.ar(SinOsc.ar(SinOsc.ar(0.125, q, 0.5), 0, 1.5, 2), i/n);
                Pan2.ar(
                        SinOsc.ar(
                                SinOsc.ar(0.01, q, SinOsc.ar(0.05, q, 50), 500),
                                Decay2.ar(t, 0.02, 0.2, SinOsc.ar(0.05, q, SinOsc.ar(0.01, 0, 8pi, 8pi))),
                                Decay2.ar(t, TRand.ar(0.003, 0.03, t), TRand.ar(0.05, 0.1, t), SinOsc.ar(0.08, q, 0.2, 0.05).max(0))
                        ),
                        (i/(n-1))*2-1
                );
        }!n), 40, 2, 0.6);
});
)
Ndef(\bubbles).stop


 

//--pakt18
osx binary
c++ code
processing

Ndef(\grey).play
(
Ndef(\grey, {Mix({|i|
        var t= Impulse.ar(SinOsc.ar(0.1+(i*0.125), i/10*2pi+#[0, 0.1], 4, SinOsc.ar(0.01+(i*0.01), 0, 4, 12)));
        Pan2.ar(
                FreeVerb.ar(
                        BPF.ar(
                                GrayNoise.ar(
                                        Decay2.ar(
                                                t,
                                                TRand.ar(0.005, 0.015, t),
                                                TRand.ar(0.1, 0.15, t),
                                                TRand.ar(0.35, 0.5, t)
                                        )
                                ),
                                SinOsc.ar(i+1*0.032, #[0, 0.1]+i).exprange(i+1*300, i+1*600),
                                SinOsc.ar(i+1*0.025, #[0, 0.1]+i).range(0.1, 1)
                        ),
                        0.3
                ),
                SinOsc.ar(0.1, #[0, 0.1]+i, 0.9)
        );
}!10)});
)
Ndef(\grey).stop


 

//--pakt17
osx binary
c++ code
processing

Ndef(\shades).play
(
Ndef(\shades, {Mix({|i|
        var x= SinOsc.ar(0, SinOsc.ar(0.01*i+0.03, i, 2pi));
        var y= SelectX.ar(x.range(0, 4), [WhiteNoise.ar, GrayNoise.ar, PinkNoise.ar, BrownNoise.ar]);
        var z= Pan2.ar(y, x*0.4);
        BPF.ar(Rotate2.ar(z[0], z[1], i/3*2-1), i+1*500, SinOsc.kr(0, SinOsc.ar(i*0.02+0.01, i, pi)).range(1, 10), 0.3);
}!4)});
)
Ndef(\shades).stop


 

//--pakt16
osx binary
c++ code
processing

Ndef(\wheel).play
(
Ndef(\wheel, {Splay.ar(BPF.ar(PinkNoise.ar(1!3)*SinOsc.ar(VarSaw.ar(#[0.011, 0.012, 0.013], #[0, 0.1, 0.2], 0.5, VarSaw.ar(#[0.01, 0.02, 0.03], #[0, 0.1, 0.2]).exprange(5, 50), #[300, 303, 309]), CombN.ar(Saw.ar(#[3, 2.5, 1], 0.5pi).sum, 0.05, 0.05), 3), VarSaw.ar(#[0.021, 0.022, 0.023], #[0.2, 0.1, 0.3]).exprange(500, 2000), VarSaw.ar(#[0.031, 0.032, 0.033], #[0, 0.1, 0.2]).exprange(0.06, 0.6)))});
)
Ndef(\wheel).stop


 

//--pakt15
osx binary
c++ code
processing

Ndef(\spin).play
(
Ndef(\spin, {GVerb.ar(Mix(Pan2.ar(Formlet.ar(LPF.ar(Saw.ar((5..1)*LFPulse.ar(SinOsc.ar(0.1, 0, 0.5, 1), 0.5, 0.5, 10, 50)+SinOsc.ar((6..2)*0.05).exprange(0.05, 50), 0.3), 300)+Impulse.ar((0..4)+SinOsc.ar((4..8)*0.02).exprange(0.3, 300)), (1..5)*SinOsc.ar((5..9)*0.05).exprange(200, 2000)*SinOsc.ar(SinOsc.ar((2..6)*0.1, 0, 0.1), 0, 0.1, 1), 0.001, 0.0015), SinOsc.ar(SinOsc.ar((3..7)*0.1, 0, 0.1)))))});
)
Ndef(\spin).stop


 

//--pakt14
osx binary
c++ code
processing

Ndef(\interfere).play
(
Ndef(\interfere, {var a= #[3, 1, 5, 2]; Limiter.ar(Splay.ar(Formlet.ar(LFPulse.ar(a*100+SinOsc.ar(a, 0, a/20), 0, SinOsc.ar(a/10, 0, 0.45, 0.5), LFPulse.ar(a+a, 0, SinOsc.ar(a/10, 0, 0.45, 0.5), 0.1)), a*100+LFPulse.ar(a/2, 0, 0.5, a*SinOsc.ar(a/100, 0, 150, 200)), SinOsc.ar(a/30, 0, 0.01, 0.0125), SinOsc.ar(a/60, 0, 0.05, 0.055), 0.2)))});
)
Ndef(\interfere).stop


 

//--pakt13
osx binary
c++ code
processing

Ndef(\pulse).play
(
Ndef(\pulse, {GVerb.ar(Splay.ar(Resonz.ar(LFPulse.ar(#[121, 232, 343]), LFPulse.ar(#[0.121, 0.232, 0.343]).exprange(LFPulse.ar(#[12.1, 23.2, 34.3]).range(80, 100), LFPulse.ar(#[1.21, 2.32, 3.43].reverse).range(800, 1000)).sum*LFPulse.ar(#[0.121, 0.232, 0.343]).range(0.5, 1), 0.3, 0.15)), 34, 3, 0.2)});
)
Ndef(\pulse).stop


 

//--pakt12
osx binary
c++ code
processing

Ndef(\waves).play
(
Ndef(\waves, {var n= 3; Mix({|i|
        var z= VarSaw.ar(i+1*0.01, 0, 0.5, 5, VarSaw.ar(i+1*10, 0, 0.5, 0.5, 10));
        var w= VarSaw.ar(i+1*VarSaw.ar(i+1*0.001, 0, 0.5, z, z*z), 0, 0.5, 0.5, 0.5);
        Pan2.ar(
                SinOsc.ar(0, VarSaw.ar(i+1*w*100, 0, w, 2pi), VarSaw.ar(i+1*w*0.1, 0, w, 0.5)),
                i.linlin(0, n-1, -0.9, 0.9),
                2/n
        )
}!n)});
)
Ndef(\waves).stop


 

//--pakt11
osx binary
c++ code
processing

Ndef(\hail).play
(
Ndef(\hail, {Splay.ar(Ringz.ar(SinOsc.ar(#[0.000101, 0.000202, 0.000303, 0.000404, 0.000505, 0.000606], SinOsc.ar(#[101, 202, 303, 404, 505, 606], 0, SinOsc.ar(#[0.0101, 0.0202, 0.0303, 0.0404, 0.0505, 0.0606], 0, pi)))*VarSaw.ar(#[1.01, 2.02, 3.03, 4.04, 5.05, 6.06], #[0.101, 0.202, 0.303, 0.404, 0.505, 0.606], SinOsc.ar(#[0.00101, 0.00202, 0.00303, 0.00404, 0.00505, 0.00606], 0, 0.5, 0.5)), #[1010, 2020, 3030, 4040, 5050, 6060], SinOsc.ar(#[10.1, 20.2, 30.3, 40.4, 50.5, 60.6], 0, 0.1, 0.2), 0.2))});
)
Ndef(\hail).stop


 

//--pakt10
osx binary
c++ code
processing

Ndef(\rain).play
(
Ndef(\rain, {
        var n= 30;
        Mix({|i|
                var z= SinOsc.ar(i+1*0.01, 0, 0.001);
                var f= i*100+100+SinOsc.ar(0.0123+z, i/n*2pi).exprange(1, 30);
                var q= SinOsc.ar(0.0234+z, i/n*2pi, 0.3, 0.7);
                var p= SinOsc.ar(0.0345+z, i/n*2pi);
                var a= SinOsc.ar(0.0456+z, i/n*2pi, 0.4, 0.45);
                var x= HPF.ar(BPF.ar(HPF.ar(ClipNoise.ar(2)*Crackle.ar(SinOsc.ar(0.0123+z, i/n*2pi, 0.1, 1.8))), f, q));
                Pan2.ar(x, p, a);
        }.dup(n));
});
)
Ndef(\rain).stop


 

//--pakt09
osx binary
c++ code
processing

Ndef(\snow).play
(
Ndef(\snow, {
        Mix({|i|
                var m= SinOsc.ar(0.005, i/5*2pi, 2pi);
                var p= WhiteNoise.ar(SinOsc.ar(i*5000+5000)*SinOsc.ar(i*500+500)*SinOsc.ar(i*50+50)*SinOsc.ar(i*5+5));
                Pan2.ar(SinOsc.ar(p, p*m, p), p, 0.5);
        }.dup(5));
});
)
Ndef(\snow).stop


 

//--pakt08
osx binary
c++ code
processing

Ndef(\redqueen3).play
(
Ndef(\redqueen3, {GVerb.ar(LeakDC.ar(
        Saw.ar(
                Saw.ar([100, 101]+Saw.ar([102, 103], Saw.ar([4, 5], Saw.ar([1, 2], 6, 7).sum).sum).sum).exprange(Saw.ar(1/12, 4, 50), Saw.ar(1/8, 3, Saw.ar(1/16, 4, 65))),
                Saw.ar([21, 20], Saw.ar([40, 41], 0, 0.1), 0.2)
        )), 60, 4, 0.5, 0.5, 5, 0.5, 0.5, 0.75)});
)
Ndef(\redqueen3).stop


 

//--pakt07
osx binary
c++ code
processing

Ndef(\redqueen2).play
(
Ndef(\redqueen2, {GVerb.ar(LeakDC.ar(
        SinOsc.ar(
                SinOsc.ar(
                        SinOsc.ar(
                                SinOsc.ar(
                                        SinOsc.ar(
                                                SinOsc.ar(
                                                        SinOsc.ar(
                                                                1,
                                                                0,
                                                                2,
                                                                SinOsc.ar(1/2).exprange(1, 2)
                                                        ),
                                                        0,
                                                        8,
                                                        SinOsc.ar(1/4).exprange(4, 8)
                                                ),
                                                0,
                                                32,
                                                SinOsc.ar(1/8).exprange(16, 32)
                                        ),
                                        0,
                                        128,
                                        SinOsc.ar(1/16).exprange(64, 128)
                                ),
                                0,
                                512,
                                SinOsc.ar(1/32).exprange(256, 512)
                        ),
                        0,
                        2048,
                        SinOsc.ar(1/64).exprange(1024, 2048)
                ), 0, 0.1)
        ), 16, 8, 0.75, 0.5)});
)
Ndef(\redqueen2).stop


 

//--pakt06
osx binary
c++ code
processing

Ndef(\redqueen).play
(
Ndef(\redqueen, {GVerb.ar(LeakDC.ar(SinOsc.ar(SinOsc.ar([1/16, 1/12], 0, 5), SinOsc.ar(0, SinOsc.ar([SinOsc.ar(3, 0, 5, 12), SinOsc.ar(4, 0, 4, 16)], SinOsc.ar([SinOsc.ar(1/64, SinOsc.ar(0.5, 0, pi)).exprange(1, 30), SinOsc.ar(1/48, SinOsc.ar(0.75, 0, pi)).exprange(1, 30)], SinOsc.ar(SinOsc.ar(1/32, 0, 4), 0, 2pi), SinOsc.ar([1/6, 1/8], 0, 0.5pi, 2pi)), SinOsc.ar([1/3, 2/3], 0, 0.5pi, SinOsc.ar(1/8, 0, 0.5pi, 2pi))), SinOsc.ar([4/3, 3/4], 0, 0.5pi, SinOsc.ar([SinOsc.ar(1/256).exprange(80, 800), SinOsc.ar(1/256).exprange(80.8, 808)], 0, 0.5pi, 2pi)))))*0.05, 10, 3, 0.5, 0.5)});
)
Ndef(\redqueen).stop


 

//--pakt05
osx binary
c++ code
processing

Ndef(\noises).play
(
Ndef(\noises, {
        var freq= SinOsc.ar(SinOsc.ar((4..0)/150+SinOsc.ar((0..4)/18, 0, 0.8)), SinOsc.ar((0..4)/80+SinOsc.ar((0..4)/20, 0, 0.1), 0, 2pi)).exprange(100, 1000);
        var rq= SinOsc.ar(SinOsc.ar((0..4)/6+SinOsc.ar((0..4)/19, 0, 0.7), SinOsc.ar((4..0)/5+SinOsc.ar((4..0)/2, 0, 0.1), 0, 2pi))).exprange(0.4, 4);
        Splay.ar(BPF.ar(BPF.ar(ClipNoise.ar(1!5), freq, rq), freq, rq), 0.85);
});
)
Ndef(\noises).stop


 

//--pakt04
osx binary
c++ code
processing

Ndef(\lines).play
(
Ndef(\lines, {Splay.ar(LeakDC.ar(SinOsc.ar([0.033, 0.066, 0.055, 0.044], SinOsc.ar([0.12, 0.13, 0.11, 0.14]*SinOsc.ar([0.151, 0.152, 0.153, 0.154], SinOsc.ar([5, 4, 3, 2], 0, 2pi), SinOsc.ar([0.043, 0.053, 0.063, 0.073], 0, [80, 60, 40, 100])), SinOsc.ar(([60, 64, 67, 71]+SinOsc.ar([0.024, 0.025, 0.026, 0.027], SinOsc.ar([0.01, 0.02, 0.03, 0.04], 0, pi), 1).round).midicps, 0, 2pi)), 0.2)))})
)
Ndef(\lines).stop


 

//--pakt03
osx binary
c++ code
processing

Ndef(\varsaws).play
(
Ndef(\varsaws, {GVerb.ar(CombC.ar(VarSaw.ar(SinOsc.ar([0.1, 0.11], 0, 5, 100+SinOsc.ar([0.05, 0.055], 0, 50, 50).round(50)), 0, SinOsc.ar([0.2, 0.22], 0, 0.5, SinOsc.ar([0.3, 0.33], 0, 0.1, 0.5)), 0.1), 1.01, SinOsc.ar([0.4, 0.44], 0, 0.01, 1), 8), 80, 5, 0.9)})
)
Ndef(\varsaws).stop


 

//--pakt02
osx binary
c++ code
processing

Ndef(\saws).play
(
Ndef(\saws, {Splay.ar(BPF.ar(LeakDC.ar(Saw.ar(SinOsc.ar((0..5)+1*0.02, SinOsc.ar((0..5)+1*101+300, 0, 2pi+SinOsc.ar(0.01, 0, 0.5*pi)), 400, 700))), SinOsc.ar((0..5)+1*0.004, 0, 100, 400), SinOsc.ar((0..5)+1*0.006, 0, 0.4, 0.8)))})
)
Ndef(\saws).stop


 

//--pakt01
osx binary
c++ code
processing

Ndef(\moreSines).play
(
Ndef(\moreSines, {LeakDC.ar(Splay.ar(SinOsc.ar((0..20)/70+0.01, SinOsc.ar((0..20)+1*50+50+SinOsc.ar((0..20)+1/30), 0, 2pi), SinOsc.ar((0..20)+1/80, (0..20)/40, 0.2).max(0))))})
)
Ndef(\moreSines).stop


 

//--pakt00
osx binary
c++ code
processing

Ndef(\sines).play
(
Ndef(\sines, {GVerb.ar(Splay.ar(SinOsc.ar([100, 200, 300]+SinOsc.ar([0.11, 0.22, 0.33]), SinOsc.ar([0.1, 0.2, 0.3], 0, 2pi), 0.1+SinOsc.ar([0.01, 0.02, 0.03], 0, 0.05)), SinOsc.ar(SinOsc.ar(SinOsc.ar(0.13, 0, 5, 6), 0, 8, 50), 0, 1, 1), 0.7, SinOsc.ar(1.2, 0, 0.6)), 20, 5, 1, 0.5, 25, 0, 1, 1)})
)
Ndef(\sines).stop


red-framework published on googlecode

in june i cleaned up and released my red-framework for managing max/jitter patches. it is hosted here and you can get it via anonymous svn checkout.

the framework is for stacking, chaining and mixing max/jitter patches and shows my way of organising patches. i've been working on/with it since 2006 and it now contains >100 modules. it can handle jitter, control data, midi and also softvns video under max4.5.

welcome to join the project if you are interested. it is easy to write your own modules.

installation...

(for osx 10.4 and earlier you'll first need to install svn separately)
in the terminal type:

svn checkout http://red-framework.googlecode.com/svn/trunk/ red-framework-read-only

then press (p) to accept permanently.
last add the red-framework folder to max's file preferences.

it is licensed under gnu gpl v2 and requires max5+jitter for osx. it has not been tested on windows xp yet but should run.

concept...

modules: generators, modulators, outputs
faders: cross, gain, etc.
slots = module+fader
chain = slots in series
stack = slots in parallel
mixer = go from parallel to serial

//--module:
a max/jitter patch following a simple standard
it must have 2 inlets: in, ctrl
and 2 outlets: out, info
the module can be generator, modulator or output

//--slot:
a slot is a fader + a module
slots also have 2 inlets: in, ctrl
and 2 outlets: out, info

//--stack:
builds a stack of slots - serial in and parallel out

//--chain:
builds a chain of slots - serial in and serial out

//--mixer:
a mixer of slots - parallel in and serial out

pros and cons...

why use red-framework?
same for jitter, midi, controldata, softvns
reusable patches
generalised and efficient

i have made various bigger performance patches using red-framework
special gui/bpatchers for stacks, chains, mixers

drawbacks?
only discrete events - no msp
no opengl or shaders
too complicated to perform with
went back to my old os9 patch
eg. learning the effect chain - not re-ordering!

Pages

Subscribe to RSS - visuals