Processing, monomic and shado updates…

…mostly with Processing including the monomic library and Nick Rothwell’s shado…

light_wave_virtual_500px

Processing

1. Light Wave Virtual

I’ve moved this on a fair way and now have a patch which effectively recreates the physical piece – albeit in ‘wireframe’ – and lets me change the overall wavelength and amplitude and the width, length and space between each strip via keydown – as well as shifting the x, y and z point of view via the camera. It still needs a bit more refinement… but is coming along nicely.

2. Mirror2

Daniel Jones introduced me to the idea of creating a class for presets – and so by extrapolating from his quick but working example I now have the ability to save and load presets – actually I’ve implemented a code loop to save presets from the space bar to keys 1-9 (this only works because their keyCodes are 49-57 successively – so its a bit of a bodge).

I’ve also been attempting to implement mirroring on the y axis as well as reflections, distortions and multiples but I’m not having much luck. I’m able to stretch the capture image in the x and y directions and apply strong (but uncontrollable) distortions by hacking values in the code (I need to do some systematic and empirical tests to see if I can work out what is actually happening here):

loc = (video.width + x - 1) + y*video.width;

but most attempts to change this and specifically any attempt to shrink just gives an ArrayIndexOutOfBoundsException error:

Exception in thread “Animation Thread“ java.lang.ArrayIndexOutOfBoundsException: 191261
at Mirror2_Lewis_2.draw(Mirror2_Lewis_2.java:118)
at processing.core.PApplet.handleDraw(PApplet.java:1423)
at processing.core.PApplet.run(PApplet.java:1328)
at java.lang.Thread.run(Thread.java:613)

I think this is because of the fixed size of the capture array video.loadPixels(); – and although I’ve come across seemingly useful array functions such as expand() & reverse() trying to apply them gives a Cannot convert from Object to Capture error… hmmm…

3. monomic

Daniel Jones recognised the error I was getting trying to use the monomic library – which was actually to do with the way the oscP5 library was being called – so adding the line import oscP5.*; sorted out the problem and now monomic is working fine…

I want to use my monome as a controller for the Mirror2 patch I’ve been working on – to implement faders, push and toggle buttons etc. I found examples of a couple of apps using the monome & Processing in the Processing help thread on the monome.org forum – which I’ve contributed to in the past – so I had a a good look into both monogressions and monocontrol as well as the example patches in the monomic library.

After a fair amount of head scratching I’ve managed to refine some code to make the LEDs of any number of columns behave like separate faders; which I’m aiming to integrate with another patch I’ve made that stores button presses in a 2D array and displays these in a 2D array of objects – essentially a virtual monome. I’m intending to develop this into a set of controller widgets – faders, cross faders, push buttons and toggle buttons, button groups etc… that can be used in other projects.

Nick Rothwell’s shado

A session with Nick Rothwell has shado up and running on my machine and has exhausted the current set of tutorials 😉 though it certainly helped me get a clearer idea of the way shado works and Nick’s ambitions for rolling it out. I hoped my feedback was useful too. I’m now hacking about in the example scripts to learn more for myself.

Comments are closed.