RNBO dedicated RPI with Open beat control implementation
I am looking to sync pioneer cdj's with a raspberry pi running my rnbo patch without the need of my laptop. Mainly because traveling with a laptop at 4am around Lima, Peru is asking for it to be stolen, a pi with a small midi device fits in my pockets.
This is done easily with a laptop either with a separate program like "beat link trigger" or playing straight from rekordbox as it has Link capabilities. I am looking into running 2 separate raspberry pi devices, one running "open beat control" and another running my rnbo patch, as this seems like something I could do without troubling anyone else. However I wanted to know first if there is any chance of implementing open beat control into an RNBO dedicated device, as it runs on java, and I have seen some implementation of code with "js", although not on RNBO.
I know this is an extreme long shot, plus I know nothing about coding, so trying to understand deep symmetry's programs has been quite challenging. Thoughts on the matter from someone who understands it would be very much appreciated.
Thanks in advance,
Emma
The "JS" that RNBO implements is JavaScript not Java, they're entirely different languages: https://www.codecademy.com/resources/blog/java-vs-javascript/
I suspect that you could run everything, the RNBO runner and open beat control, on a single raspberry pi device. I don't see us implementing the open beat control details directly into RNBO, but I figure you might be able to interact with it via OSC and RNBO.. and potentially sync via link?
I'm curious, what is it that you're trying to do with the combination of RNBO and the cdjs?
Thanks for the answer!
I got the full java version of beat link trigger to work on the raspberry pi! I used VNC viewer and the terminal's SSH to the pi to install it. Im still having network issues on trying to get RNBO's transport to sync to the LINK signal coming from beat link trigger. I believe it has something to do with transport sync being only through WIFI, while BLT and CDJ's use ethernet, or something to do with DHCP thingies which im still trying to understand (im learning about all this along the way), but I have not tried everything I have in mind to fix it yet. I fully intend to post all my findings in case anybody else wants to do this.
As for what im trying to do, I want the CDJ's to be the master tempo of my setup, and only have to take the pi with me when I play my shows, eliminating the laptop. I have patches on RNBO that require sync to work properly, like delay effects, melody and harmonic generators, and percussion loops. Plus when playing with LINK from the laptop (Rekordbox) the CDJ's are slaves, which makes fast tempo changes not practical. BLT on the other hand slaves the LINK Signal to the Pro Link Signal from the CDJ's.
Another way to put this is, I play on a XONE:96 Mixer which has no effects, so instead of having to buy a $900 RMX1000 FX unit and a $1500 DJS-1000 sampler from Pioneer, I can create my own for a fraction of the price. literally 1/25th the price. If I get this to work Im sure I'll come up with more patches to implement. With max my imagination is the limit :).
This sounds like a very cool project! I wish I had some CDJs to test this out alongside.
I did run the headless open-beat-control application on a pi with no trouble yesterday, but I don't have any way to actually test that it works. Are you planning to bring a screen with your pi? If not, you might look into running the headless version and setting up a systemd service to start that up after the pi starts up.
So I think Im stuck. 2 issues, one is related to RNBO which I don't think can be fixed with the current version, the other relates to DHCP servers and RNBO's run ready image which can be fixed.
First, DHCP. For some reason the run ready image you guys provide does not allow ethernet connections straight after install. Installed it twice today from scratch and no luck. I got eth0 (pi's ethernet port) to work yesterday after digging through random command recommendations from the raspberry pi forums. No luck today however, and I forgot what I did. With the raspberry pi recommended OS, ethernet did work, but no connection to BLT. So it's fixable but will probably take ages and some luck to figure out on my own. I can also hire a network professional, or raspberry pi professional to help me solve this, which I am very willing to do. But first we need to fix the second issue otherwise this is for nothing.
I feel dumb for missing this, its even on the RNBO sync video you guys made, but RNBO's transport does not sync to LINK signal in the same network as the pi. It only communicates with rnbo.remote, which requires a max instance to be running on the same network as the LINK signal. In other words, a laptop running Max is necessary to sync LINK signal to RNBO's transport. Maybe i'm missing a workaround, maybe the current state of RNBO does not support this, or maybe it's not possible at all. Thoughts on this would be very much appreciated.
I did manage to to run the headless version of open beat control today, but with both above issues ongoing it was all for nothing. Still I appreciate the thought, this is definitely the way to go if the project moves forward. Thanks again for the reply's.
RE DHCP:
Are you trying to make the PI the DHCP server? So that you connect your CDJ directly the PI and the PI gives the CDJ device an address? That isn't the default behavior, generally the PI asks for an address via DHCP, not the other way around. Our image should ask for an address, via DHCP, by default. One thing that happens though is that the first time you run after installing a new image to an SD card, you have to reboot once, I think this is because the first run needs to expand the image to the size of the SD.
RE Link Sync:
By default there is an application that runs on our image, jack_transport_link, that syncs the RNBO runner to Link (via the jack transport).. that should sync to whatever other link enabled applications you have on your network, without the need for rnbo.remote. If you're able to sync by starting with rnbo.remote, then you can do it without rnbo.remote because all that it does is send OSC to your pi. You can do the same thing by sending these OSC messages to the runner on port 1234.
/rnbo/jack/transport/sync T
/rnbo/jack/transport/rolling T
Are you able to get sync going, it is just that you're needing to use Max to initiate the sync? If you then quit max, does sync between your pi and your cdj still work?
Maybe you can draw us a diagram of the system you're trying to get working? Is it just 1 CDJ and 1 PI, is there an Ethernet router in there? anything else?
I think Im close!
RE: DHCP
So I got DHCP to work. I never setup wifi and connected both cdjs and pi to a switcher that was also connected to my internet router. I also got Open Beat Control running on the pi to sync to my computer. I think I might have been taking extra steps that were not needed and where messing with the addresses. I can also sync the RNBO transport to OBC but need rnbo.remote to be running.
In the future I would like to avoid the internet router or switcher. Could it be possible to have the pi assign the addresses? or maybe avoid the switcher and get a switcher sized router, that I can also take with me.
RE: Link Sync
I don't understand OSC messages, I don't know how or where to send them. I read this forum "send OSC messages in/out of RNBO" and read this as well "The RNBO Raspberry Pi OSCQuery Runner". From what I understand, I have to install homebrew, in order to enable the "oscsend" command and then send the commands above through my mac's terminal? This seems like a lot, maybe there is an easier way to do this.
I don't know if this is relevant, but OBC has an osc port and carabiner port (OBC User Guide). I realize I don't understand OSC interaction well enough but just pointing it out in case it does matter.
Thanks again for the reply!
Awesome to hear about the progress.
[rnbo.remote]
is a utility wrapper to send the OSC messages and as Alex mentioned you can send them in other ways. The article you point at shows how to send these messages from the macOS terminal, but if that is not an option you have alternatives. To test you could eg. as well use the Web Interface that is per default set up on our Pi images to set the sync and running state, check the Transport Control section on this page: https://rnbo.cycling74.com/learn/raspberry-pi-web-interface-guide
RE Router:
Considering you have at least 3 devices that need to communicate with each other, you're gonna need some sort of switch or router. You could setup the pi to provide the addresses (DHCP) and just get a small Ethernet switch but I suspect you could also get a similarly sized Ethernet router that provides addresses and save yourself the headache of doing that setup on the pi.
RE OSC:
You can also run those commands directly on the PI, first you need to install a tool to send OSC. Here is an example, assuming you're already sshed into your pi:
sudo apt-get install liblo-tools
oscsend osc.udp://localhost:1234 /rnbo/jack/transport/sync T
oscsend osc.udp://localhost:1234 /rnbo/jack/transport/rolling T
BTW, usually with link you shouldn't need to send that "rolling T" command. For instance, if hit play in Ableton Live with Link sync enabled and the PI on the same network, the pi's transport should start. I wonder if there is something in open beat control that would do this, but either way it isn't such a big deal to send that command, you will need to create a startup script to start open beat control anyway, so you can send these OSC messages at that same time.
you can install a DHCP server on the Pi: https://raspberrytips.com/dhcp-server-on-raspberry-pi/
IT WORKS!!!
I will keep the separate router approach for now. Setting up a DHCP server on the pi seems like a bit too much, I was ready to spend a bit already so I'll just get a small router that can do the job. It can work for connecting other things in the future that require OSC to expand my show like visuals or lights, seems like an appropriate time to get one.
Both Florian's and Alex's way of getting the sync going work. I cannot be opening the interface though, so I'll try and find a way in the raspberry pi forums to make those commands run on boot and launch OBC after.
I have a bug today where carabiner does not connect properly that I did not have yesterday, so i still have some steps to smooth out but it's looking promising.
After that I'll replicate and test all the steps I took and search for any bugs or issues and report back. Thanks again for all of your help. Now comes the fun part, time to work on the patch to perform! Happy patching <3!
That is great to hear! I hope you share a bit of what you come up with, I'm really curious!
To get things started after you boot:
Here is a link to the systemd init file that we use to start the runner: https://github.com/Cycling74/rnbo.oscquery.runner/blob/main/config/rnbooscquery.service.usr
You could copy that, rename it and adapt it to your needs.. changing the Wants and After to rnbooscquery.service and also removing this chunk
LimitRTPRIO=infinity
LimitMEMLOCK=infinity
Environment="JACK_NO_AUDIO_RESERVATION=1"
basically, instead of pointing to the rnbooscquery executable, you could point it at a startup script that sends those OSC messages and also starts OBC.
I'm a bit stuck again :(
So I got OBC to start from boot with a .sh file via a systemd file. Only problem is the transport does not start. I still have to enter the rolling T command manually. It won't work from the .sh file. When I do enter the rolling T command it is already in sync and OBC running on the background, which is great progress. This is what's inside the .sh file. Maybe I need a different command when running it from here?
#!/bin/bash
oscsend osc.udp://localhost:1234 /rnbo/jack/transport/sync T
oscsend osc.udp://localhost:1234 /rnbo/jack/transport/rolling T
java -jar /home/pi/OBC.jar -B
As for what im building, this is the first bit. It has the RNBO Reverb Pedal with only one control. It has a similar sound to a DJM-900 Mixer Reverb effect when shortened. A click to test the sync. And the best bit my 303 clone which is my favorite toy ever, dumbed down from the MFL version. I tried to make it tidy in case you want to check it out. Showing the devs a patch I made feels so weird, please don't judge me, I can only do my best.
Other things I want to add are phasor powered loops, which is pretty easy I think. Adapt the shimmer and delay RNBO pedals to fit my needs. And a Random Glitch Generator from shortened and filtered samples. I don't know how i'll be adapting this one just yet as it used to use samples in my local drive and a sheet2coll device, I will dumb it down and figure it out. I'm also posting it as I think its pretty cool in case you want to check it out as well. The RNBO patch is mapped to a Xone:96 USB2 and Xone:K2 on midi channel 15.
Hi EMMA,
RE the sync not starting.. I'm wondering, can you add jack_transport_link.service to your list in your systemd Wants and After? It looks like that is a space separated list.
That is the service that does the synchronization, maybe it hasn't started up in time to get your OSC messages. If that doesn't work, try also adding a line before the OSC commands, something like "sleep 5" to sleep for 5 seconds, just so that everything else has time to startup.
Thanks for sharing your patchers! I totally get that it can feel weird sharing, I'm certainly not a Max power user so I get that feeling too, even though I work on RNBO. There are plenty of others here who might benefit from this info though!