Neko Punk Synth V2

by Arnov Sharma in Circuits > Audio

1784 Views, 13 Favorites, 0 Comments

Neko Punk Synth V2

IMG_20220127_192154.jpg
02 (45).gif
01 (45).gif

Hey guys and welcome back, this is my Neko Punk Synth Version 2 which is a cat-themed Synth powered by an Arduino Nano and Mozzi Library.

By Changing the position of 5 sliding pots, Mozzi can produce much more complex and interesting growls, sweeps, and chorusing sounds. These sounds can be quickly and easily constructed from familiar synthesis units like oscillators, delays, and filters.

You can check out Mozzi Library from here- https://www.instructables.com/Arduino-Based-Synth-...

Supplies

These were the things used in this built-

  • Arduino Nano
  • PAM8403 Audio AMP
  • Custom PCB which was provided by PCBWAY
  • Li-ion 5V Boost Module
  • 3.7V Li-ion Cell
  • 3D Printed Enclosure
  • 4Ohm Speaker
  • Slider Pots

Previous Edition - Stepped Tone Generator AKA Atari Punk Console

21 (24).gif
DpKB0.jpg

The Previous edition that I made a few weeks ago was based on the original Atari Punk Console was first made by Forrest Mims in 1980. It utilizes an astable multivibrator setup which triggers a monostable setup. by combining these two setups, we get a Stepped Tone Generator or an atari punk synth.

This was easy to make but I was not pleased with its result.

A year ago, I've made a similar synth with Mozzi Library which worked quite nicely so I thought why not use Mozzi in the V2 of Neko Punk Synth, to make things super cool, I used sliding pots which gives this synth its cyberpunk-ish looks.

Circuit Designing

16 (31).gif
SCH_page-0001 (7).jpg

V2 PCB was probably the simplest Circuit board that I have ever made.
It uses an Arduino Nano as a base Microcontroller, five slider pots are connected with Arduino nano.

D9 goes into the input of the PAM8403 Audio AMP Module and the output of PAM8403 is connected with two CON2 Pins so we can add Speaker with it.

I prepared the PCB in my OrCad PCB Suite and added a few graphics to increase the aesthetic of the Board.

Boost Module

10 (45).gif
11 (43).gif

This whole setup requires 5V to work.

To Power this setup, I have to use this Li-ion Cell Boost module that you can find online, these modules are very inexpensive and work pretty well.

It Boosts 3.7V of Li-ion Cell to constant 5V 1A or 2A for our MCU setup to work.

Getting the Board From PCBWAY

22 (18).gif
23 (18).gif

I used PCBWAY PCB Service for this project. I uploaded the Gerber file of this project on PCBWAY's quote page.

For this Synth Board, I choose white solder mask color as I have added Quite a few round graphics and custom art on the TOP side of the Board.

Black silkscreen looks awesome with white soldermask color.

I received the PCBs in a week and the PCB quality was pretty great, This PCB is Huge and I like how the quality of these PCBs was not compromised because of size.
Checkout PCBWAY from here- https://www.pcbway.com/

PCB ASSEMBLY

06 (41).gif
07 (45).gif
24 (15).gif

Now this Board doesn't have any SMD Componenets so we only had to place everything on this board manually and solder them with a soldering iron.

  • I first gather all the materials and started the assembly process with Slide Potentiometers.
  • I then put all the Pots in their place from the top side and solder their pads from the bottom side of the PCB.
  • After this, I added Arduino Nano and PAM8403 modules in their place, and the assembly was pretty much completed.

Uploading Code

the main sketch of this project is based on Mozzi Library.

/* 
  Example using 2 light dependent resistors (LDRs) to change 
  FM synthesis parameters, and a knob for fundamental frequency,
  using Mozzi sonification library.

  Demonstrates analog input, audio and control oscillators, phase modulation
  and smoothing a control signal at audio rate to avoid clicks.
  Also demonstrates AutoMap, which maps unpredictable inputs to a set range.
  
  This example goes with a tutorial on the Mozzi site:
   http://sensorium.github.io/Mozzi/learn/Mozzi_Intr...
  
  The circuit:
     Audio output on digital pin 9 (on a Uno or similar), or 
     check the README or  http://sensorium.github.io/Mozzi/learn/Mozzi_Intr...

     Potentiometer connected to analog pin 0.
       Center pin of the potentiometer goes to the analog pin.
       Side pins of the potentiometer go to +5V and ground
  
     Light dependent resistor (LDR) and 5.1k resistor on analog pin 1:
       LDR from analog pin to +5V
       5.1k resistor from analog pin to ground
     
     Light dependent resistor (LDR) and 5.1k resistor on analog pin 2:
       LDR from analog pin to +5V
       5.1k resistor from analog pin to ground
  
  Mozzi help/discussion/announcements:
   http://sensorium.github.io/Mozzi/learn/Mozzi_Intr...

  Tim Barrass 2013.
  This example code is in the public domain.
*/

#include <MozziGuts.h>
#include <Oscil.h> // oscillator 
#include <tables/cos2048_int8.h> // table for Oscils to play
#include <Smooth.h>
#include <AutoMap.h> // maps unpredictable inputs to a range
 
// int freqVal;
 
// desired carrier frequency max and min, for AutoMap
const int MIN_CARRIER_FREQ = 22;
const int MAX_CARRIER_FREQ = 440;

const int MIN = 1;
const int MAX = 10;

const int MIN_2 = 1;
const int MAX_2 = 15;

// desired intensity max and min, for AutoMap, note they're inverted for reverse dynamics
const int MIN_INTENSITY = 700;
const int MAX_INTENSITY = 10;

// desired mod speed max and min, for AutoMap, note they're inverted for reverse dynamics
const int MIN_MOD_SPEED = 10000;
const int MAX_MOD_SPEED = 1;

AutoMap kMapCarrierFreq(0,1023,MIN_CARRIER_FREQ,MAX_CARRIER_FREQ);
AutoMap kMapIntensity(0,1023,MIN_INTENSITY,MAX_INTENSITY);
AutoMap kMapModSpeed(0,1023,MIN_MOD_SPEED,MAX_MOD_SPEED);
AutoMap mapThis(0,1023,MIN,MAX);
AutoMap mapThisToo(0,1023,MIN_2,MAX_2);

const int KNOB_PIN = 0; // set the input for the knob to analog pin 0
const int LDR1_PIN=1; // set the analog input for fm_intensity to pin 1
const int LDR2_PIN=2; // set the analog input for mod rate to pin 2
const int LDR3_PIN=4;
const int LDR4_PIN=3;

Oscil<COS2048_NUM_CELLS, AUDIO_RATE> aCarrier(COS2048_DATA);
Oscil<COS2048_NUM_CELLS, AUDIO_RATE> aModulator(COS2048_DATA);
Oscil<COS2048_NUM_CELLS, CONTROL_RATE> kIntensityMod(COS2048_DATA);

int mod_ratio = 5; // brightness (harmonics)
long fm_intensity; // carries control info from updateControl to updateAudio

// smoothing for intensity to remove clicks on transitions
float smoothness = 0.95f;
Smooth <long> aSmoothIntensity(smoothness);


void setup(){
//  Serial.begin(115200); // set up the Serial output so we can look at the light level
  startMozzi(); // :))
}


void updateControl(){
  
//  freqVal = map(LDR3_PIN, 0, 1023, 1, 100);
  
   int freqVal = mozziAnalogRead(LDR3_PIN); // value is 0-1023
   int FRQ = mapThis(freqVal);
   
   int knob2 = mozziAnalogRead(LDR4_PIN); // value is 0-1023
   int knob2Val = mapThis(knob2);
  
  // read the knob
  int knob_value = mozziAnalogRead(KNOB_PIN); // value is 0-1023
  
  // map the knob to carrier frequency
  int carrier_freq = kMapCarrierFreq(knob_value);
  
  //calculate the modulation frequency to stay in ratio
  int mod_freq = carrier_freq * mod_ratio * FRQ;
  
  // set the FM oscillator frequencies
  aCarrier.setFreq(carrier_freq); 
  aModulator.setFreq(mod_freq);
  
  // read the light dependent resistor on the width Analog input pin
  int LDR1_value= mozziAnalogRead(LDR1_PIN); // value is 0-1023
  // print the value to the Serial monitor for debugging
  //Serial.print("LDR1 = "); 
 // Serial.print(LDR1_value);
 // Serial.print("\t"); // prints a tab

  int LDR1_calibrated = kMapIntensity(LDR1_value);
 // Serial.print("LDR1_calibrated = ");
 // Serial.print(LDR1_calibrated);
//  Serial.print("\t"); // prints a tab
  
 // calculate the fm_intensity
  fm_intensity = ((long)LDR1_calibrated * knob2Val * (kIntensityMod.next()+128))>>8; // shift back to range after 8 bit multiply
//  Serial.print("fm_intensity = ");
 // Serial.print(fm_intensity);
//  Serial.print("\t"); // prints a tab
  
  // read the light dependent resistor on the speed Analog input pin
  int LDR2_value= mozziAnalogRead(LDR2_PIN); // value is 0-1023
//  Serial.print("LDR2 = "); 
//  Serial.print(LDR2_value);
//  Serial.print("\t"); // prints a tab
  
  // use a float here for low frequencies
  float mod_speed = (float)kMapModSpeed(LDR2_value)/1000;
  //Serial.print("   mod_speed = ");
 // Serial.print(mod_speed);
  kIntensityMod.setFreq(mod_speed);
  
 // Serial.println(); // finally, print a carraige return for the next line of debugging info
}


int updateAudio(){
  long modulation = aSmoothIntensity.next(fm_intensity) * aModulator.next();
  return aCarrier.phMod(modulation);
}


void loop(){
  audioHook();
}

The code is pretty long but basically, it runs on Mozzi Library which generates algorithmic music without the need for additional shields, message passing, or external synths. This library is pretty well documented so you can check that out from here and download it.

install this library before uploading this sketch.
https://sensorium.github.io/Mozzi/

const int KNOB_PIN = 0; // set the input for the knob to analog pin 0
const int LDR1_PIN=1; // set the analog input for fm_intensity to pin 1
const int LDR2_PIN=2; // set the analog input for mod rate to pin 2
const int LDR3_PIN=4;
const int LDR4_PIN=3;

The POTs are connected on A0, A1, A2, A3, A4 and the Audio Out is D9.

Downloads

Testing

27 (8).gif
09 (39).gif

Now after uploading the sketch, I added a 4ohm speaker with CON2 of the PAM8403 Module.

To power this setup temporarily, I've used a power bank to supply 5V 2A to Arduino Nano.

To Modulate sound, we just have to change the position of all 5 sliding pots and that's pretty much the whole testing process.
Next, we move on to the final assembly process.

3D Printed Enclosure

26 (13).gif
08 (40).gif

As for the Body of the Synth, we generally use a Box like enclosure that will house the speaker and electronics.

I had this idea of making a cat face on the front side to make it look like a BOX CAT, I added the cat's facial things like whiskers, nose, eyes on the front side.

I modeled the body in fusion360 and then 3D Printed each part on my ender 3.

I prepared the main body with Orange PLA and pupil, eyebrows, whiskers, and nose from BLACK PLA and the eyes from white PLA.

The print setting was normal as well, I used a 0.8mm nozzle with a 0.32mm layer height with an infill of 20% and support for the base body.

Adding Facial Features on 3D Enclosure

13 (38).gif
14 (33).gif
15 (34).gif

After printing all the parts, I used super glue to attach all the face parts to the base body.

FINAL ASSEMBLY

17 (31).gif
18 (30).gif
19 (27).gif

Now we start the main assembly by first adding we add a speaker onto the Base body with nuts and bolts.

Next, I added DC Jack and the rocker switch into the base body.

then we connect the Lithium Boost module with the DC jack and switch.
I then place all the stuff inside the body and add the main PCB from the bottom side with some M2 Screws and the assembly is completed.

RESULT

01 (45).gif
20 (28).gif

To Turn ON this setup, we just have to press the Rocker Switch and change the sliding pot position to modulate sound.

Check out my previous Synth Project from here- https://www.instructables.com/Atari-Punk-Synth-Nek...

Thanks for reading this article and I'll be back with another project soon.

Peace