Binary Conversion

There are quite a few ways to convert from decimal to binary or, as I should say, from base ten to base two and the reverse when using Max/MSP. I’ve written abstractions using native objects that provide this function and I’ve also written a javascript that does both conversions (and bases up to 36) in one line of code. It is fairly trivial in javascript using the parseInt() and toString() methods. Continue reading…

Advertisements

Automatically Resize [bpatcher]

I’ve recently been piecing together a performance patch and using the [bpatcher] object to hold multiple instances of the same subpatch. As I think of new things to add into the subpatch I find it a bit annoying having to shuffle the [bpatcher] view around so the new user interface objects fit in. Presentation mode helps but to make things really simple I wrote this javascript which I can drop into the subpatch to do all the hard work for me. It automatically resizes and repositions the [bpatcher] view when everything loads. This way I don’t have to make any changes by hand, it saves me some time and lets me concentrate on the project work. If you’re using presentation mode you should give it a positive number argument so it knows to look out for only the objects you need, otherwise it uses every object on the canvas to calculate the dimensions. Continue reading…