By Cassie Ogburn & Katrin Svadlena
Our goal for this project was to make an interactive art piece to argue with/ let off steam. Inspired by Ulay and Abramović’s AAA-AAA; a performative art piece of which is a video of them just yelling at each other. So, we wanted something to prompt you, and suddenly change it’s mind and start a fight with you. This can be easily customized with different sounds, to make it happier, sad, or very angry. We call this: An Extremely Bipolar Device.
Materials:
- Adafruit Circuit Playground Express
- Adafruit Crickit
- Breadboard (optional)
- 4 wires
- Speaker
- Canvas
- Plug in/ battery pack
- Hot glue
- Tape (optional)
- Soldering Iron
During the coding, you can choose to insert your own audio, to do so, make sure the audio is a wav file and to insert more than one, you must make sure the files are small. After coding the Adafruit playground and cricket, you will want to attach the speaker to the board.
We used the bread board, but you can just connect the speaker to the crickit at the speaker port with the wire. To make it long enough to sit on the outside of the canvas, you will want to solder wire to the speaker wires and connect those to the crickit.
Next you need to attach the playground and crickit to the back by using glue or tape (we used tape, not shown here) and glue down the wires with hot glue to prevent moving, and glue the speaker down where you want; we glued it to the top of the canvas for best results.
For our project, we decided to keep the plug in to turn the project on, but you can attach a battery pack to power the piece.
After attachment, you can choose the face you want for the art; keep in mind, it will talk back at you so choose something either hilarious to argue with or something you don’t mind yelling at.
Finally, just hang it on a wall. Boom. Art that will talk back at you.
The Code:
import time
import math
import
array
import audiobusio
import audioio
import board
import crickit
# Number of samples to read at once.
NUM_SAMPLES = 160
# Remove DC bias before computing RMS.
def normalized_rms(values):
minbuf = int(mean(values))
samples_sum = sum(
float(sample – minbuf) * (sample – minbuf)
for sample in values
)
return math.sqrt(samples_sum / len(values))
def mean(values):
return sum(values) / len(values)
mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA,
sample_rate=16000, bit_depth=16)
# Record an initial sample to calibrate. Assume it’s quiet when we start.
samples = array.array(‘H’, [0] * NUM_SAMPLES)
mic.record(samples, len(samples))
# Set audio out on speaker.
a = audioio.AudioOut(board.A0)
# Start playing the file (in the background).
def play_file(wavfile):
print(“Playing scream!”)
with open(wavfile, “rb”) as f:
wav = audioio.WaveFile(f)
a.play(wav)
while a.playing:
pass
while True:
mic.record(samples, len(samples))
magnitude = normalized_rms(samples)
print(((magnitude),)) # formatting is for the Mu plotter.
if magnitude < 70: # it’s quiet, do nothing.
pass
if magnitude > 100 and magnitude < 130:
print(“A LIL LOUD”)
play_file(“soft.wav”)
if magnitude > 130 and magnitude < 200:
print(“SORTA LOUD”)
play_file(“medium.1.wav”)
if magnitude > 300 and magnitude <450: # it’s really loud
print(“REALLY LOUD”)
play_file(“scream.2.wav”)
if magnitude > 450: # it’s really loud
print(“REALLY LOUD”)
play_file(“scream.wav”)
time.sleep(2)