Processing! Examples? Tips?

  • Just recently began learning the language and was very excited to see how similar it is to javascript and the arduino language.
    Its fantastic and was wondering if the community had done any work with processing that I should have a look at! Its opened up possibilities with the monome for performance for me.

  • hey dean! i've done a little bit in processing, working with the monome is very easy. i can post some example code if that helps!

  • I seen a video you done with one of your tracks, I really enjoyed it although I didnt appreciate it as much as I would now. Can you link here? And post some code, that would be great.

  • I'd love to see what you guys are doing in processing. I've been fumbling around for a while but hit a wall a while back and haven't yet persevered through.

  • woops, missed your reply dean, here's my shitmess patch i used for some generative visuals at a show. i hacked this together in like 2 days so i apologize in advance. it does do monome communication and works over serialosc but doesn't do monome detection, i put the port numbers in manually for this, but hopefully it gets somebody started.

    oh video link, this is literally just letting the processing patch run randomly on the audio in one shot and capturing it. no edits at all.

  • Hi @phortran,

    I'm looking into your code but can't seem to figure out my monome (128) detection and ports to communicate from monome to processing. Where can i find the monome name? Thanks


    ---
    This is the minimal code to receive osc from monome to processing:
    --

    import oscP5.*;
    import netP5.*;

    OscP5 osc;
    NetAddress listenPort;
    NetAddress serialoscPort;


    void setup() {
    osc = new OscP5(this, 13384);
    listenPort = new NetAddress("127.0.0.1", 13384);
    serialoscPort = new NetAddress("127.0.0.1", 13428);

    // --> do NOT know how to change momome name
    //OscMessage msg = new OscMessage("/m40h0146/grid/led/all");
    OscMessage msg = new OscMessage("/m1288080/grid/led/all");
    msg.add(0);
    osc.send(msg, serialoscPort);
    }

    void oscEvent(OscMessage msg) {
    println("print value");
    println(msg);
    }

  • hi warddem, check your serialosc preferences file. on OSX it's in the folder Library/Preferences/org.monome.serialosc/ from your home folder. for example here's mine:

    server {
    port = 13428
    }
    application {
    osc_prefix = "/monome"
    host = "127.0.0.1"
    port = 10099
    }
    device {
    rotation = 0
    }

    you can get the prefix/port with this. this is a very manual way to set it up and how i wrote that code, but this was also before the non-zeroconf version of serialosc was available. honestly zeroconf -should- work in processing, i've got it working in java apps at least, but the osc discovery is probably much easier. i haven't read up on the details of that protocol yet but the idea is you should be able to query serialosc for this information.

  • @warddem the monome name you see, m1288080, is actually the prefix. it can be anything you want. set it first, and then send messages with that, e.g.

    //set prefix
    msg = new OscMessage("/sys/prefix");
    msg.add("/toad");
    osc.send(msg, serialoscPort);

    //light up lights
    msg = new OscMessage("/toad/grid/led/all");
    msg.add(1);
    osc.send(msg, serialoscPort);

    i don't see a /prefix message in phortran's code; his prefix must have been set by another program in the depths of history.

  • yep, that is all true!

  • hey @warddem - don't know if you need 'em, but i felt like taking a break from python & made these simple demos, in case they can help anyone:

    demo 1: lights turn on when pressed
    demo 2: lights stay on until pressed again

    you'll need to enter your own port number (for demo 1) and monome height/width (for demo 1+2).

    doing this in processing is pretty similar to chuck -- if anyone catches autodiscovery fever, check out my thread about it.

    i also asked about how to find port numbers a while back.. more details for finding config files are here.

  • ps @phortran video so cool :O

  • Thanks for the info and demo, really helped me.

    I can't seem to find the serialosc preferences file on OSX 10.8.3 (nothin' in Library/Preferences/org.monome.serialosc/ ) but found a workaround by using @myr 's "monome home" (http://monome.org/docs/app:monome_home) to set the port and prefix to visualise monome-button-pressing in processing.

    Next step is to get input from monome apps (mlrv, 64fingers) to processing. I'm not able to receive OSC in processing and apps at the same time. Is there any max patch that can forward monome info to a max app (mlrv) and processing at the same time (different port though)?

    A second option could be to forward the momonome info in processing to the max app but didn't find out how to do this yet.

    Below a screenshot of the processing sketch where a different pattern is drawn with every monome button pressed. I will post my processing sketch when it is a bit cleaner.

  • ahh it didnt tell me there was replies! great to see some content. thanks