Editing the core code

You may want to experiment around with the core code of Bela, if you decide to do so, be aware that you do so at YOUR OWN RISK.

The core code

If you are familiar with the terminal, just ssh into the board, go to the ~/Bela folder and hack the code in core/, include/ and pru/. This can also be done through the IDE with the following trick:

  • create a new C++ project called core_code, then run the following commands from the IDE’s console:
    mkdir projects/core_code/core
    mkdir projects/core_code/include
    mkdir projects/core_code/pru
    ln -s /root/Bela/core/* projects/core_code/core/
    ln -s /root/Bela/include/* projects/core_code/include/
    ln -s /root/Bela/pru/* projects/core_code/pru/
    

    You won’t get syntax checking, but your changes will be saved and compiled.

The Makefile

The Makefile that you find in the Bela repo is central to the way the board is managed. It takes care not only of the building process, but also of running and stopping Bela programs and the IDE and manages running Bela programs and the IDE at startup.

Normally, you would not have to invoke the Makefile yourself, but you can pass parameters to it from either the [[IDE|Bela IDE#passing-options-to-make]] or the [[build scripts|Interact with Bela using the Bela scripts#passing-options-to-make]]. The Makefile file you find in the Bela repo is self-documenting, which means that some of the textual comments in the file are displayed to the user running:

$ make help

The help target should work regardless of the fact that you invoke it from the board or from the host computer (as long as you have make installed). Other targets will only work if make is invoked from the board.