Hi MXJ experts
The Max object ‘ctlin’ finds the device just fine in a patcher window. I wonder how I can instantiate a ‘ctlin’-object in Java.
Can anyone throw me an example to get me started?
What’s wrong with just using the max midi objects and feeding the data into mxj? I certainly would.
Given that you’re in the max environment anyway, you may as well play to its strengths.
|What’s wrong with just using the max midi objects and feeding the data into mxj?|
Just code aesthetics and the beauty of encapsulation. The ‘ctlin’ and ‘ctlout’ belongs to the BCF2000 object Im writing.
With respect, it sounds like anti-encapsulation!
The point of encapsulation is to partition off units of singular functionality in order to promote re-use. Bundling midi i/o together with code for interpreting the resulting data doesn’t achieve this. I’d still concentrate on getting the BCF specifics working.
Anyway – AFAIK, Java MIDI support on OS X (if that’s what you’re on) has long been flaky, as Apple didn’t see fit to actually make working service provider classes.
Apparently http://www.humatic.de/htools/mmj.htm works quite well, YMMV.
|The point of encapsulation is to partition off units of singular functionality in order to promote re-use. Bundling midi i/o together with code for interpreting the resulting data doesn’t achieve this. I’d still concentrate on getting the BCF specifics working.|
Thanks Owen, I see your point. My idea was to re-use the Max MIDI objects inside the Java object (and they are in a sense already encapsulated). I still think that midi IO should be built into the java object (using Max objects) since a BCF2000 object without midi IO is pointless for any purpose I can think of. Also, I want the object to talk OSC externally and MIDI internally. Anyway, including an external Java library like proMIDI or mmj is not a pretty choice, so in case I can’t instantiate and use the Max midi objects inside Java, I will go for your first proposal and encapsulate the mxj object together with the midi objects in a sub-patcher.
And thank you for the heads-up on mmj, I’ve been looking for something like that for a while.