Step 6Upload DSP Code
ArduinoDSP
The includes in ArduinoDSP are useful for setting the proper PWM prescaling and analog input prescaling values. They turn pins 3 and 11 into the left outputs (8 and 2 bits respectively) and 5 and 6 into the right outputs, using Fast PWM settings with no prescaling so the PWM is as fast as possible. The ADC is also set to a low prescale value, 32, and the analog reference is set to 1.1 V (the internal reference).
To modify the basic ArduinoDSP code, just insert your own code to modify the variable "input" between the line "short input = analogRead(left);" and "output(left, input);".
GlitchPedal
The code I've already written does a few things. The LEDs provide visual feedback about the knob positions and input level, and the pots control settings for the DSP happening inside the microcontroller. The first pot controls the mode, the second controls a parameter of that mode, and the third controls an effective sample rate. The modes include:
- Bitcrush: bit shift the input to the right and then to the left, chopping off N bits.
- Bitshift : shift the input to the left, leading to a weird effect for the first few values and then eventually noise (i.e., the "dithering bits").
- Overdrive: Multiply the input by a float from 1-20.
- Binary impulse response: do various binary operations on the input and the last result (XOR, NOR, XNOR, NAND...)
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|













































