Reply To: Polyphonic Nanosynth v1.0

Home Forums Products NS1nanosynth Polyphonic Nanosynth v1.0 Reply To: Polyphonic Nanosynth v1.0

#3652

donturner
Participant

Firstly, awesome!!!! Congratulations on creating something pretty amazing!

Just a couple of issues…

1) If you press the same note twice in a row, the second note doesn’t sound

2) The wave change input is on pin A1, not A0, and the mapping from analog input value 0-1023 to 0-4 was slightly wrong since your setWave method is expecting a value from 2-5.

I modified it slightly to fix it:

void setWave(int waveNumber) { // good practice to use local parameters to avoid global confusion

  switch (waveNumber) {
  case 0:

    oscil1.setTable(SIN2048_DATA);
    oscil2.setTable(SIN2048_DATA);
    oscil3.setTable(SIN2048_DATA);
    oscil4.setTable(SIN2048_DATA);
    oscil5.setTable(SIN2048_DATA);
    oscil6.setTable(SIN2048_DATA);

    break;
  case 1:
  
    oscil1.setTable(TRIANGLE2048_DATA);
    oscil2.setTable(TRIANGLE2048_DATA);
    oscil3.setTable(TRIANGLE2048_DATA);
    oscil4.setTable(TRIANGLE2048_DATA);
    oscil5.setTable(TRIANGLE2048_DATA);
    oscil6.setTable(TRIANGLE2048_DATA);
    break;
  case 2:
    
    oscil1.setTable(SAW2048_DATA);
    oscil2.setTable(SAW2048_DATA);
    oscil3.setTable(SAW2048_DATA);
    oscil4.setTable(SAW2048_DATA);
    oscil5.setTable(SAW2048_DATA);
    oscil6.setTable(SAW2048_DATA);
    break;
    
  case 3:
  case 4:
    
    oscil1.setTable(SQUARE_ANALOGUE512_DATA);
    oscil2.setTable(SQUARE_ANALOGUE512_DATA);
    oscil3.setTable(SQUARE_ANALOGUE512_DATA);
    oscil4.setTable(SQUARE_ANALOGUE512_DATA);
    oscil5.setTable(SQUARE_ANALOGUE512_DATA);
    oscil6.setTable(SQUARE_ANALOGUE512_DATA);
    break;

 
  
  }

}

Might be worth getting this code on github to make it easier to collaborate if you’re interested.