This is an old revision of the document!


PB702 MIDI Synthesizer

The MIDI Synthesizer gives the possibility to connect your Paper Bits to a Midi Keyboard like theMIDI Keyboard. It is polyphonic up to six notes and has three different waveforms: square, triangle and sine.
It's basically an Arduino clone running a small program based on the wonderful Mozzi library.

For burning the bootloader look here:
AVR & Bootloader
For uploading the program one needs an USB to Serial adapter or an Arduino:
The Arduino as a Serial Adapter


Paper PCB

Parts

  • Resistors:
  • 1x 220 Ohm
  • 1x 330 Ohm
  • 2x 470 Ohm
  • 2x 1 KOhm
  • 2x 1.2 KOhm
  • 1x 2 KOhm
  • 1x 3.3 KOhm
  • 1x 3.9 KOhm
  • 2x 8.2 KOhm
  • 1x 10 KOhm
  • 2x 47 KOhm
  • 1x 100 KOhm
  • 1x 220 KOhm
  • 1x 1 MOhm
  • Capacitors:
  • 2x 22 pF
  • 2x 1 nF
  • 1x 4.7 nF
  • 3x 100 nF
  • 1x 150 nF
  • Electrolytic Capacitors:
  • 1x 1 µF
  • 2x 10 µF
  • Semiconductors:
  • Atmega 328P-PU
  • OpAmp MCP 6002
  • Optocoupler 6N138
  • Cristal
  • 1x 16 MHz
  • Diodes
  • 1x 1N4148
  • 1x LED
  • Mechanical:
  • 1x IC socket, 28 pin
  • 2x IC socket, 8 pin
  • 1x pin strip 1x14pin
  • 2x pin header, female 90° 1×3, 1×2
  • 2x pin header, male 90° 1×3, 1×2
  • 2x push button
  • 3x jumpers

Software

Mozzi

The synthesizer program is based on the Mozzi Library, have a look at the Mozzi Dokumentation to learn more about it.
For the installation download the library
and install it like described here: https://www.arduino.cc/en/Guide/Libraries#toc4

Mozzi Mode

There are three different mode for the Mozzi library. The MIDI Synth needs the HIFI mode. To change that open in …sketchbook/libraries/Mozzi_102 the mozzi_config.h file and comment out the AUDIO_MODE STANDARD and uncomment the AUDIO_MODE HIFI. It should look like that:

 //#define AUDIO_MODE STANDARD
 //#define AUDIO_MODE STANDARD_PLUS
 #define AUDIO_MODE HIFI

then save the file.

Mozzi Glitch

Unfortunately there is nowadays a glitch in the Mozzi library. Arduino change the compiler. Now the uploaded code is smaller but a timing problem appeared, too. Here is an description about the problem. https://www.instructables.com/id/Arduino-IDE-16x-compiler-optimisations-faster-code/

To fix the glitch follow these steps:
In: arduino-x.x.x\hardware\arduino\avr\platform.txt change -O2 to -Os.
https://sensorium.github.io/Mozzi/fixes/updates/howto-for-arduino-1-dot-6-11/

Code

Upload that code to your board (Arduino UNO):
mozzi_midi_poli_12_1sec_limit.zip
mozzi_midi_poli_10.7z