Telecom
Java SysEx programming
by teknopipo on May.05, 2010, under Audio, Telecom
I’m taking my first steps into the world of JavaSound programming. The first thing I learned is that the Snow Leopard default javax.sound.midi.spi implementation is buggy when it comes to SysEx message transmission. For the time being I’m sticking with the MMJ library instead.
As an example, I’ve been trying to send a “SID Skip Patch” command to my SID station. The SysEx message for this command is F0 00 20 3C 01 00 03 F7.
The following code shows how to construct this message in Java (example based on SendSysex.java at jsresources.org):
String s = "F000203C010003F7";
int n = s.length() / 2;
byte[] msg = new byte[n];
for (int i = 0; i < n; i++) {
msg[i] = (byte) Integer.parseInt(
s.substring(i * 2, i * 2 + 2), 16);
}
The next step is to send the resulting byte array to a MIDI output. The following code works fine (tested with MIDI monitor and on a real SID station through an ESI MIDI Mate):
String[] outputs = de.humatic.mmj.MidiSystem.getOutputs();
int index = 0;
// insert code to set correct index here...
de.humatic.mmj.MidiOutput mo = de.humatic.mmj.MidiSystem.openMidiOutput(index);
mo.sendMidi(msg);
I’ve left out the code to determine the correct index as it is irrelevant. This could be a dropdown list in a GUI or some substring search or whatever. The following code tries to do the same thing using Snow Leopard libraries, but sends nothing at all:
javax.sound.midi.SysexMessage sysexMsg;
javax.sound.midi.Receiver receiver;
javax.sound.midi.MidiDevice.Info[] dev;
int index;
javax.sound.midi.MidiDevice myOutPort;
sysexMsg = new SysexMessage();
sysexMsg.setMessage(msg, msg.length);
dev = javax.sound.midi.MidiSystem.getMidiDeviceInfo();
// insert code to set correct index here...
myOutPort =
javax.sound.midi.MidiSystem.getMidiDevice(dev[index]);
myOutPort.open();
receiver = myOutPort.getReceiver();
receiver.send(sysexMessage, -1);
If you have succeeded in making this work, please let me know. MMJ development seems to have stopped so I’d kind of want to start using OSXs own stuff…
Wireshark on Snow Leopard
by teknopipo on Apr.16, 2010, under Telecom
Finally fixed a bug that’s been annoying me for months. I managed to get Wireshark up and running on OSX Snow Leopard – without any crappy workarounds such as running it inside a virtual XP machine. The video below by dangribbin explains it all.
Summarizing the steps:
- Download and mount Wireshark for 10.5 Leopard Intel
- Drag Wireshark to Applications
- Open a terminal and type:
defaults write com.apple.finder AppleShowAllFiles YES
killall Finder
- com.apple.Finder (i.e. Finder with a capital F) did not work for me!
- For more info on defaults type man defaults. - Create /usr/local/bin/ if you don’t already have one.
- Drag the Command Line utilities into /usr/local/bin/.
- Drag ChmodBPF folder to Startup Items.
- In the terminal type:
sudo chown -R root:wheel ChmodBPF - Launch Wireshark
- Add /usr/share/snmp/mibs/ under Edit → Preferences → Name Resolution → SMI (MIB and PIB) paths → Edit → New
- Reboot, done!
Setting up a home audio server
by teknopipo on Mar.18, 2009, under Audio, Telecom
Over the years my iTunes library has been growing substantially, and so has my collection of computers and harddisks. As a result, my personal archive had become quite scattered. Documents, photos, videos, mp3s, it was everywhere! In my quest to archive everything to a big harddisk attached to my Ubuntu server, I came up with the plan to also have a central music server. That would save a lot of space on my laptop harddisk. Plus I would be able to listen to my music wherever I was, in the house or in the world!
In this article (continue reading…)
Introduction to jVoiceBridge
by teknopipo on Mar.17, 2009, under Telecom
Introduction
The application jVoiceBridge is a software-only audio mixer that handles Voice over IP (VoIP) audio communication and mixing, for tasks such as conference calls, voice chat, speech detection, and audio for 3D virtual environments. Currently it is most commonly known for its use in the Wonderland project, a 3D virtual environment developed by Sun.
In this article (continue reading…)
Adding PHP support to SailFin
by teknopipo on Mar.17, 2009, under Telecom
Finally it is now a breeze to enable PHP on SailFin. PHP is a server-side scripting language which has quite a large user base in the web development community. PHP code is embedded in HTML and sent to a webserver for interpretation. The webserver therefore needs to run a PHP interpreter. The guys from Caucho Technology have made a 100% Java implementation of such an interpreter, called Quercus. Quercus is delivered as a .war file and as such it can be ran on any Java application server – such as SailFin.
Quercus is (continue reading…)




