This tutorial has been tested with a board flashed with the Bela image v0.3.4 and the latest Bela sources from the github repo dated June 16, 2018.
For instructions on how to flash your board, see the Bela wiki:
https://github.com/BelaPlatform/Bela/wiki/Manage-your-SD-card#flashing-an-sd-card
You will need two repos to run pyo projects with Bela platform.
-
Bela: Core code and mandatory stuff to communicate with the board.
-
Pyo-bela: Interface pyo/bela, pre-compiled binaries and project template.
The next steps assumes that the two repositories are side-by-side in the same directory and that the board is plugged to the host computer with a usb cable.
To download and install the latest pyo binaries on the board, run the script install_pyo_on_board.sh from pyo-bela sources (or follow instructions on the release page):
cd pyo-bela
./install_pyo_on_board.sh
Copy the pyo-bela/build_pyo.sh script to Bela/scripts folder and make it executable:
cp pyo-bela/build_pyo.sh Bela/scripts
chmod +x Bela/scripts/build_pyo.sh
At this point, if you never update the board (i.e. you just flashed your sd card), you should call the script update_board to copy the latest framework from Bela to your board:
cd Bela/scripts
./update_board
From Bela/scripts folder, compile and run any of the examples in the pyo-bela/examples folder. The first argument to the build_pyo.sh script is the python file to execute (the project will have the same name as this file, without ".py"). The second argument is the path of the pyo-bela/common folder, which contain all needed files to run a bela project.
cd Bela/scripts
./build_pyo.sh ../../pyo-bela/examples/music-box.py ../../pyo-bela/common
The second argument can be ommited if an environment variable called PYO_BELA_COMMON is set to point to the location of pyo-bela/common folder.
export PYO_BELA_COMMON=/path/to/pyo-bela/common
./build_pyo.sh ../../pyo-bela/examples/music-box.py
For a complete description of functions that can be used to communicate with the pyo embedded processes, see documentation comments in the file common/PyoClass.cpp.
(c) 2018 - belangeo