Command line arguments

Customising your project settings

Every Bela project runs with default settings, such as the level of audio output, the number of samples per audio block, and so on. You can change these default settings using command line arguments, either on the command line itself or in the IDE settings.

On this page we give you an example of custom command line arguments, and list all the options available to you, and the values they take. Arguments are listed in their long form (such as --period). Some have a short form (such as -p) which we have listed as well, and you can use either. We also

Command line arguments are followed by your custom value. In each example are values in square brackets. When using these arguments, omit the brackets and just use your desired value.

Table of contents

  1. How to use command line arguments
  2. --period
  3. --dac-level
  4. --adc-level
  5. --pga-gain-left
  6. --pga-gain-right
  7. --hp-level
  8. --mute-speaker
  9. --use-analog
  10. --use-digital
  11. --analog-channels
  12. --digital-channels
  13. --mux-channels
  14. --audio-expander-inputs
  15. --audio-expander-outputs
  16. --pru-file
  17. --pru-number
  18. --disable-led
  19. --disable-cape-button-monitoring
  20. --verbose
  21. --help

How to use command line arguments

There are two ways to use these command line arguments: On the command line, or in the IDE settings.

In this example, we will change the number of audio samples in our project’s buffer to 256, disable the on-board LED, add 16 multiplexer channels and enable verbose logging.

On the command line:

In this example, we assume you are already in the project folder where our example project, myProject, is located.

$ ./myProject -p 256 --disable-led -M 16 -v

In the IDE:

The Project Settings tab features UI controls for most of these settings. However, if you have to quickly change settings (or change many settings), you may find it easier to enter them as command line arguments.

In the Settings tab under Project Settings there is a field for command line arguments. For the example settings above, type:

-p 256 --disable-led -M 16 -v

These arguments will be applied the next time you build and run your project.

Note that we don’t need to tell the IDE where to look in the file structure like we do on the command line. This is because we’re adding these arguments in the settings for the current project, and the IDE attaches these to this specific project. These arguments will remain applied to this project until you remove or change them.

--period

-p [numSamples]

Sets the hardware period (buffer) size in number of audio samples.

Default value: 16

--dac-level

-D [dBs]

Set the DAC output level.

Values: -63.5 (min) to 0 (max).

--adc-level

-A [dBs]

Set the ADC input level.

Values: -12 (min) to 0 (max).

--pga-gain-left

--pga-gain-left [dBs]

Set the Programmable Gain Amplifier for the left audio channel.

Values: 0 (min) to 59.5 (max); default 16.

--pga-gain-right

--pga-gain-right [dBs]

Set the Programmable Gain Amplifier for the right audio channel.

Values: 0 (min) - 59.5 (max)

Default: 16

--hp-level

-H [dBs]

Set the headphone output level, in dB.

Values: -63.5 (min) to 0 (max)

--mute-speaker

-M [no/yes]

Mute the speaker on startup.

Values: no, yes

Default: no

--use-analog

-N [val]

Specify use of ADC/DAC analog

Values: no, yes

Default: yes

--use-digital

-G [val]

Specify use of GPIO channels

Values: no, yes

Default: yes)

--analog-channels

-C [val]

Specify number of ADC/DAC channels

Default: 8

--digital-channels

-B [val]

Specify number of GPIO channels

Default: 16

--mux-channels

-X [val]

Set the number of channels to use on the multiplexer capelet

Default: 0 (disabled)

--audio-expander-inputs

-Y [vals]

Set the analog inputs to use with audio expander.

Values: List input values separated by commas.

--audio-expander-outputs

-Z [vals]

Set the analog outputs to use with audio expander.

Values: List input values separated by commas.

--pru-file

--pru-file [fileName]

Set an optional external file to use for the PRU binary code

Value: Path and file name

--pru-number

--pru-number [val]

Set the PRU to use for I/O

Value: 0, 1

Default: 0

--disable-led

--disable-led

Disable the blinking LED indicator.

Value: none

--disable-cape-button-monitoring

--disable-cape-button-monitoring

Disable shutting down Bela using the on-board button

Value: none

--verbose

-v

Enable verbose logging information to the console.

Value: none

--help

-h

Print a list of all available command line options to the console.

Value: none