Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 8 FirstFirst 1 2 3 4 ... LastLast
Results 26 to 50 of 193

Thread: New Teensy 4.1 DIY Synthesizer

  1. #26
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Hallo UHF

    Your TSynth is a very nice DIY project.

    The code core of "Jeannie" is from TSynth. I adapted it to my hardware and reduced the voices to 8.

    I would like to add a few more functions such as ARP / Sequencer and Granular synthesis.

    My first DIY Synth project is the " Degenerator". Its a monophonic Synth with 2 Oscillators, 12Bit Sampling, Sequencer, Fx and more..


    Click image for larger version. 

Name:	55543692-2148428338575034-5416223690360619008-o.jpg 
Views:	97 
Size:	168.5 KB 
ID:	22331

    Video: https://youtu.be/-QxENbXdaIQ
    Video: https://youtu.be/e76NtkiX-qc


    Greetings from germany. Rolf

  2. #27
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    I have limited the screen area for the output of the samples to the lower half of the display.

    I want to use Bresenham's algorithm for drawing lines. Link: https://en.wikipedia.org/wiki/Bresen...line_algorithm

    Click image for larger version. 

Name:	20201106-154049.jpg 
Views:	63 
Size:	324.7 KB 
ID:	22338

    In my DIY Synth "Degenerator" I use Bresenham's algorithm to draw Oscilloscope waveforms (yellow waveform).

    I don't use a frame buffer in the Degenerator. For the oscilloscope function I use a small samplebuffer of 256Byte.

    Click image for larger version. 

Name:	20201106-155247.jpg 
Views:	67 
Size:	328.3 KB 
ID:	22339



    Code:
    #ifndef Oscilloscope_h_
    #define Oscilloscope_h_
    #include "AudioStream.h"
    #include "ST7735_t3.h"
    #include <Adafruit_GFX.h>
    #define NO_OF_BLOCKS 2
    
    class Oscilloscope : public AudioStream {
      public:
        Oscilloscope(void) : AudioStream(1, inputQueueArray) {
        }
        virtual void update(void);
        void ScreenSetup(ST7735_t3*);
        void Display(void);
        void AddtoBuffer(int16_t*);
    
      private:
        audio_block_t *inputQueueArray[1];
        ST7735_t3 *display;
        int16_t buffer[AUDIO_BLOCK_SAMPLES * NO_OF_BLOCKS];
        int16_t old_val[AUDIO_BLOCK_SAMPLES];
        uint32_t count = 0;
    };
    #endif
    
    void Oscilloscope::ScreenSetup(ST7735_t3 *screen) {
     __disable_irq();
      display = screen;
      __enable_irq();
    }
    
    void Oscilloscope::Display() {
    	__disable_irq();
      boolean crossing = false;
      int16_t pixel_x = 0;
      uint32_t i = 0;
       
      do {
        int16_t wave_data = buffer[i];
       if (crossing || wave_data > 0) {
          i++;
          wave_data = buffer[i];
          if (crossing || wave_data <0 ) {
            crossing = true;
            //int16_t pixel_y = map(wave_data, 32767, -32768, -100, 100) + 63;
    		int16_t pixel_y = map(wave_data, 32767, -32768, -64, 64) + 96;
    		
    		// limit sample size
    		if (pixel_y >= 66 && pixel_y <= 126)
    		{
    			 display->drawPixel(pixel_x + 15, old_val[pixel_x], ST7735_BLACK);//Remove previous pixel
    			 display->drawPixel(pixel_x + 15, pixel_y, ST7735_WHITE);//New pixel
    			 old_val[pixel_x] = {pixel_y};
    			 pixel_x++;
    		}
    		else{
    			old_val[pixel_x] = 96;
    			pixel_x++;
    		}        
          }
        }
        i++;
      } while (i < AUDIO_BLOCK_SAMPLES * NO_OF_BLOCKS);
    
      __enable_irq();
    }
    
    void Oscilloscope::AddtoBuffer(int16_t *audio) {
      const int16_t *begin = audio;
      const int16_t *end = audio + AUDIO_BLOCK_SAMPLES;
      __disable_irq();
      do {
        buffer[count++] = *audio;
        audio++;
      } while (audio < end);
        if(count > (AUDIO_BLOCK_SAMPLES * NO_OF_BLOCKS) -1){
          count = 0;
          Display();
        }
      __enable_irq();
    }
    
    void Oscilloscope::update(void) {
      if (!display) return;
      audio_block_t *block;
      block = receiveReadOnly(0);
      if (block) {
        AddtoBuffer(block->data);
        release(block);
      }
    }
    best regards and stay healthy. Rolf
    Last edited by Rolfdegen; 11-06-2020 at 02:07 PM.

  3. #28
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    If the frame buffer is switched off and the oscilloscope switched on, the image display above is destroyed. But the oscilloscope display no longer flickers

    Code:
    void setupDisplay() {
      tft.useFrameBuffer(false);
      tft.initR(INITR_BLACKTAB);
      tft.setRotation(3);
      tft.invertDisplay(false);
      renderBootUpPage();
      tft.updateScreen();
      threads.addThread(displayThread);
    }

  4. #29
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Hey everyone ..

    I once tried to display the audio block from a total of 8 voices.

    The unused inputs of "voiceMIxer1" and "voiceMixerM" are used by the other voices.

    "waveformMod1a" and "waveformMod1b" are the two waveform oscillators in one voice.

    Oscillator waveforms are "SINE", "bandlimited SAWTOOTH", "bandlimited SQUARE", "TRIANGLE", "bandlimidet pulse", "S&H", "variable TRIANGLE" (from Triangle to SAW) and USER waveforms.

    VoiceNo 1
    Click image for larger version. 

Name:	TSynth-One-Voice.jpg 
Views:	128 
Size:	59.9 KB 
ID:	22349
    Big picture: https://i.ibb.co/k3qbWvC/TSynth-One-Voice.jpg

    VoiceNo 1-8
    Click image for larger version. 

Name:	Jeannie-8-Voices.jpg 
Views:	126 
Size:	101.9 KB 
ID:	22350
    Big picture: https://i.ibb.co/rksd21P/Jeannie-8-Voices.jpg
    Last edited by Rolfdegen; 11-07-2020 at 01:52 PM.

  5. #30
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Word wrap error! wy ?


    error: invalid operands of types 'const char [41]' and 'const char [77]' to binary 'operator+

    Code:
    const static char* INITPATCH = "Solina,1.00,0.43,0.00,0,0,0.99,1.00,0.00" + 
    "1.00,0.47,0.0,12,-12,12,12,0,0.83,0.70,0.16,0.00,0.00,1.10,282.00,0.00" +
    "0.70,0.00,7.24,0,0,0,10.48,0,0,0.00,1,4.00,1448.00,0.22,1864.00,41.00,808.00" + 
    "0.92,991.00,5.60,0.83,0.00,0.0,0.0,0.0,0.0,0.0";

  6. #31
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,190
    + isn't defined on c strings. the String class can support that, not bare strings as concatenation
    involves memory management.

    You probably mean:
    Code:
    const static char* INITPATCH = "Solina,1.00,0.43,0.00,0,0,0.99,1.00,0.00\
    "1.00,0.47,0.0,12,-12,12,12,0,0.83,0.70,0.16,0.00,0.00,1.10,282.00,0.00\
    "0.70,0.00,7.24,0,0,0,10.48,0,0,0.00,1,4.00,1448.00,0.22,1864.00,41.00,808.00\
    "0.92,991.00,5.60,0.83,0.00,0.0,0.0,0.0,0.0,0.0";

  7. #32
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Thanks. The problem is solved without Quotes at the beginning of the line

    Code:
    const static char* INITPATCH = "INIT,1.00,0.43,0.00,0,0,0.99,1.00,0.00,1.00\
    0.47,0.0,12,-12,12,12,0,0.83,0.70,0.16,0.00,0.00,1.10,282.00,0.00,0.70,0.00\
    7.24,0,0,0,10.48,0,0,0.00,1,4.00,1448.00,0.22,1864.00,41.00,808.00,0.92,991.00\
    5.60,0.83,0.00,0.0,0.0,0.0,0.0,0.0,";

  8. #33
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Flickering in oscilloscope

    The flickering and Pixel disturbance into the oscilloscope function is the trigger flag (crossing flag) when drawing the waveform.
    When trigger (crossing flag) is turned off the wave drawing is very fine (see video).

    Video: https://youtu.be/HmxVKU90UlU


    Click image for larger version. 

Name:	Flicker.jpg 
Views:	70 
Size:	103.2 KB 
ID:	22361


    Code:
    void Oscilloscope::Display() {
    	__disable_irq();
    	boolean crossing = true;
    	int16_t pixel_x = 0;
    	uint32_t i = 0;
    	do {
    		int16_t wave_data = buffer[i];
    		if (crossing || wave_data > 0) {
    			i++;
    			wave_data = buffer[i];
    			if (crossing || wave_data <0 ) {
    				crossing = true;
    				int16_t pixel_y = map(wave_data, 32767, -32768, -100, 100) + 96;
    				display->drawPixel(pixel_x + 15, old_val[pixel_x], ST7735_BLACK);      // Remove previous pixel
    				display->drawPixel(pixel_x + 15, pixel_y, ST7735_WHITE);                   // Draw new pixel
    				old_val[pixel_x] = {pixel_y};
    				pixel_x++;
    			}
    		}
    		i++;
    	} while (i < AUDIO_BLOCK_SAMPLES * NO_OF_BLOCKS);
    
    	__enable_irq();
    }
    Last edited by Rolfdegen; 11-08-2020 at 04:07 PM.

  9. #34
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    294
    Hi,
    just a little thing about your design

    it appears that you have written the design by code
    because there is several inputs that have two signals together
    (only possible when written in code and imported into the GUI tool)

    example: (I/O pins are zero-based)

    from waveformMixer7 to (filter8 input 0)
    from (somewhere) to (filter8 input 0)

    from (filter8 output 0-2) to filterMixer5 (input 0-2)
    from (filter5 output 0-2) to filterMixer5 (input 0-2) <- this is a duplicate from above

    this can have some "unpredictable" results
    because according to Paul only the last assignmentis used

    example:
    Code:
    AudioSynthWaveformSine           sine1;
    AudioSynthWaveformSine           sine2;
    AudioOutputPT8211_2              pt8211_2_1;
    AudioConnection          patchCord1(sine1, 0, pt8211_2_1, 0); <- this is the first assignment to pt8211_2_1 input 0
    AudioConnection          patchCord2(sine2, 0, pt8211_2_1, 1); <- this is the first assignment to pt8211_2_1 input 1
    AudioConnection          patchCord1(sine2, 0, pt8211_2_1, 0); <- this is the last assignment to pt8211_2_1 input 0
    AudioConnection          patchCord2(sine1, 0, pt8211_2_1, 1); <- this is the last assignment to pt8211_2_1 input 1

  10. #35
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Hallo manicksan

    No. It only looks like this because many modules are on top of each other.

    Take a look at my export file from Designe tool. Its for 8 voices.

    Code:
    // GUItool: begin automatically generated code
    AudioSynthWaveform       constant1Dc;    //xy=146.5,499.50000190734863
    AudioSynthWaveform       pwmLfoA;        //xy=169.5,270.50000190734863
    AudioSynthWaveform       pwmLfoB;        //xy=169.5,270.50000190734863
    AudioSynthWaveform       pwa;            //xy=184.5,318.50000190734863
    AudioSynthWaveform       pwb;            //xy=187.5,363.50000190734863
    AudioSynthWaveform       pitchLfo;       //xy=199.5,173.50000190734863
    AudioSynthWaveform       glide1;         //xy=201.5,214.50000190734863
    AudioSynthWaveform       glide2;         //xy=201.5,214.50000190734863
    AudioSynthWaveform       glide3;         //xy=201.5,214.50000190734863
    AudioSynthWaveform       glide4;         //xy=201.5,214.50000190734863
    AudioSynthWaveform       glide5;         //xy=201.5,214.50000190734863
    AudioSynthWaveform       glide6;         //xy=201.5,214.50000190734863
    AudioSynthWaveform       glide7;         //xy=201.5,214.50000190734863
    AudioSynthWaveform       glide8;         //xy=201.5,214.50000190734863
    AudioSynthWaveform       pitchBend;      //xy=205.5,136.50000190734863
    AudioSynthWaveform       filterLfo;      //xy=243.5,694.5000019073486
    AudioSynthWaveform       keytracking1;   //xy=253.5,807.5000019073486
    AudioSynthWaveform       keytracking7;   //xy=253.5,807.5000019073486
    AudioSynthWaveform       keytracking2;   //xy=273.5,807.5000019073486
    AudioSynthWaveform       keytracking8;   //xy=273.5,807.5000019073486
    AudioSynthWaveform       keytracking3;   //xy=293.5,807.5000019073486
    AudioSynthWaveform       keytracking5;   //xy=293.5,807.5000019073486
    AudioSynthWaveform       keytracking4;   //xy=313.5,807.5000019073486
    AudioSynthWaveform       keytracking6;   //xy=313.5,807.5000019073486
    AudioSynthNoisePink      pink;           //xy=345.5,411.50000190734863
    AudioSynthNoiseWhite     white;          //xy=345.5,421.50000190734863
    AudioMixer4              pwMixer1a;      //xy=358.5,231.50000190734863
    AudioMixer4              pwMixer7a;      //xy=358.5,231.50000190734863
    AudioMixer4              pwMixer1b;      //xy=364.5,334.50000190734863
    AudioMixer4              pwMixer7b;      //xy=364.5,334.50000190734863
    AudioMixer4              noiseMixer;     //xy=365.5,431.50000190734863
    AudioMixer4              oscGlobalModMixer; //xy=373.5,157.50000190734863
    AudioMixer4              pwMixer4b;      //xy=390.5,1016.5000019073486
    AudioMixer4              pwMixer8b;      //xy=390.5,1016.5000019073486
    AudioMixer4              pwMixer4a;      //xy=391.5,949.5000019073486
    AudioMixer4              pwMixer8a;      //xy=391.5,949.5000019073486
    AudioMixer4              pwMixer2a;      //xy=400.5,534.5000019073486
    AudioMixer4              pwMixer5a;      //xy=400.5,534.5000019073486
    AudioMixer4              pwMixer2b;      //xy=400.5,615.5000019073486
    AudioMixer4              pwMixer5b;      //xy=400.5,615.5000019073486
    AudioMixer4              pwMixer3a;      //xy=430.5,750.5000019073486
    AudioMixer4              pwMixer6a;      //xy=430.5,750.5000019073486
    AudioMixer4              pwMixer3b;      //xy=435.5,825.5000019073486
    AudioMixer4              pwMixer6b;      //xy=435.5,825.5000019073486
    AudioSynthWaveformModulated waveformMod1b;  //xy=580.5,232.50000190734863
    AudioSynthWaveformModulated waveformMod7b;  //xy=580.5,232.50000190734863
    AudioSynthWaveformModulated waveformMod1a;  //xy=584.5,176.50000190734863
    AudioSynthWaveformModulated waveformMod7a;  //xy=584.5,176.50000190734863
    AudioSynthWaveformModulated waveformMod2b;  //xy=590.5,612.5000019073486
    AudioSynthWaveformModulated waveformMod8b;  //xy=590.5,612.5000019073486
    AudioSynthWaveformModulated waveformMod4a;  //xy=596.5,961.5000019073486
    AudioSynthWaveformModulated waveformMod8a;  //xy=596.5,961.5000019073486
    AudioSynthWaveformModulated waveformMod2a;  //xy=598.5,520.5000019073486
    AudioSynthWaveformModulated waveformMod5a;  //xy=598.5,520.5000019073486
    AudioSynthWaveformModulated waveformMod4b;  //xy=602.5,1002.5000019073486
    AudioSynthWaveformModulated waveformMod5b;  //xy=602.5,1002.5000019073486
    AudioSynthWaveformModulated waveformMod3a;  //xy=609.5,740.5000019073486
    AudioSynthWaveformModulated waveformMod6a;  //xy=609.5,740.5000019073486
    AudioSynthWaveformModulated waveformMod3b;  //xy=612.5,806.5000019073486
    AudioSynthWaveformModulated waveformMod6b;  //xy=612.5,806.5000019073486
    AudioMixer4              oscModMixer1a;  //xy=627.5,227.50000190734863
    AudioMixer4              oscModMixer7a;  //xy=627.5,227.50000190734863
    AudioMixer4              oscModMixer1b;  //xy=627.5,257.50000190734863
    AudioMixer4              oscModMixer7b;  //xy=627.5,257.50000190734863
    AudioMixer4              oscModMixer2a;  //xy=627.5,267.50000190734863
    AudioMixer4              oscModMixer8a;  //xy=627.5,267.50000190734863
    AudioMixer4              oscModMixer2b;  //xy=627.5,287.50000190734863
    AudioMixer4              oscModMixer8b;  //xy=627.5,287.50000190734863
    AudioMixer4              oscModMixer3a;  //xy=627.5,307.50000190734863
    AudioMixer4              oscModMixer5a;  //xy=627.5,307.50000190734863
    AudioMixer4              oscModMixer3b;  //xy=627.5,327.50000190734863
    AudioMixer4              oscModMixer5b;  //xy=627.5,327.50000190734863
    AudioMixer4              oscModMixer4a;  //xy=627.5,347.50000190734863
    AudioMixer4              oscModMixer6a;  //xy=627.5,347.50000190734863
    AudioMixer4              oscModMixer4b;  //xy=627.5,367.50000190734863
    AudioMixer4              oscModMixer6b;  //xy=627.5,367.50000190734863
    AudioEffectEnvelope      filterEnvelope4; //xy=694.5,1169.5000019073486
    AudioEffectEnvelope      filterEnvelope1; //xy=705.5,362.50000190734863
    AudioEffectEnvelope      filterEnvelope6; //xy=706.5,1169.5000019073486
    AudioEffectEnvelope      filterEnvelope7; //xy=706.5,1169.5000019073486
    AudioEffectEnvelope      filterEnvelope5; //xy=715.5,362.50000190734863
    AudioEffectEnvelope      filterEnvelope8; //xy=715.5,362.50000190734863
    AudioEffectEnvelope      filterEnvelope3; //xy=713.5,919.5000019073486
    AudioEffectEnvelope      filterEnvelope2; //xy=717.5,666.5000019073486
    AudioEffectDigitalCombine oscFX1;         //xy=740.5,285.50000190734863
    AudioEffectDigitalCombine oscFX7;         //xy=740.5,285.50000190734863
    AudioEffectDigitalCombine oscFX2;         //xy=761.5,604.5000019073486
    AudioEffectDigitalCombine oscFX8;         //xy=761.5,604.5000019073486
    AudioEffectDigitalCombine oscFX4;         //xy=763.5,1108.5000019073486
    AudioEffectDigitalCombine oscFX5;         //xy=763.5,1108.5000019073486
    AudioEffectDigitalCombine oscFX3;         //xy=764.5,865.5000019073486
    AudioEffectDigitalCombine oscFX6;         //xy=764.5,865.5000019073486
    AudioMixer4              waveformMixer8; //xy=894.5,451.5
    AudioMixer4              waveformMixer1; //xy=901.5,232.50000190734863
    AudioMixer4              waveformMixer7; //xy=901.5,232.50000190734863
    AudioMixer4              filterModMixer7; //xy=903.5,617.5
    AudioMixer4              waveformMixer2; //xy=906.5,538.5000019073486
    AudioMixer4              filterModMixer1; //xy=922.5,354.50000190734863
    AudioMixer4              waveformMixer3; //xy=923.5,836.5000019073486
    AudioMixer4              waveformMixer5; //xy=923.5,836.5000019073486
    AudioMixer4              filterModMixer2; //xy=925.5,699.5000019073486
    AudioMixer4              filterModMixer8; //xy=925.5,699.5000019073486
    AudioMixer4              filterModMixer3; //xy=929.5,999.5000019073486
    AudioMixer4              filterModMixer5; //xy=929.5,999.5000019073486
    AudioMixer4              waveformMixer4; //xy=931.5,1085.5000019073486
    AudioMixer4              waveformMixer6; //xy=931.5,1085.5000019073486
    AudioMixer4              filterModMixer4; //xy=932.5,1161.5000019073486
    AudioMixer4              filterModMixer6; //xy=932.5,1161.5000019073486
    AudioFilterStateVariable filter1;        //xy=1077.5,272.50000190734863
    AudioFilterStateVariable filter7;        //xy=1080.5,484.5
    AudioFilterStateVariable filter3;        //xy=1079.5,884.5000019073486
    AudioFilterStateVariable filter5;        //xy=1079.5,884.5000019073486
    AudioFilterStateVariable filter4;        //xy=1099.5,1109.5000019073486
    AudioFilterStateVariable filter6;        //xy=1099.5,1109.5000019073486
    AudioFilterStateVariable filter2;        //xy=1118.5,646.5
    AudioFilterStateVariable filter8;        //xy=1124.5,405.5
    AudioMixer4              filterMixer2;   //xy=1221.5,566.5000019073486
    AudioMixer4              filterMixer7;   //xy=1221.5,566.5000019073486
    AudioMixer4              filterMixer3;   //xy=1221.5,887.5000019073486
    AudioMixer4              filterMixer8;   //xy=1221.5,887.5000019073486
    AudioMixer4              filterMixer1;   //xy=1228.5,276.50000190734863
    AudioMixer4              filterMixer5;   //xy=1228.5,276.50000190734863
    AudioMixer4              filterMixer4;   //xy=1232.5,1112.5000019073486
    AudioMixer4              filterMixer6;   //xy=1232.5,1112.5000019073486
    AudioEffectEnvelope      ampEnvelope2;   //xy=1392.5,565.5000019073486
    AudioEffectEnvelope      ampEnvelope7;   //xy=1392.5,565.5000019073486
    AudioEffectEnvelope      ampEnvelope3;   //xy=1392.5,885.5000019073486
    AudioEffectEnvelope      ampEnvelope8;   //xy=1392.5,885.5000019073486
    AudioEffectEnvelope      ampEnvelope4;   //xy=1398.5,1107.5000019073486
    AudioEffectEnvelope      ampEnvelope5;   //xy=1398.5,1107.5000019073486
    AudioEffectEnvelope      ampEnvelope1;   //xy=1404.5,273.50000190734863
    AudioEffectEnvelope      ampEnvelope6;   //xy=1404.5,273.50000190734863
    AudioMixer4              voiceMixer1;    //xy=1621.5000228881836,416.25000762939453
    AudioMixer4              voiceMixer2;    //xy=1639.0000228881836,541.2500076293945
    AudioMixer4              volumeMixer;    //xy=1664.0000228881836,627.5000095367432
    AudioMixer4              voiceMixerM;    //xy=1811.5000267028809,428.75000762939453
    AudioMixer4              effectMixerR;   //xy=1846.7500305175781,636.2500114440918
    AudioMixer4              effectMixerL;   //xy=1852.0000267028809,561.5000076293945
    AudioFilterStateVariable dcOffsetFilter; //xy=1981.5000228881836,435.00001335144043
    AudioOutputUSB           usbAudio;       //xy=2034.7500648498535,641.7500143051147
    AudioOutputI2S           i2s;            //xy=2042.7500648498535,595.7500143051147
    AudioAnalyzePeak         peak;           //xy=2046.2500324249268,501.2500057220459
    AudioConnection          patchCord1(constant1Dc, filterEnvelope2);
    AudioConnection          patchCord2(constant1Dc, filterEnvelope3);
    AudioConnection          patchCord3(constant1Dc, filterEnvelope4);
    AudioConnection          patchCord4(constant1Dc, filterEnvelope1);
    AudioConnection          patchCord5(constant1Dc, filterEnvelope5);
    AudioConnection          patchCord6(constant1Dc, filterEnvelope6);
    AudioConnection          patchCord7(constant1Dc, filterEnvelope7);
    AudioConnection          patchCord8(constant1Dc, filterEnvelope8);
    AudioConnection          patchCord9(pwmLfoA, 0, pwMixer1a, 0);
    AudioConnection          patchCord10(pwmLfoA, 0, pwMixer2a, 0);
    AudioConnection          patchCord11(pwmLfoA, 0, pwMixer3a, 0);
    AudioConnection          patchCord12(pwmLfoA, 0, pwMixer4a, 0);
    AudioConnection          patchCord13(pwmLfoA, 0, pwMixer5a, 0);
    AudioConnection          patchCord14(pwmLfoA, 0, pwMixer6a, 0);
    AudioConnection          patchCord15(pwmLfoA, 0, pwMixer7a, 0);
    AudioConnection          patchCord16(pwmLfoA, 0, pwMixer8a, 0);
    AudioConnection          patchCord17(pwmLfoB, 0, pwMixer1b, 0);
    AudioConnection          patchCord18(pwmLfoB, 0, pwMixer2b, 0);
    AudioConnection          patchCord19(pwmLfoB, 0, pwMixer3b, 0);
    AudioConnection          patchCord20(pwmLfoB, 0, pwMixer4b, 0);
    AudioConnection          patchCord21(pwmLfoB, 0, pwMixer5b, 0);
    AudioConnection          patchCord22(pwmLfoB, 0, pwMixer6b, 0);
    AudioConnection          patchCord23(pwmLfoB, 0, pwMixer7b, 0);
    AudioConnection          patchCord24(pwmLfoB, 0, pwMixer8b, 0);
    AudioConnection          patchCord25(pwa, 0, pwMixer1a, 1);
    AudioConnection          patchCord26(pwa, 0, pwMixer2a, 1);
    AudioConnection          patchCord27(pwa, 0, pwMixer3a, 1);
    AudioConnection          patchCord28(pwa, 0, pwMixer4a, 1);
    AudioConnection          patchCord29(pwa, 0, pwMixer5a, 1);
    AudioConnection          patchCord30(pwa, 0, pwMixer6a, 1);
    AudioConnection          patchCord31(pwa, 0, pwMixer7a, 1);
    AudioConnection          patchCord32(pwa, 0, pwMixer8a, 1);
    AudioConnection          patchCord33(pwb, 0, pwMixer1b, 1);
    AudioConnection          patchCord34(pwb, 0, pwMixer2b, 1);
    AudioConnection          patchCord35(pwb, 0, pwMixer3b, 1);
    AudioConnection          patchCord36(pwb, 0, pwMixer4b, 1);
    AudioConnection          patchCord37(pwb, 0, pwMixer5b, 1);
    AudioConnection          patchCord38(pwb, 0, pwMixer6b, 1);
    AudioConnection          patchCord39(pwb, 0, pwMixer7b, 1);
    AudioConnection          patchCord40(pwb, 0, pwMixer8b, 1);
    AudioConnection          patchCord41(pitchLfo, 0, oscGlobalModMixer, 1);
    AudioConnection          patchCord42(glide1, 0, oscModMixer1a, 2);
    AudioConnection          patchCord43(glide1, 0, oscModMixer1b, 2);
    AudioConnection          patchCord44(glide2, 0, oscModMixer2a, 2);
    AudioConnection          patchCord45(glide2, 0, oscModMixer2b, 2);
    AudioConnection          patchCord46(glide3, 0, oscModMixer3a, 2);
    AudioConnection          patchCord47(glide3, 0, oscModMixer3b, 2);
    AudioConnection          patchCord48(glide4, 0, oscModMixer4a, 2);
    AudioConnection          patchCord49(glide4, 0, oscModMixer4b, 2);
    AudioConnection          patchCord50(glide5, 0, oscModMixer5a, 2);
    AudioConnection          patchCord51(glide5, 0, oscModMixer5b, 2);
    AudioConnection          patchCord52(glide6, 0, oscModMixer6a, 2);
    AudioConnection          patchCord53(glide6, 0, oscModMixer6b, 2);
    AudioConnection          patchCord54(glide7, 0, oscModMixer7a, 2);
    AudioConnection          patchCord55(glide7, 0, oscModMixer7b, 2);
    AudioConnection          patchCord56(glide8, 0, oscModMixer8a, 2);
    AudioConnection          patchCord57(glide8, 0, oscModMixer8b, 2);
    AudioConnection          patchCord58(pitchBend, 0, oscGlobalModMixer, 0);
    AudioConnection          patchCord59(filterLfo, 0, filterModMixer1, 1);
    AudioConnection          patchCord60(filterLfo, 0, filterModMixer2, 1);
    AudioConnection          patchCord61(filterLfo, 0, filterModMixer3, 1);
    AudioConnection          patchCord62(filterLfo, 0, filterModMixer4, 1);
    AudioConnection          patchCord63(filterLfo, 0, filterModMixer5, 1);
    AudioConnection          patchCord64(filterLfo, 0, filterModMixer6, 1);
    AudioConnection          patchCord65(filterLfo, 0, filterModMixer7, 1);
    AudioConnection          patchCord66(filterLfo, 0, filterModMixer8, 1);
    AudioConnection          patchCord67(keytracking1, 0, filterModMixer1, 2);
    AudioConnection          patchCord68(keytracking7, 0, filterModMixer7, 2);
    AudioConnection          patchCord69(keytracking2, 0, filterModMixer2, 2);
    AudioConnection          patchCord70(keytracking8, 0, filterModMixer8, 2);
    AudioConnection          patchCord71(keytracking3, 0, filterModMixer3, 2);
    AudioConnection          patchCord72(keytracking5, 0, filterModMixer5, 2);
    AudioConnection          patchCord73(keytracking4, 0, filterModMixer4, 2);
    AudioConnection          patchCord74(keytracking6, 0, filterModMixer6, 2);
    AudioConnection          patchCord75(pink, 0, noiseMixer, 0);
    AudioConnection          patchCord76(white, 0, noiseMixer, 1);
    AudioConnection          patchCord77(pwMixer1a, 0, waveformMod1a, 1);
    AudioConnection          patchCord78(pwMixer7a, 0, waveformMod7a, 1);
    AudioConnection          patchCord79(pwMixer1b, 0, waveformMod1b, 1);
    AudioConnection          patchCord80(pwMixer7b, 0, waveformMod7b, 1);
    AudioConnection          patchCord81(noiseMixer, 0, waveformMixer1, 2);
    AudioConnection          patchCord82(noiseMixer, 0, waveformMixer2, 2);
    AudioConnection          patchCord83(noiseMixer, 0, waveformMixer3, 2);
    AudioConnection          patchCord84(noiseMixer, 0, waveformMixer4, 2);
    AudioConnection          patchCord85(noiseMixer, 0, waveformMixer5, 2);
    AudioConnection          patchCord86(noiseMixer, 0, waveformMixer6, 2);
    AudioConnection          patchCord87(noiseMixer, 0, waveformMixer7, 2);
    AudioConnection          patchCord88(noiseMixer, 0, waveformMixer8, 2);
    AudioConnection          patchCord89(oscGlobalModMixer, 0, oscModMixer1a, 0);
    AudioConnection          patchCord90(oscGlobalModMixer, 0, oscModMixer1b, 0);
    AudioConnection          patchCord91(oscGlobalModMixer, 0, oscModMixer2a, 0);
    AudioConnection          patchCord92(oscGlobalModMixer, 0, oscModMixer2b, 0);
    AudioConnection          patchCord93(oscGlobalModMixer, 0, oscModMixer3a, 0);
    AudioConnection          patchCord94(oscGlobalModMixer, 0, oscModMixer3b, 0);
    AudioConnection          patchCord95(oscGlobalModMixer, 0, oscModMixer4a, 0);
    AudioConnection          patchCord96(oscGlobalModMixer, 0, oscModMixer4b, 0);
    AudioConnection          patchCord97(oscGlobalModMixer, 0, oscModMixer5a, 0);
    AudioConnection          patchCord98(oscGlobalModMixer, 0, oscModMixer5b, 0);
    AudioConnection          patchCord99(oscGlobalModMixer, 0, oscModMixer6a, 0);
    AudioConnection          patchCord100(oscGlobalModMixer, 0, oscModMixer6b, 0);
    AudioConnection          patchCord101(oscGlobalModMixer, 0, oscModMixer7a, 0);
    AudioConnection          patchCord102(oscGlobalModMixer, 0, oscModMixer7b, 0);
    AudioConnection          patchCord103(oscGlobalModMixer, 0, oscModMixer8a, 0);
    AudioConnection          patchCord104(oscGlobalModMixer, 0, oscModMixer8b, 0);
    AudioConnection          patchCord105(pwMixer4b, 0, waveformMod4b, 1);
    AudioConnection          patchCord106(pwMixer8b, 0, waveformMod8b, 1);
    AudioConnection          patchCord107(pwMixer4a, 0, waveformMod4a, 1);
    AudioConnection          patchCord108(pwMixer8a, 0, waveformMod8a, 1);
    AudioConnection          patchCord109(pwMixer2a, 0, waveformMod2a, 1);
    AudioConnection          patchCord110(pwMixer5a, 0, waveformMod5a, 1);
    AudioConnection          patchCord111(pwMixer2b, 0, waveformMod2b, 1);
    AudioConnection          patchCord112(pwMixer5b, 0, waveformMod5b, 1);
    AudioConnection          patchCord113(pwMixer3a, 0, waveformMod3a, 1);
    AudioConnection          patchCord114(pwMixer6a, 0, waveformMod6a, 1);
    AudioConnection          patchCord115(pwMixer3b, 0, waveformMod3b, 1);
    AudioConnection          patchCord116(pwMixer6b, 0, waveformMod6b, 1);
    AudioConnection          patchCord117(waveformMod1b, 0, waveformMixer1, 1);
    AudioConnection          patchCord118(waveformMod1b, 0, oscFX1, 1);
    AudioConnection          patchCord119(waveformMod1b, 0, oscModMixer1a, 3);
    AudioConnection          patchCord120(waveformMod7b, 0, waveformMixer7, 1);
    AudioConnection          patchCord121(waveformMod7b, 0, oscFX7, 1);
    AudioConnection          patchCord122(waveformMod7b, 0, oscModMixer7a, 3);
    AudioConnection          patchCord123(waveformMod1a, 0, waveformMixer1, 0);
    AudioConnection          patchCord124(waveformMod1a, 0, oscFX1, 0);
    AudioConnection          patchCord125(waveformMod1a, 0, oscModMixer1b, 3);
    AudioConnection          patchCord126(waveformMod7a, 0, waveformMixer7, 0);
    AudioConnection          patchCord127(waveformMod7a, 0, oscFX7, 0);
    AudioConnection          patchCord128(waveformMod7a, 0, oscModMixer7b, 3);
    AudioConnection          patchCord129(waveformMod2b, 0, waveformMixer2, 1);
    AudioConnection          patchCord130(waveformMod2b, 0, oscFX2, 1);
    AudioConnection          patchCord131(waveformMod2b, 0, oscModMixer2a, 3);
    AudioConnection          patchCord132(waveformMod8b, 0, waveformMixer8, 1);
    AudioConnection          patchCord133(waveformMod8b, 0, oscFX8, 1);
    AudioConnection          patchCord134(waveformMod8b, 0, oscModMixer8a, 3);
    AudioConnection          patchCord135(waveformMod4a, 0, waveformMixer4, 0);
    AudioConnection          patchCord136(waveformMod4a, 0, oscFX4, 0);
    AudioConnection          patchCord137(waveformMod4a, 0, oscModMixer4b, 3);
    AudioConnection          patchCord138(waveformMod8a, 0, waveformMixer8, 0);
    AudioConnection          patchCord139(waveformMod8a, 0, oscFX8, 0);
    AudioConnection          patchCord140(waveformMod8a, 0, oscModMixer8b, 3);
    AudioConnection          patchCord141(waveformMod2a, 0, waveformMixer2, 0);
    AudioConnection          patchCord142(waveformMod2a, 0, oscFX2, 0);
    AudioConnection          patchCord143(waveformMod2a, 0, oscModMixer2b, 3);
    AudioConnection          patchCord144(waveformMod5a, 0, waveformMixer5, 0);
    AudioConnection          patchCord145(waveformMod5a, 0, oscFX5, 0);
    AudioConnection          patchCord146(waveformMod5a, 0, oscModMixer5b, 3);
    AudioConnection          patchCord147(waveformMod4b, 0, waveformMixer4, 1);
    AudioConnection          patchCord148(waveformMod4b, 0, oscFX4, 1);
    AudioConnection          patchCord149(waveformMod4b, 0, oscModMixer4a, 3);
    AudioConnection          patchCord150(waveformMod5b, 0, waveformMixer5, 1);
    AudioConnection          patchCord151(waveformMod5b, 0, oscFX5, 1);
    AudioConnection          patchCord152(waveformMod5b, 0, oscModMixer5a, 3);
    AudioConnection          patchCord153(waveformMod3a, 0, oscFX3, 0);
    AudioConnection          patchCord154(waveformMod3a, 0, waveformMixer3, 0);
    AudioConnection          patchCord155(waveformMod3a, 0, oscModMixer3b, 3);
    AudioConnection          patchCord156(waveformMod6a, 0, waveformMixer6, 0);
    AudioConnection          patchCord157(waveformMod6a, 0, oscFX6, 0);
    AudioConnection          patchCord158(waveformMod6a, 0, oscModMixer6b, 3);
    AudioConnection          patchCord159(waveformMod3b, 0, oscFX3, 1);
    AudioConnection          patchCord160(waveformMod3b, 0, waveformMixer3, 1);
    AudioConnection          patchCord161(waveformMod3b, 0, oscModMixer3a, 3);
    AudioConnection          patchCord162(waveformMod6b, 0, waveformMixer6, 1);
    AudioConnection          patchCord163(waveformMod6b, 0, oscFX6, 1);
    AudioConnection          patchCord164(waveformMod6b, 0, oscModMixer6a, 3);
    AudioConnection          patchCord165(oscModMixer1a, 0, waveformMod1a, 0);
    AudioConnection          patchCord166(oscModMixer7a, 0, waveformMod7a, 0);
    AudioConnection          patchCord167(oscModMixer1b, 0, waveformMod1b, 0);
    AudioConnection          patchCord168(oscModMixer7b, 0, waveformMod7b, 0);
    AudioConnection          patchCord169(oscModMixer2a, 0, waveformMod2a, 0);
    AudioConnection          patchCord170(oscModMixer8a, 0, waveformMod8a, 0);
    AudioConnection          patchCord171(oscModMixer2b, 0, waveformMod2b, 0);
    AudioConnection          patchCord172(oscModMixer8b, 0, waveformMod8b, 0);
    AudioConnection          patchCord173(oscModMixer3a, 0, waveformMod3a, 0);
    AudioConnection          patchCord174(oscModMixer5a, 0, waveformMod5a, 0);
    AudioConnection          patchCord175(oscModMixer3b, 0, waveformMod3b, 0);
    AudioConnection          patchCord176(oscModMixer5b, 0, waveformMod5b, 0);
    AudioConnection          patchCord177(oscModMixer4a, 0, waveformMod4a, 0);
    AudioConnection          patchCord178(oscModMixer6a, 0, waveformMod6a, 0);
    AudioConnection          patchCord179(oscModMixer4b, 0, waveformMod4b, 0);
    AudioConnection          patchCord180(oscModMixer6b, 0, waveformMod6b, 0);
    AudioConnection          patchCord181(filterEnvelope4, 0, filterModMixer4, 0);
    AudioConnection          patchCord182(filterEnvelope4, 0, pwMixer4a, 2);
    AudioConnection          patchCord183(filterEnvelope4, 0, pwMixer4b, 2);
    AudioConnection          patchCord184(filterEnvelope4, 0, oscModMixer4a, 1);
    AudioConnection          patchCord185(filterEnvelope4, 0, oscModMixer4b, 1);
    AudioConnection          patchCord186(filterEnvelope1, 0, filterModMixer1, 0);
    AudioConnection          patchCord187(filterEnvelope1, 0, pwMixer1a, 2);
    AudioConnection          patchCord188(filterEnvelope1, 0, pwMixer1b, 2);
    AudioConnection          patchCord189(filterEnvelope1, 0, oscModMixer1a, 1);
    AudioConnection          patchCord190(filterEnvelope1, 0, oscModMixer1b, 1);
    AudioConnection          patchCord191(filterEnvelope6, 0, filterModMixer6, 0);
    AudioConnection          patchCord192(filterEnvelope6, 0, pwMixer6a, 2);
    AudioConnection          patchCord193(filterEnvelope6, 0, pwMixer6b, 2);
    AudioConnection          patchCord194(filterEnvelope6, 0, oscModMixer6a, 1);
    AudioConnection          patchCord195(filterEnvelope6, 0, oscModMixer6b, 1);
    AudioConnection          patchCord196(filterEnvelope7, 0, filterModMixer7, 0);
    AudioConnection          patchCord197(filterEnvelope7, 0, pwMixer7a, 2);
    AudioConnection          patchCord198(filterEnvelope7, 0, pwMixer7b, 2);
    AudioConnection          patchCord199(filterEnvelope7, 0, oscModMixer7a, 1);
    AudioConnection          patchCord200(filterEnvelope7, 0, oscModMixer7b, 1);
    AudioConnection          patchCord201(filterEnvelope5, 0, filterModMixer5, 0);
    AudioConnection          patchCord202(filterEnvelope5, 0, pwMixer5a, 2);
    AudioConnection          patchCord203(filterEnvelope5, 0, pwMixer5b, 2);
    AudioConnection          patchCord204(filterEnvelope5, 0, oscModMixer5a, 1);
    AudioConnection          patchCord205(filterEnvelope5, 0, oscModMixer5b, 1);
    AudioConnection          patchCord206(filterEnvelope8, 0, filterModMixer8, 0);
    AudioConnection          patchCord207(filterEnvelope8, 0, pwMixer8a, 2);
    AudioConnection          patchCord208(filterEnvelope8, 0, pwMixer8b, 2);
    AudioConnection          patchCord209(filterEnvelope8, 0, oscModMixer8a, 1);
    AudioConnection          patchCord210(filterEnvelope8, 0, oscModMixer8b, 1);
    AudioConnection          patchCord211(filterEnvelope3, 0, filterModMixer3, 0);
    AudioConnection          patchCord212(filterEnvelope3, 0, pwMixer3a, 2);
    AudioConnection          patchCord213(filterEnvelope3, 0, pwMixer3b, 2);
    AudioConnection          patchCord214(filterEnvelope3, 0, oscModMixer3a, 1);
    AudioConnection          patchCord215(filterEnvelope3, 0, oscModMixer3b, 1);
    AudioConnection          patchCord216(filterEnvelope2, 0, filterModMixer2, 0);
    AudioConnection          patchCord217(filterEnvelope2, 0, pwMixer2a, 2);
    AudioConnection          patchCord218(filterEnvelope2, 0, pwMixer2b, 2);
    AudioConnection          patchCord219(filterEnvelope2, 0, oscModMixer2a, 1);
    AudioConnection          patchCord220(filterEnvelope2, 0, oscModMixer2b, 1);
    AudioConnection          patchCord221(oscFX1, 0, waveformMixer1, 3);
    AudioConnection          patchCord222(oscFX7, 0, waveformMixer7, 3);
    AudioConnection          patchCord223(oscFX2, 0, waveformMixer2, 3);
    AudioConnection          patchCord224(oscFX8, 0, waveformMixer8, 3);
    AudioConnection          patchCord225(oscFX4, 0, waveformMixer4, 3);
    AudioConnection          patchCord226(oscFX5, 0, waveformMixer5, 3);
    AudioConnection          patchCord227(oscFX3, 0, waveformMixer3, 3);
    AudioConnection          patchCord228(oscFX6, 0, waveformMixer6, 3);
    AudioConnection          patchCord229(waveformMixer8, 0, filter8, 0);
    AudioConnection          patchCord230(waveformMixer1, 0, filter1, 0);
    AudioConnection          patchCord231(waveformMixer7, 0, filter7, 0);
    AudioConnection          patchCord232(filterModMixer7, 0, filter7, 1);
    AudioConnection          patchCord233(waveformMixer2, 0, filter2, 0);
    AudioConnection          patchCord234(filterModMixer1, 0, filter1, 1);
    AudioConnection          patchCord235(waveformMixer3, 0, filter3, 0);
    AudioConnection          patchCord236(waveformMixer5, 0, filter5, 0);
    AudioConnection          patchCord237(filterModMixer2, 0, filter2, 1);
    AudioConnection          patchCord238(filterModMixer8, 0, filter8, 1);
    AudioConnection          patchCord239(filterModMixer3, 0, filter3, 1);
    AudioConnection          patchCord240(filterModMixer5, 0, filter5, 1);
    AudioConnection          patchCord241(waveformMixer4, 0, filter4, 0);
    AudioConnection          patchCord242(waveformMixer6, 0, filter6, 0);
    AudioConnection          patchCord243(filterModMixer4, 0, filter4, 1);
    AudioConnection          patchCord244(filterModMixer6, 0, filter6, 1);
    AudioConnection          patchCord245(filter1, 0, filterMixer1, 0);
    AudioConnection          patchCord246(filter1, 1, filterMixer1, 1);
    AudioConnection          patchCord247(filter1, 2, filterMixer1, 2);
    AudioConnection          patchCord248(filter7, 0, filterMixer7, 0);
    AudioConnection          patchCord249(filter7, 1, filterMixer7, 1);
    AudioConnection          patchCord250(filter7, 2, filterMixer7, 2);
    AudioConnection          patchCord251(filter3, 0, filterMixer3, 0);
    AudioConnection          patchCord252(filter3, 1, filterMixer3, 1);
    AudioConnection          patchCord253(filter3, 2, filterMixer3, 2);
    AudioConnection          patchCord254(filter5, 0, filterMixer5, 0);
    AudioConnection          patchCord255(filter5, 1, filterMixer5, 1);
    AudioConnection          patchCord256(filter5, 2, filterMixer5, 2);
    AudioConnection          patchCord257(filter4, 0, filterMixer4, 0);
    AudioConnection          patchCord258(filter4, 1, filterMixer4, 1);
    AudioConnection          patchCord259(filter4, 2, filterMixer4, 2);
    AudioConnection          patchCord260(filter6, 0, filterMixer6, 0);
    AudioConnection          patchCord261(filter6, 1, filterMixer6, 1);
    AudioConnection          patchCord262(filter6, 2, filterMixer6, 2);
    AudioConnection          patchCord263(filter2, 0, filterMixer2, 0);
    AudioConnection          patchCord264(filter2, 1, filterMixer2, 1);
    AudioConnection          patchCord265(filter2, 2, filterMixer2, 2);
    AudioConnection          patchCord266(filter8, 0, filterMixer8, 0);
    AudioConnection          patchCord267(filter8, 1, filterMixer8, 1);
    AudioConnection          patchCord268(filter8, 2, filterMixer8, 2);
    AudioConnection          patchCord269(filterMixer2, ampEnvelope2);
    AudioConnection          patchCord270(filterMixer7, ampEnvelope7);
    AudioConnection          patchCord271(filterMixer3, ampEnvelope3);
    AudioConnection          patchCord272(filterMixer8, ampEnvelope8);
    AudioConnection          patchCord273(filterMixer1, ampEnvelope1);
    AudioConnection          patchCord274(filterMixer5, ampEnvelope5);
    AudioConnection          patchCord275(filterMixer4, ampEnvelope4);
    AudioConnection          patchCord276(filterMixer6, ampEnvelope6);
    AudioConnection          patchCord277(ampEnvelope2, 0, voiceMixer1, 1);
    AudioConnection          patchCord278(ampEnvelope7, 0, voiceMixer2, 2);
    AudioConnection          patchCord279(ampEnvelope3, 0, voiceMixer1, 2);
    AudioConnection          patchCord280(ampEnvelope8, 0, voiceMixer2, 3);
    AudioConnection          patchCord281(ampEnvelope4, 0, voiceMixer1, 3);
    AudioConnection          patchCord282(ampEnvelope5, 0, voiceMixer2, 0);
    AudioConnection          patchCord283(ampEnvelope1, 0, voiceMixer1, 0);
    AudioConnection          patchCord284(ampEnvelope6, 0, voiceMixer2, 1);
    AudioConnection          patchCord285(voiceMixer1, 0, voiceMixerM, 0);
    AudioConnection          patchCord286(voiceMixer2, 0, voiceMixerM, 1);
    AudioConnection          patchCord287(volumeMixer, 0, effectMixerL, 0);
    AudioConnection          patchCord288(volumeMixer, 0, effectMixerR, 0);
    AudioConnection          patchCord289(voiceMixerM, 0, dcOffsetFilter, 0);
    AudioConnection          patchCord290(effectMixerR, 0, usbAudio, 1);
    AudioConnection          patchCord291(effectMixerR, 0, i2s, 1);
    AudioConnection          patchCord292(effectMixerL, 0, i2s, 0);
    AudioConnection          patchCord293(effectMixerL, 0, usbAudio, 0);
    AudioConnection          patchCord294(dcOffsetFilter, 2, volumeMixer, 0);
    AudioConnection          patchCord295(dcOffsetFilter, 2, peak, 0);
    AudioControlSGTL5000     sgtl5000_1;     //xy=2031.7500648498535,553.7500143051147
    // GUItool: end automatically generated code
    Greetings from germany. Rolf

  11. #36
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    I use Tsynth's oscilloscope in my DIY synthesizer. Waveform drawing flickers and have speeks (see my video).

    Click image for larger version. 

Name:	Flicker.jpg 
Views:	67 
Size:	103.2 KB 
ID:	22366

    Video: https://youtu.be/HmxVKU90UlU


    The problem: The trigger function is used in the playback buffer and not in the recording buffer.

    I hope I can find a solution for this.

    Code:
    #ifndef Oscilloscope_h_
    #define Oscilloscope_h_
    #include "AudioStream.h"
    #include "ST7735_t3.h"
    #define NO_OF_BLOCKS 2
    
    class Oscilloscope : public AudioStream {
      public:
        Oscilloscope(void) : AudioStream(1, inputQueueArray) {
        }
        virtual void update(void);
        void ScreenSetup(ST7735_t3*);
        void Display(void);
        void AddtoBuffer(int16_t*);
    
      private:
        audio_block_t *inputQueueArray[1];
        ST7735_t3 *display;
        int16_t buffer[AUDIO_BLOCK_SAMPLES * NO_OF_BLOCKS];
        int16_t old_val[AUDIO_BLOCK_SAMPLES];
        uint32_t count = 0;
    };
    #endif
    
    void Oscilloscope::ScreenSetup(ST7735_t3 *screen) {
      __disable_irq();
      display = screen;
      __enable_irq();
    }
    
    void Oscilloscope::Display() {
      __disable_irq();
      boolean crossing = false;
      int16_t pixel_x = 0;
      uint32_t i = 0;
      do {
        int16_t wave_data = buffer[i];
        if (crossing || wave_data > 0) {
          i++;
          wave_data = buffer[i];
          if (crossing || wave_data <0 ) {
            crossing = true;
            int16_t pixel_y = map(wave_data, 32767, -32768, -100, 100) + 62;
            display->drawPixel(pixel_x + 15, old_val[pixel_x], 0);//Remove previous pixel
            display->drawPixel(pixel_x + 15, pixel_y, 0x07B0);//New pixel
            old_val[pixel_x] = {pixel_y};
            pixel_x++;
          }
        }
        i++;
      } while (i < AUDIO_BLOCK_SAMPLES * NO_OF_BLOCKS);
    
      __enable_irq();
    }
    
    void Oscilloscope::AddtoBuffer(int16_t *audio) {
      const int16_t *begin = audio;
      const int16_t *end = audio + AUDIO_BLOCK_SAMPLES;
      __disable_irq();
      do {
        buffer[count++] = *audio;
        audio++;
      } while (audio < end);
        if(count > (AUDIO_BLOCK_SAMPLES * NO_OF_BLOCKS) -1){
          count = 0;
          Display();
        }
      __enable_irq();
    }
    
    void Oscilloscope::update(void) {
      if (!display) return;
      audio_block_t *block;
      block = receiveReadOnly(0);
      if (block) {
        AddtoBuffer(block->data);
        release(block);
      }
    }
    Greetings Rolf

  12. #37
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Hallo friend..

    The waveforms in the oscilloscope are now drawn in lines. The screen is flicker-free and has no speeks (see my video).

    Click image for larger version. 

Name:	20201110-010723.jpg 
Views:	53 
Size:	264.5 KB 
ID:	22373

    Video: https://youtu.be/ixhqq_wxLYI

    Code:
    #ifndef Oscilloscope_h_
    #define Oscilloscope_h_
    #include "AudioStream.h"
    #include "ST7735_t3.h"
    #include <Adafruit_GFX.h>
    
    
    class Oscilloscope : public AudioStream {	
      public:
        Oscilloscope(void) : AudioStream(1, inputQueueArray) {
        }	
        virtual void update(void);
        void ScreenSetup(ST7735_t3*);
        void Display(void);
        void AddtoBuffer(int16_t*);
    
      private:
        audio_block_t *inputQueueArray[1];
        ST7735_t3 *display;
    	int16_t buffer[AUDIO_BLOCK_SAMPLES];
        int16_t old_val[AUDIO_BLOCK_SAMPLES+1];
        uint32_t count = 0;
    };
    #endif
    
    
    void Oscilloscope::ScreenSetup(ST7735_t3 *screen) {
     __disable_irq();
      display = screen;
      __enable_irq();
    }
    
    void Oscilloscope::Display() {
    	__disable_irq();
    	uint8_t pixel_x = 0;
    	uint8_t i = 0;
    	old_val[0] = 96;
    	do {
    		int16_t wave_data = buffer[i];
    		int16_t pixel_y = map(wave_data, 32767, -32768, -100, 100) + 96;
    		if (pixel_y < 65) {
    			pixel_y = 65;
    			display->drawLine(pixel_x + 15, old_val[i], pixel_x + 15, pixel_y, ST7735_BLACK);//New pixel
    		}
    		else if (pixel_y > 125) {
    			pixel_y = 125;
    			display->drawLine(pixel_x + 15, old_val[i], pixel_x + 15, pixel_y, ST7735_BLACK);//New pixel
    		}
    		else {
    			display->drawLine(pixel_x + 15, old_val[i], pixel_x + 15, pixel_y, ST7735_BLUE);//New pixel
    		}
    		old_val[i+1] = pixel_y;
    		pixel_x++;
    		i++;
    	} while (i < (AUDIO_BLOCK_SAMPLES -1));
    	__enable_irq();
    }
    
    void Oscilloscope::AddtoBuffer(int16_t *audio) {
    	const int16_t *begin = audio;
    	const int16_t *end = audio + AUDIO_BLOCK_SAMPLES;
    	int sample1 = 0;
    	int sample2 = 0;
    	
    	__disable_irq();
    	sample1 = *audio;
    	audio++;
    	sample2 = *audio;
    	if (sample1 > 0 && sample2 < 0){	// Scope Triggering
    		do {
    			buffer[count++] = *audio;
    			audio++;
    		} while (audio < end);
    		if(count > (AUDIO_BLOCK_SAMPLES) -1){
    			count = 0;
    		}
    	}
    	Display();
    	__enable_irq();	
    }
    
    void Oscilloscope::update(void) {		
      if (!display) return;
      audio_block_t *block;
      block = receiveReadOnly(0);
      if (block) {
        AddtoBuffer(block->data);
        release(block);
      }
    }
    Greetings and good night. Rolf

  13. #38
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Hello..

    After a long illness I will report back and look with relish
    in the future. My "Jeannie" is also asking when it will continue
    with the synthesizer development.

    Since the whole wire entanglement under the circuit board was on the kecks, I got
    I decided to rebuild the whole thing and
    to solder properly.

    Since the internal AD converter in the Teensy processor is too noisy,
    the potentiometer query and the four modulation inputs
    inexpensive ATmega168 processor used.

    This is sent cyclically from the Teensy processor via a serial line
    queried and delivers the ADC values.


    I wish you a nice and peaceful Christmas and stay
    healthy holy-willi. Rolf

  14. #39
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Hello and Merry Christmas holy-willi

    I now had some time and inclination again and on my "Jeannie"
    continued working.

    I have now soldered the entire synth on a breadboard and
    a power supply + 5V and + 3.3V integrated.

    The whole thing is supplied by a 9V plug-in power supply. The 7805 will be approx.
    39C warm at a max. Load of 160mA.

    The Arduino Nano Board (ATmega328) for the Poti query and
    Modulation inputs will later be replaced by an Atmega328.

    The integrated ATmega328 would be an XT version with many potentiometers
    and switches are conceivable.

    As a 16Bit Dac I now use the inexpensive PT8211. That is from
    Teensy 4.1 board controlled with 4x oversampling (88KHz).

    A simple low-pass filter at the output is sufficient. Additionally will
    a switchable bass boost (bass booster) is also integrated.



    Greetings Rolf
    Last edited by Rolfdegen; 12-26-2020 at 12:07 PM. Reason: Pic error

  15. #40
    Senior Member fdaniels's Avatar
    Join Date
    Oct 2020
    Location
    Ostwestfalen, Germany
    Posts
    111
    Why do you use a ATmega for the Pots - it will be the bottleneck if you want to have fast Modulations. Have you tried any kind of A/D instead?

  16. #41
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    I changed it. Now using an MCP3208 with 8 channels and 12Bit resolution and it is clocked at 1.6MHz on the Teensy SPI port.

    The MCP3208 has very little noise 1 LSB

    Last edited by Rolfdegen; 12-28-2020 at 05:04 PM. Reason: I will editing my post. Not delete!

  17. #42
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Hello..

    I've changed the circuit a little. Instead of an ATmega
    an MCP3208 with 8 channels and a resolution of 12 bits is used. The
    MCP3208 works with 3.3V and has a very low noise of 1
    LSB. The ADC data is transmitted via the Teensy SPI port 0 at 1.6 MHz
    Transfer clock rate.



    Greetings Rolf

  18. #43
    Senior Member fdaniels's Avatar
    Join Date
    Oct 2020
    Location
    Ostwestfalen, Germany
    Posts
    111
    ...and why dont you just use 4 Encoders instead if the Pots?

  19. #44
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    I also need analog modulation inputs. Encoders require more control lines.

  20. #45
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Hello and hopefully to a happy new year 2021

    I continued to work on the "Jeannie" and the selection of different waveform banks added.

    With the free WaveEditor from Synthesis Technology I have the different wave created and

    transferred into my program code with the help of Audacity and a HexEditor Nero.


    Link: Synthesis technology

    Link: Audacity

    Link: HexEditor Nero


    Link: Youtube


  21. #46
    Senior Member fdaniels's Avatar
    Join Date
    Oct 2020
    Location
    Ostwestfalen, Germany
    Posts
    111
    How do you plan to generate the CVs for the analog Filter Boards?

  22. #47
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Hallo Daniels

    Jeannie has digital filters. State variable 12dB filter (SVF) with continuous mix between LP and HP (provides notch filter) and BP Cutoff freq and resonance.

    Four inputs on the MCP3208 are for external modulation via cv.

  23. #48
    Senior Member fdaniels's Avatar
    Join Date
    Oct 2020
    Location
    Ostwestfalen, Germany
    Posts
    111
    ... so basically it hasnt anything to do with the Shruthi anymore, right? May i propose to change the Threads title then?
    Last edited by fdaniels; 01-04-2021 at 09:31 AM.

  24. #49
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    Yes. Its a Teensy Synth. The name of my Synth is "Jeannie" from "I Dream of Jeannie" an American fantasy sitcom from the 60s :

    Greatings from germany. Rolf


    My german block: https://www.sequencer.de/synthesizer....87599/page-23

  25. #50
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    221
    circuit diagram


    Subject to change. Greatings Rolf

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •