Skip to main content

Basic workflow

In bellplay~, the basic building block of our scripts is the buffer. Conceptually, a bellplay~ buffer is a structured representation of audio data—this includes not just the raw audio waveform, but information such as duration, sample rate, number of channels, and more.

The general workflow and life-cycle of a buffer in a bellplay~ script is the following:

  1. Generation: buffers are created using synthesis or sampling techniques, and optionally analyzed/processed.
  2. Transcription: buffers are queued for rendering, each symbolically represented as a note in staff notation. This stage determines crucial information about how the buffer is assembled in the final output, primarily its starting time, or onset, within the timeline.
  3. Rendering: All transcribed buffers are assembled and rendered into a single audio buffer. This buffer can then be used for subsequent iterations of this workflow to refine the final output as needed.

Below is an introductory example of a bell script in bellplay~, which generates a short sinusoidal wave at 440 Hz:

basic_workflow.bell
## first, let's generate a buffer, in this case a sinusoidal oscillator.
$osc = cycle(440, 1000);
## then we transcribe the buffer for rendering
$osc.transcribe();
## finally, we render the transcribed buffer
render()
Auto-evaluation

When you load a .bell file in bellplay~, the code is automatically evaluated everytime you save it. As such, it's worth memorizing and using the keyboard shortcut to save a file—⌘+S on Mac, and Ctrl+S on Windows.

Result