Categories

Feed

Apple OS X gets updated once a while, and I hope the problem with sending system exclusive message will be fixed. In the previous article I’ve shown how to send a MIDI note using Scala console. Here I’ll show how to send system exclusive messages, to ensure the bug I’ve reported is still present.

The Java MIDI driver for Apple OS X is getting shape. Now the driver can:

Register itself as a MIDI driver

Enumerate endpoints from Apple CoreMidi

Separate inputs from outputs

It still can not send or receive messages. The driver project is open sourced (MIT license) and shared on the Github page. As this is the first project where I used Java Native Interface, Objective C or Apple Core Foundation classes, I’m more than happy to get any feedback and suggestions how to improve any part of the code.

Happiness of easy MIDI programming with Scala didn’t last too long. Almost everything is fine with my pair of DaScratch controllers. I can switch the led’s and read the touch interfaces easily, but there is one small thing. The mode of round touch interface is switched by using MIDI system exclusive or sysex command. This is easy with javax.sound.midi in theory, but in OS X the sysex command doesn’t get transmitted.

This can be worked around by using mmj drivers. With mmj sending sysex messages from Scala console is a bliss. However, if there’s a pair of identical controllers just like I have, I can not access the second controller because of a bug in mmj.

So, I filed two bugs:

to Apple about sysex commands. I’ve got problem ID 10016703, but no response.

to Humatic about accessing two similar devices with mmj. Nils from Humatic responded very fast, but he didn’t promise fix soon.

Well, seems that my first project creating router for a pair of DaScratches is spinning off another project creating Java MIDI drivers for OS X.

As Scala console, Interactive Interpreter or REPL was one of my selling points for programming MIDI with Scala, I show what can be done with it. I do not show how to install Scala or how to access console.

I’ve got a pair of Stanton SCS.3d DaScratch controllers and a Native Instruments Traktor Pro DJ software. They are connected using DaRouter software which is based on Bome Midi Translator. It runs pretty well, but there’s one small issue. Traktor has four decks, and there is no way to control more than two decks using the two DaScratches with this setup. There is “deck” button on the controller, but it is only used to change between two decks if there’s only one DaScratch. The button has no effect with a pair of controllers. I believe Stanton SCS.3m mixer would solve this, but I don’t have one.

I could buy SCS.3m mixer, but it doesn’t offer a lot of value. To be honest, I’d rather use my iPad with TouchOSC for the controls outside the DaScratches. Not owning SCS.3m mixer I’m pretty much forced to use DaRouter. I could also buy a Bome Midi Translator and try to make a patch for four decks. As no-one has done it, I suppose it may be impossible to do with Bome. So, it is time to start a programming project. However, even if I develop software as my job, my MIDI programming skills are dated 10 years ago. Back then I used Windows low level MIDI API with Delphi.

For DJ’ing I use MacBook, so the first option came in to my mind was to use Xcode and Objective-C, but after looking examples, it really didn’t felt my thing. It is pretty verbose, and OOP paradigm is not too interesting for me. More interesting Haskell isn’t too mature to use with Xcode yet, and the learning curve is still pretty high. So, I turned to trusty Scala running on Java Virtual Machine. After my experience with Windows API and Delphi, I immediately noticed the following advantages:

The good news with Fedora 12 is an extremely easy dial-up-networking connection with bluetooth devices. The sad thing is, Nokia E55 doesn’t have PAN type connection via bluetooth. The good thing is, DUN type connection is almost that easy.

Create connection to your mobile through System > Preferences > Bluetooth > Set up a new device wizard. Also create connection using NetworkManagers Edit connections > Mobile Broadband > Add wizard. This should be enough for PAN, but not for DUN connection used in Nokia devices.

For dial-up-networking, you need to install Blueman application, for example by using terminal.

YUM upgrade has been the most successful method until Fedora 12, but now the recommended preupgrade route has been used. However, if you have systems to upgrade, you’ll probably have too small /boot partition. Well, I have not too good track record for other methods.

Again, if you have ATI, and you want to use catalyst (fglrx) driver, you can’t. X is in too new version for it.

Upgrading to Fedora 10 was a smooth job probably because of RPM Fusion.

To get the most of the new graphical bootup screen, add the vga-parameter in your boot config (/etc/grub.conf):

kernel /vmlinuz-2.6.27.[---8<---] rhgb quiet vga=0x31

The 0x31B is a Kernel VESA graphics mode in 1280×1024 resolution and in 16M colours. If it is not available in your case, check a VGA modes list. And don’t worry, you can change or remove the parameter from GRUB bootup screen.

So, I tried a little while the article above as a starting point. I compared the video I’ve taken with the phone, and another recorded with MythTV. The clip I used was only couple of seconds long to make the trying as fast-paced as possible.

The first thing I noticed from the article above, the ffmpeg supplied with Fedora can’t regocnise aac audio, but there’s a libfaac codec instead. So, that must be replaced.

Also the RealPlayer was completely confused if the video size was anything else than 320×240 and if the aspect wasn’t set. That makes 16:9 videos a little bit funny looking, but you can clip them or make letterbox stripes if you want to.