Hi Jeff,
Thank you for replying so quickly and with so many details. I did some progress and I can now change BB style from my Java app. I describe below what is still not working.
Without additional info, I'm going to make the following assumptions about what you're trying to do. You don't want bb's robots to use bb's own internal instruments (sampled guitars, basses, kits) playing back on your computer's audio out. Instead you want the robots to play the sounds on your hammond clone (a MIDI external sound module). I assume your clone attaches to the computer via usb, is controlled via USB-MIDI, and therefore is being picked up by alsa's snd-usbmidi driver as a "rawmidi" device.
No, I do want to use BB's robots to use BB's own internal instruments. Let me give you an overview of the project:
The organ clone software (setbfree) runs on a Raspberry PI and gets MIDI messages from hardware (keyboards, pedals and drawbars) through USB ports connected to Arduino boards. These boards are seen by the RPI as serial ports, but converted to MIDI ports by ttymidi.
The Java app runs on the RPI, too. It displays organ buttons on the RPI touchscreen, and makes things easier and more flexible, since I don't have to wire physical buttons on the organ console. The Java app sends MIDI messages to setbfree through a virtual MIDI port.
I want to apply the same principles with BB: add an arranger tab to the Java app, in which I will display only a subset of all your settings: start, stop, tempo and style as a minimum to start with. So, to recap, everything runs on the RPI: setbfree, BB and my Java app.
I have got all BB connections done eventually (Arduino and Java), but partly only with BB auto-discovery mechanism. I add a simplified startup script below so that you can see the connections sequence. I can change BB style from a Java app prototype with MIDI PC messages, but I cannot change BB Master Volume. I'm sending MIDI CC message on channel #0, controller #6 from a Java slider. On BB: Setup > Commands > MIDI Knob. Double click 'Master Volume' in Miscellaneous category. When I drag the Java slider knob, BB displays "Controller 6 Chan 1 Value x" with x = [0-100].
I click one of these BB messages, then the Assign button to assign these settings to Master Volume. Then OK, Exit Setup and exit BB. Then I restart BB, Setup > Commands > MIDI Knob and I check the 'Master Volume' assignment, which is Controller 6, as expected. But as soon as I drag the Java slider knob, BB Master Volume falls down from 100 to zero directly. Setup > Human > Test shows expected messages though: Controller 6 Chnl 1 Value x Master Volume.
Did I miss something? Is controller 6 OK for Volume setting? I'm not familiar with the notion of MIDI controller, but I have read that controllers 0 to 31 were usually reserved for settings through sliders/pots or pedals.
This is the script I'm using for prototyping with BB:
Code: Select all
#!/bin/bash
# runbb
#
export HOME="/home/georges"
# create a virtual MIDI port so that Java can send MIDI messages to BackupBand
sudo modprobe snd-virmidi snd_index=1
echo ">>> virtual MIDI port created for Java to BackupBand comm"
# create an ALSA MIDI out from the Keyboards Control Arduino serial port and name it kb_out
ttymidi -s /dev/ttyACM0 -n kb_out &
echo ">>> Keyboards Arduino ALSA MIDI out created for KB to BackupBand comm"
# launch JACK audio server daemon
/usr/bin/jackd -Rd alsa &
echo ">>> JACK audio server launched"
sleep 2
# launch BB. It connects to Arduino automatically.
/home/georges/BackupBand/BackupBand &
echo ">>> BB launched"
sleep 5
# launch Java BB controller
java -jar /home/georges/java-eclipse-workspace/com.b3.bbui/build/libs/com.b3.bbui.jar &
sleep 1
# connect virtual MIDI port to BB so that the Java app can send it MIDI CC or PC messages
aconnect 28:0 129:0 &
sleep 1
#