Examples

Dozens of ways to get started creating

The Bela IDE ships with a huge collection of examples in C++, Pure Data, SuperCollider and Csound, all in the Examples tab. As well as providing code that you can erun straight away, these examples also provide great starting points for your own projects.

This article describes using the Bela examples.

Table of contents

  1. Why we made the example library
  2. Using the examples
  3. Editing an example
  4. Saving an example to your board

Why we made the example library

Bela was born out of university teaching and research, and we have been focused on education since the very beginning. We believe that physical computing and audio interaction often feel difficult because they’re complex, and the best way to make sense of that complexity is to have a starting point. Adapting, building on, and editing code examples is a great way to learn and design solutions to your own creative problems.

The Bela example library demonstrates everything from the fundamentals of interaction to complex system communication. There are a huge number of examples in C++, as well as plenty in Pure Data, SuperCollider and Csound.

We’re always expanding and improving our collection of examples. If you have a suggestion, please let us know!

Using the examples

When you click on the name of an example project in the Examples tab, it opens in your editor. The name of the project in the Project Explorer lets you know that it’s an example:

You can edit the example code and run the changes straight away in the Editor.

Editing an example

You can edit the code of an example project as soon as it opens in the Editor.

If you edit an example and then try to open another project, you’ll get a dialog box warning you that if you switch projects without saving your edited example, your changes will be lost:

If you don’t mind losing your changes, click Continue. This closes the example and doesn’t save your changes.

If you want to save your changes, click Cancel, and save your example to your board as a new project.

Saving an example to your board

You can save an example project to your Bela system. In the Project Explorer tab, click the Save as ... button in the Project controls:

In the dialog box, give your project a name and click Save project. This saves the example as a new project on your Bela board.

Tip

When you edit an example project and save it to your board, it creates a copy - the example project in the Examples tab is unaffected.