How to connect to BackupBand using QjackCtl ?

Support & discussion regarding DAWs and MIDI sequencers.

Moderators: MattKingUSA, khz

Post Reply
Georgie
Established Member
Posts: 11
Joined: Tue Oct 20, 2020 8:00 am

How to connect to BackupBand using QjackCtl ?

Post by Georgie »

Hi everyone!
I would like to use this smart software called BackupBand into my Hammond organ clone. I have to connect BackupBand input to the keyboards matrix scanner built on Arduino and muxes, but I also want to connect it to a Java program in charge of sending MIDI CC messages. This would be easy if BackupBand was visible in QjackCtl, but it's not. I have found this reply from j_e_f_f_g in an old post (May 2015) :
Goto "Setup -> MIDI" and check the box labeled "ALSA Seq". This should make BackupBand's midi input show up in QJackCtl's MIDI list, and you can connect your midi keyboard from there. This is not an efficient way to access your keyboard, but it should work.
But this commands flow does not exist any more in the current version. Is there still a way to connect to BackupBand with QjackCtl?
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: How to connect to BackupBand using QjackCtl ?

Post by j_e_f_f_g »

You don't need QJackCtl to route BackupBand to other jack or midi software/hardware. BB does all the setup itself (and saves it so that this setup is automatically restored the next time you run BB.) Essentially, bb has its own "session/connection manager" built into it. (The older version did not. Which is why it refers to using QJackCtl.)

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.

First thing is to get bb communicating with your midi module. BB can simultaneously communicate with upto 5 playback devices -- one digital audio out on your computer, and upto 4 MIDI devices (be they external hardware, or software synths running on the computer).

Go to the "Setup -> General" page. There are 5 buttons under "Playback devices". Only the computer's internal audio card is enabled at the moment. (The "Internal Audio" button is the only one lit up). You need to add your midi device to bb. Click the "MIDI Out 1" button. Right now it is set to "Off". Change the Device Type to "MIDI", and you should see the names of all available midi playback devices appear. Hopefully, your clone appears there. (If you've got some sort of alsa remapping software running, it could be transforming your hardware into what looks like a software synth. I hate those things. In this case, change Device Type to "Software", and your clone should be there.)

Double-click on your clone's name, and you're back to the General screen. Hopefully, the MIDI Out 1 button is lit up. meaning bb is now capable of playing your clone.

Now you need to tell the robots who should play on your clone. Goto to the "Setup -> Robots" page. Right now the Drummer's settings are shown. Change "Playback on" from "Internal Audio" to "MIDI Out 1". The drummer will now playback on your clone, instead of your computer's audio out. (The guitarist and bassist are still playing on your computer's audio card. Flip to their settings and change each to playback on "MIDI Out 1").

If you set all the robots (and "Human") to "MIDI Out 1", then there's no need to leave the Internal Audio device on. Go back to the General page, click the "Internal Audio" button, and set it to "Off".

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: How to connect to BackupBand using QjackCtl ?

Post by j_e_f_f_g »

Now, I assume you want to use that java program to change bb's styles.

Is that program running on your clone, and sending MIDI messages to your computer via USB? Or is it running on the same computer as bb?

In either case, make sure the JAVA program is running. Then goto the "Setup -> Human" page. Under "Controller", there's a "Device" button. Click it, and change "Device type" to "MIDI" if your hardware clone is running the program. Double-click your clone's name.

Change to "Software" instead if the program's running on the same computer, and double-click the java program's name.

Back at the Human screen, click the "Test" button. Operate the java program and verify that bb is displaying messages from it. The messages also tell you what bb is doing with each message. If it's not what you want, either change the java program's settings, or go to the "Setup -> Commands" page, set "Assign action to" -> "MIDI Knob". Double-click the "Select Style -> Range" command. Set it to "Program Change". Make sure the midi channel is the same as the java program. Leave Low/High at 0/127.

After you've set it all up, exit BackupBand. Answer Yes when it prompts you to save your settings. Rerun bb to verify your settings are restored.

Note that you must have your clone turned on, and the java program running before you run bb.

An uptodate manual.zip is at https://sourceforge.net/projects/backupband/files/

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

Georgie
Established Member
Posts: 11
Joined: Tue Oct 20, 2020 8:00 am

Re: How to connect to BackupBand using QjackCtl ?

Post by Georgie »

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
#
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: How to connect to BackupBand using QjackCtl ?

Post by j_e_f_f_g »

Does checking the box "Full motion slider" make any difference?

Could be a BB bug with Master Volume over midi.

Try using your java app to adjust one of the individual robot's volume. For example, use the "Bass -> Set Volume" command to see if it works setting the bass volume.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

Georgie
Established Member
Posts: 11
Joined: Tue Oct 20, 2020 8:00 am

Re: How to connect to BackupBand using QjackCtl ?

Post by Georgie »

Does checking the box "Full motion slider" make any difference?
No difference
use the "Bass -> Set Volume" command to see if it works setting the bass volume.
Same behaviour : the bass volume (initial value is 100) is set to zero as soon as I touch the Java app slider knob.
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: How to connect to BackupBand using QjackCtl ?

Post by j_e_f_f_g »

Ok, I think that may be one of the things I fixed in the upcoming version of BB I'm working on. I've done a major rewriting of the underlying code to make it more efficient and responsive. But I've still got a bit more to do, so it will probably be a few weeks before you'll see the update.

In the meantime, there may be a workaround (and in fact, a better approach than using custom midi commands).

By default, BB automatically responds to standardized MIDI messages. For example, MIDI CC #7 (not #6 -- that's "data entry") adjusts "volume". So if you send CC #7 on the bass player's channel, it should automatically change the bass volume. No need for any custom command assignment. If you send CC #7 on the guitarist's channel, it will change his volume.

On the "Setup -> Human" page, there are 2 MIDI channel settings. The first one under "Solo instrument" is for the patch being played (by the human musician) on the right half split of his keyboard. By default, I believe this is chan 1. So if you send CC 7 on channel 1, it should change the volume of the right hand patch.

The other MIDI channel (under "Controller") is the ""Master MIDI channel". The default setting is "Auto". This sort of ties the master channel to the human soloist's channel. For your purposes, you don't want that. If you instead change the master channel to something different than the robots or soloist chans (for example chan 8.), then it controls a lot of global settings. For example, if set master chan to 8, and then send CC 7 on midi channel 8, it changes the master volume. (Sending on the individual robots' chans still change their individual volumes.)

The master chan also responds to MIDI program messages to change the current style. Send program changes on chan 8 and you should see the style changing.

And there are other CC messages the master channel responds to. Assign a fader to send midi CC 1 (ie modulation wheel) on channel 8. That should change the tempo.

CC 13 starts/stops play. (Value 0 stops, and anything 1 to 127 starts play.) CC 67 starts/stops play without any countoff.

CC 69 triggers a drum fill, and advances to the next variation.

CC 96 raises the transpose in half steps. CC 97 lowers it.

CC 80 turns reverb on/off. 91 adjusts vol.

CC 121 implements all notes off.

Using the master channel, you can do a lot without needing to configure BB.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

Georgie
Established Member
Posts: 11
Joined: Tue Oct 20, 2020 8:00 am

Re: How to connect to BackupBand using QjackCtl ?

Post by Georgie »

My tests pass by using the master channel ! Thanks a lot Jeff for your help. The next steps are to use BB headless, then to get it working on the RPI.

What do you recommend to go headless? Should I discard the UI by using a configuration file, or is it doable by using the BB source files configurator?

Many thanks for this nice app, not to mention the effort you have put in writing the detailed user's guide. If everything goes well, I will end up with a very nice instrument !
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: How to connect to BackupBand using QjackCtl ?

Post by j_e_f_f_g »

tests pass by using the master channel
Yeah, I seem to remember coming across that "Volume" command assignment bug in the version I'm working on, and fixing it.

For clarity, I should mention that you need to send your Note On/Off messages to the master channel to trigger chord changes. For example, if master channel is 8, then sending 3 note ons, on channel 8, of a C note (any C), E note, and G note will tell the robots to jam on a C Major chord.

In other words, to trigger chords, you can also use the master channel, instead of the various Command Assignments for chords. The added benefit is that you no longer have to bother with setting the split note. All notes on the master channel trigger chords, and split note is ignored.

The only problem is if you want to be able to switch between chord modes. (ie. Offer the user a choice to use 1 finger mode, or form all the notes of the chord himself). I'll add a CC response to the master channel that lets you switch "Chord mode".

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: How to connect to BackupBand using QjackCtl ?

Post by j_e_f_f_g »

headless?
The new version I'm working on is especially centered around moving the bulk of the GUI code into a separate library loaded at runtime. After that, running it headless, and removing most of the gui code, should be a matter of just specifying no_gui when running BB:

BackupBand no_gui

NOTE: This does not work on the version you're using. This is an upcoming feature. So my advice is to forego working on headless operation until the next version.

I also want to work on being able to specify settings when running BB. For example, to set master channel to 8, and connect the master channel and all robots to slave to a sequencer client named "My app" port 1, it would be something like this:

Code: Select all

BackupBand no_gui master_chan=8 master_in="seq\My app\1" drums_in="seq\My app\1" bass_in="seq\My app\1" guitar_in="seq\My app\1" pad_in="My app\1"
For your needs (ie, configuring BB to operate on a particular hardware setup, in a particular way) this would hopefully make it possible to set it up without needing any config files.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

Georgie
Established Member
Posts: 11
Joined: Tue Oct 20, 2020 8:00 am

Re: How to connect to BackupBand using QjackCtl ?

Post by Georgie »

Great enhancements Jeff and thanks once again for your technical support ! I'm confident I will get all of this working eventually. I'm starting designing the JavaFX UI that will control BB.
j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: How to connect to BackupBand using QjackCtl ?

Post by j_e_f_f_g »

Keep me posted on how things are going. I'm very interested in getting BB running on an RPI, as I'd love to have a portable headless version that I could attach to any USB-MIDI keyboard.

Incidentally, I made a fork of setbfree with lots of improvements to efficiency (eliminated some buffer copying, less RAM usage, faster detections and triggering of notes, etc). You'd probably be interested in that too, especially if you're trying to control it via midi. As I recall, the original didn't have the amount of control via MIDI, as I've done with BackupBand.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

Post Reply