Skip to content

Bleep Base Quick Start

John-Michael Reed edited this page Feb 6, 2021 · 5 revisions

The Bleep Base is an simple device I made for this course. He's an overview of how to use it's features.

This one is my prototype and has some issues but the controls are all the same

Control Quick Start

The Bleep Base controls quick start code shows how to use all of these examples.

Potentiometers

To read a pot use potRead(POT NUMBER) it returns a number from 0.0 on the left side to 1.0 when turned to the first. That means you need to use a floating point variable to store the value it returns.

To give the top left pot a range of 10-100:
float reading1 = (potRead(0)*90.0)+10.0;
Notice that it's 90.0 not just 90 to make sure it does the correct decimal point math.

Buttons

There are two ways to read buttons.
buttonRead(BUTTON PIN) returns a 0 when the button is pressed and a 1 when it is not.
buttonState(BUTTON PIN) can be used to check if the button #define FELL or ROSE.

See if the button was pressed to start an envelope:
if (buttonState(0) == FELL){
envelope1.noteOn(); }

Photocell

Read the value of the photocell with pcellRead()
It returns values approaching to 0 when it's dark and 1.0 when there is a lot of light hitting it.

LEDs

The two LEDs between the large buttons and the green Teensy PCBs san be set to any color.
set_LED(SELCT, H, S, V)
Select is the LED to set. ) is on the left and 1 on the right but you can hook up many more using the LED header (more on this later)
H is hue from 0-1.0. O and 1.0 are fully green. 0.33 is red, 0.66 is blue.
S is the Saturation. 0 would set the LED to white, 0.5 a pastel shade, 1.0 fully colored.
V is value aka brightness. 0 is off, 1.0 is max_brightness which his set at the top of bleep_base.h. The lights can get very bight which his why there's a jumper to power them on and off in the top right corner under the teensy PCBs. If the LEDs don't get any data they unfortunately turn very bright blue.
After you set one or both LEDs you must run LEDs.show(). This is what send the data to the LEDs. Only do this when needed, such as 30 times a second.

MIDI

I'll have a full explanation on how to use the DIN and USB MIDI later on but all the code from here fore DIN MIDI and here for USB will be what we'll use.

Power

The Bleep Base can be powered with a 9V, 2.1mm, center positive DC adapter. This is the same type used by Boss style guitar pedals.

Audio

See this page.

Why?

Why can't you just use analog read or write?
The Teensy, or any Arduino device, only has so many pins. The Teeny 4.0 we're using has 24 pins. 9 of them are used for the audio adapter and 4 are used for the SD card and external flash memory. MIDI takes 2 so we're left with 10, not enough for 8 buttons and 8 pots BUT we can multiplex them.
We'll get into the hardware and what all the "bleep_base.h" functions are doing later on.

Header

There's a header on the right hand side that can be used to directly connect to the remaining available pins of the Teensy, the MUX select, and the I2C pins.