qr-code midlet installer

Nikolaus Gradwohl2009-01-25T14:26:00+01:00

to simplify the installation of my mobileprocessing-sketch i have generated a qrcode-tag that downloads the jad file and installs the midlet on the mobile phone.

simply point a qrcode reader like the one from zxing to the image and click on download

qrcode-random-installer

read more ...

Random numbers with MobileProcessing

Nikolaus Gradwohl2009-01-25T08:14:00+01:00

I wrote my first sketch in MobileProcessing. MobileProcessing is a processing dialect, that can be used to write apps for java-capable mobile phones.

The application can be used to generate random numbers. every key-event shows a new random number.

/**
  a random number generator by
  <a href="http://www.local-guru.net/blog">Guru</a>
*/

PFont font;
int rnd = 0;

void setup() {  
  font = loadFont( FACE_PROPORTIONAL, STYLE_PLAIN, SIZE_LARGE );
  textFont( font );
  textAlign( CENTER );
  fill(0);
  rnd = random(0,100000);
  noLoop();
}

void draw() {
  background(255);
  text( "\n\n\n"+rnd, 0, 0, width, height );
}

void keyPressed() {
  rnd = random(0,100000);
  redraw();
}
read more ...

the first snowdrop

Nikolaus Gradwohl2009-01-24T19:15:00+01:00

today i made a picture of the first snowdrop this year. the picture was shot with my new mobile phone (K550i - has a realy nice 2 megapixel cam with autofocus)

snowdrop

read more ...

switching java-versions in ubuntu

Nikolaus Gradwohl2009-01-23T15:19:00+01:00

to switch between 2 installed versions of the jdk in ubuntu 2 commands are needed:

sudo update-alternatives --config java

is used to choose the java version

sudo update-alternatives --config javac

is used to change the javac version

read more ...

osc sequencer in ruby

Nikolaus Gradwohl2009-01-20T05:29:00+01:00

I wrote a simple osc sequencer in ruby using rosc. The script triggers the drum-kit and the bass i implemented last week.

the pattern may also be of different length. This allows very interesting polyrythmic loops.

require 'osc'
Host = 'localhost'
Port = 3334

c = OSC::UDPSocket.new
hh = OSC::Message.new('/drum', 's', "hh" )
bd = OSC::Message.new('/drum', 's', "bd" )
sn = OSC::Message.new('/drum', 's', "sn" )

ba = OSC::Message.new('/bass', 'i', 64 )


#c.send sn, 0, Host, Port
bpm = 120
step = 1.0/8;
s = bpm * step / 60.0 ;

snd = [ bd, sn, hh ]
pattern = [
[1, 0, 0, 1, 0, 1, 0, 0 ],
[0, 0, 1, 0, 0, 0, 1, 1 ],
[1, 1, 1, 1, 1, 1, 1, 1 ]
]
bass = [
40, 40, 0, 40, 40, 0, 43, 0,
40, 40, 0, 40, 40, 0, 38, 0 ]

count = 0;
while(true)
    (0..2).each { |i|
        c.send(snd[i], 0, Host, Port) if pattern[i][count % pattern[i].length] == 1
    }

    ba.args = [bass[ count % bass.length]]
    c.send( ba, 0, Host, Port ) if bass[ count % bass.length ] != 0

    sleep s
    count+=1
end
read more ...

Processing sketch on fire

Nikolaus Gradwohl2009-01-18T07:50:00+01:00

I just made another little demo in processing. in fact i rewrote a little demo i did 15 years ago in pascal on a dos-box

fire-screenshot

read more ...

modularizing chuck files

Nikolaus Gradwohl2009-01-17T13:11:00+01:00

I wrote a simple chuck script that generates a drum loop and a bass-sequence. later i wanted to reuse the sounds and started to search how to modularize the code.

so i started to convert my instrument declarations in classes. The instrument classes don't get connected to 'dac' directly. They have a "connect"-method that can be used by the main script.

to run the loop all the scripts must be given on the commandline

chuck Bass.ck DrumSet.ck loop.ck

The main script (loop.ck) instanciates a DrumSet and a Bass class and connects them to "dac". Than it generates a walking bass and a simple electronic drum loop.

DrumSet drm;
drm.connect( dac );

Bass bass;
bass.connect( dac );

[ 41, 41, 44, 46] @=> int bline[];
0 => int pos;
0 => int count;

while ( true ) {
    drm.hh();
    if ( count % 2 == 0 ) { drm.bd(); }
    if ( count % 4 == 2 ) { drm.sn(); }

    if ( count % 2 == 0 ) { spork ~ bass.bass( bline[ pos % 4 ]); }
    if ( count % 2 == 1 ) { spork ~ bass.bass( 12 + bline[ pos % 4 ]); }


    1 + count => count;
    if ( count % 4 == 0 ) { 1 + pos => pos; }
    250::ms => now;
}
read more ...

flying with python3.0

Nikolaus Gradwohl2009-01-16T18:48:00+01:00

I recently installed python3. While scanning through the module directory a package named "antigravity" catched my eye.

when i typed "import antigravity" python opend a browser-window with this link

i really like python - and xkcd :-)

read more ...

Visiting the Mailüfterl

Nikolaus Gradwohl2009-01-11T16:10:00+01:00

Today i was visiting the Technical Museum of Vienna and while standing in front of favourite exhibit - the Mailüfterl which is
the first european full transistorized computer - i thought it would be cool to see some code running on this machine.

back home i googled a bit and - tata - someone has written a emulator of the mailüfterl!

Mailüfterl

note: the image is from Wikipedia and was shot by Florian Staudacher and was licenced under Creative Commons Attribution 3.0 Unported

read more ...

download bots - xmas edition

Nikolaus Gradwohl2008-12-28T15:44:00+01:00

a while ago i made some wooden bots while waiting for a download. My family really liked them - so they got our xmas-tree decoration this year :-)

xmasbots

read more ...