Ruby Jitter Example

This example, like all my Max/MSP + Ruby examples, requires ajm objects.

One of the nice things about the ajm.ruby object is it can access any of Cycling '74's Java APIs. I hadn't specifically designed any Jitter support, but I got it for free. Here's an example of how to read in a Jitter matrix and modify it using Ruby.

First, save the following Ruby script as jitter-test.rb somewhere on your Max search path (then you may need to restart Max):


Then, run this Max patch (works in Max 4 and 5):


If all goes well, you should see this patch. Click the "setcell" message box to fill the matrix. Then hit the button to have Ruby process it. The sprintf is needed to convert a Max message into a Ruby method call. This kind of syntax conversion is often needed when moving data from Max to Ruby.


Easy, right?