The Klaxophone is a hacked Megaphone that uses an Arduino Uno to process input from 2 digital buttons and an accelerometer all contained within its body. The data from the Arduino is then sent to Max/MSP via USB. The original Electret microphones from the Megaphone have been rerouted to an XLR cable that runs into an interface. Finally, a quarter inch cable has been soldered into the place where the electrets were originally connected on the megaphone’s IC.
Max then uses the data from the Arduino and the sound from the microphone to process the sound. It’s doing a variety of things to the input from the microphones:
The Accelerometer’s Y-axis is controlling pitch-bending.
The Accelerometer’s X-axis is controlling a wet/dry effect panning function
Currently this only contains a reverb effect that increases as you tilt the handle to the player’s left side.
The Accelerometer’s Z-axis is presently unused :(
Digital Button 1 is used to switch through 4 presets:
Off
Pitch-bent vox
Vocoder
Clean vox
Digital Button 2 is used to activate a loop function and executes three different functions:
First press activates Record for a duration up to 4.5 seconds and rewrites this into a buffer
Second press stops the recording and automatically loops the recording from the buffer
Third press stops the loop.
As for power, the megaphone originally required 8 C-batteries to operate. I removed this compartment and wired the contacts to a small 12v wall-wart. While this maybe limits the mobility of the device, it doesn’t require me to find C-batteries.
I kept most of the original functions of the megaphone as well. The trigger activates the speaker. The volume wheel behind the handle is the final gain stage to outputting signal from the megaphone speaker. Just behind the volume control is a knob that switches between various tones and this still functions as well. I was also able to put the original microphones back where they were - if anything I actually improved them with tape and foam insulation to help combat feedback.
Finally, to achieve some structural integrity I used cardboard internally to hold the Arduino and the accelerometer. The two digital buttons on top are simply sitting on top holes I drilled into the plastic. They actually hold pretty well without the tape, but I felt the tap would quickly ensure they don’t move during usage.
Yes, that’s a bit of solder on near the edge of the cone...
The Name
The Klaxophone gets its name from the Klaxon - defined as “a type of an electromechanical horn or alerting device,” by Wikipedia - and “ophone” denoting an instrument and referring to the original megaphone that this was built from and continues to be.
Performing with the Klaxophone
Challenges
You might’ve noticed all of the Gaff tape covering this device. This almost wasn’t necessary, but when it was finally all put together the one tiny thing I didn’t account for was the rigidity of a USB type B cable end. Everything but this port fit with the microphone compartment attached. Seeing as this is a vital part of the instrument and with due date looming, I opted for one of the most valuable resources in the world and didn’t look back.
In terms of performing with this I was struck with the problem of this megaphone and what it represents. This device, originally named “Street Thunder” by the manufacturer, has a memory bank of tones that you can switch through with a potentiometer just behind the handle, near the volume knob. These stored tones are all very typical police/emergency siren songs. Given the current strife in the world, I found this triggering, disturbing, and incredibly ironic, as I had started working with this instrument before the protests started. I feel that there’s an opportunity or perhaps a necessity to make a relevant and striking performance with this, but at the current moment I don’t feel I have the capacity to explore this. I hope to keep trying over the summer of 2020.
Another challenge was gain structure.
Next Steps
There are quite a few things to improve upon this instrument.
It could use additional effects in the opposite pan direction with the X-axis effects. I do have hesitations though as the fidelity of the speaker is limited, so ensuring that the effects are efficacious is a concern.
The Z-axis is currently unused, so there is room there for further functionality, however, in terms of considering playing the Klaxaphone as an instrument, rotating the thing too far in any direction wouldn’t make sense as the speaker is directional and at some point the performer would end up pointing the speaker back at herself - but perhaps this could be a desirable effect? More thought on this is needed.
I feel that the loop function could be explored further for quicker implementation. If it had several buffers and could somehow access them in an easily controlled way, many interesting possibilities would arise.
The Code
Arduino Code
**Note that there are several lines commented out that are original to the code provided from Sparkfun - I left these for personal convenience but they aren’t necessary for the Klax-code.**
//This code is for the Klaxophone project by Anthony Groce 6-9-2020
//This is code for the Arduino Duo using the sparkfun ADXL337 Accelerometer and 2x digital buttons
// Make sure these two variables are correct for your setup
int scale = 3; // 3 (±3g) for ADXL337
boolean micro_is_5V = true; // Set to true if using a 5V microcontroller such as the Arduino Uno
//int xread; //variable to store scaled x
//int yread; //variable to store scaled y
//int zread; //variable to store scaled z
const int buttonPin = 2; // the number of the pushbutton pin
const int buttonPin2 = 4; // the number of the pushbutton pin
int buttonState = 0; // variable for reading the pushbutton status
int buttonState2 = 0;
void setup()
{
// Initialize serial communication at 115200 baud
Serial.begin(115200);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
// Read, scale, and print accelerometer data
void loop()
{
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
buttonState2 = digitalRead(buttonPin2);
//float xread, yread, zread; // Scaled values for each axis
//if (micro_is_5V); // Microcontroller runs off 5V
// Get raw accelerometer data for each axis
int rawX = analogRead(A0);
//xread = mapf(rawX, 0, 675, -scale, scale);
//int a1 = xread >> 3;
//int a2 = xread & 7;
int a1 = rawX >> 3;
int a2 = rawX & 7;
int rawY = analogRead(A1);
//yread = mapf(rawY, 0, 675, -scale, scale);
//int b1 = yread >> 3;
//int b2 = yread & 7;
int b1 = rawY >> 3;
int b2 = rawY & 7;
int rawZ = analogRead(A2);
//zread = mapf(rawZ, 0, 675, -scale, scale);
//int c1 = zread >> 3;
//int c2 = zread & 7;
int c1 = rawZ >> 3;
int c2 = rawZ & 7;
Serial.write(255); //clear the sensor input
Serial.write(a1); //first part of xread
Serial.write(a2); //second part of xread
Serial.write(b1); //first part of yread
Serial.write(b2); //second part of yread
Serial.write(c1); //first part of zread
Serial.write(c2); //second part of zread
// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
Serial.write(1);
} else {
Serial.write(0);
}
if (buttonState2 == HIGH) {
Serial.write(1);
} else {
Serial.write(0);
}
delay(20); // Minimum delay of 2 milliseconds between sensor reads (500 Hz)