Forums > Jitter

Looking for help in performance

December 18, 2012 | 12:49 am

Hello everybody,

I’m working on a patch to visualize MIDI notes received from outside Max.
This is what I did:

– Pasted Max Patch, click to expand. –

It uses cycle~ and jit.poke~ to generate a nice "wobblying" mask for vertical bars generated with jit.fill

It works pretty well, but I think it’s quite CPU-heavy. If I try to set up a "multichannel" version, in which the MIDI section of the patch goes into a poly~ object and every MIDI channel generates different colors, I notice a dramatic framerate drop with three or four active MIDI channels, so it reduces its potentiality for my purposes.
So I was guessing if there was a more efficient way to obtain this visual effect, for example generating the "spectrogram" in pure Jitter, without the need to use fft, or if there is some bottleneck in the "MIDI to jit.fill" part, which I don’t see.

Any help is appreciated



dtr
December 18, 2012 | 10:30 am

I tried your patch but [p spectrogram] isn’t outputting anything. One possibility though: make sure you don’t have graphic objects updating in realtime in your poly, including jit.pwindow’s. That’s a classic framerate hog. See also http://cycling74.com/forums/topic.php?id=44165


December 18, 2012 | 12:26 pm

dtr, thanks for the reply. The jit.pwindow’s you see in this patch are only for clarity’s sake here int the forum.
But you pointed out a most likely issue: I’m using multisliders in order to convert the MIDI notes in a jit.fill-savy form.
Here’s the MIDI part of the patch, I put some message boxes to show the format needed by jit.fill:

– Pasted Max Patch, click to expand. –

Can I format the messages in that way, avoiding multisliders?

P.S.
@dtr, I tried again the patch I posted, and I can see the [p spectrogram] output… do you see any errors in Max Window?



dtr
December 18, 2012 | 12:44 pm

> @dtr, I tried again the patch I posted, and I can see the [p spectrogram] output… do you see any errors in Max Window?

Strange, it didn’t work on my macbook pro but it works on my desktop. Perhaps my audio settings were conflicting.

> Can I format the messages in that way, avoiding multisliders?

Why not send setcell messages directly to jit.matrix bars, bypassing the jit.fills altogether?


December 18, 2012 | 2:00 pm

that was really simple! Here’s the re-arranged patch:

– Pasted Max Patch, click to expand. –

But now there’s a new problem: when I play any note, a bar appears at the beginning of the jit.pwindow… I can’t understand from where it is generated.
Scratching my head…



dtr
December 18, 2012 | 2:32 pm

I don’t see any superfluous bars.

I do see that you don’t need to bang barsresampled. It will already output automatically when it receives the bars matrix.


December 18, 2012 | 3:26 pm

All right, the last correction needed was to set the bars matrix size to 128, not 127.
Now I don’t see any superfluous bar, either!

Thanks dtr for your suggestions! Now I’ll test this patch in a poly~ and hope for better performances!


Viewing 7 posts - 1 through 7 (of 7 total)