SETTING UP UI FOR RNBO PI

Download example.maxpat:

Click here to download example.maxpat

Download exampleUI.py:

Click here to download exampleUI.py

[USE CHATGPT FOR ASSISTANCE]

Install Python on Pi

Update system packages:

sudo apt-get update && sudo apt-get upgrade

Install Python 3 and pip:

sudo apt install python3-pip

Install python-osc library:

pip3 install python-osc

Upgrade pip, setuptools, and virtualenv:

pip install --upgrade pip setuptools virtualenv

Create a Python virtual environment:

python3 -m venv ~/myenv

Activate the virtual environment:

source ~/myenv/bin/activate

Install Kivy on Pi

Upgrade pip for compatibility:

pip install --upgrade pip

Install Kivy library:

pip install --upgrade kivy

Send Your UI Script to the Pi

Transfer your UI script to the Pi:

scp [YOUR_PATH][YOUR_UI.py] pi@[YOUR_PI].local:/home/pi/

Set Up OSC Communication

Verify the RNBO OSCQuery runner is active:

curl http://127.0.0.1:5678

Expected output: A JSON structure representing the RNBO patcher's OSC parameters and namespace.

Install `oscsend` for testing OSC (optional):

sudo apt-get install liblo-tools

Test OSC communication:

oscsend osc.udp://127.0.0.1:1234 /rnbo/inst/0/params/ratio f 0.5

Install Desktop on Pi

[After recent RNBO update, handles display detection]

Install XFCE desktop environment:

sudo apt install xfce4 xfce4-goodies lightdm

Disable screen blanking:

sudo nano /etc/lightdm/lightdm.conf

Then add this under [Seat:*]:

xserver-command=X -s 0 -dpms

Create an autostart configuration:

mkdir -p ~/.config/autostart

Then create and edit the file:

nano ~/.config/autostart/my_kivy_ui.desktop

Insert the following:

[Desktop Entry] Type=Application Exec=/bin/bash -c 'cd /home/pi/projects && source /home/pi/myenv/bin/activate && python3 [YOUR_UI.py]' Name=KivyUI

Finalize

Test the Kivy UI locally:

source ~/myenv/bin/activate
python3 /home/pi/[YOUR_UI.py]

Enable automatic boot to desktop:

sudo raspi-config

Navigate to:

System Options > Boot/Auto Login > Desktop GUI with Auto Login

Reboot the Pi:

sudo reboot