Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: T40 with CPU Max >33%=> noise and stuttering

  1. #1

    T40 with CPU Max >33%=> noise and stuttering

    I'm working on a rather large project (6 voices with filters, vca, delay etc). When I'm using more than 1 voice at a given constellation (more than 10 sin osc at the same time), I'm getting louad noises and the audio stutters. The measure Memory max is 42 and CPU max is 34%. Is that a reasonable limit for the T40 CPU?

  2. #2
    It doesn't seem like a reasonable limit, to me.

    What DAC is being used?

  3. #3
    I'm using the Audio board's DAC.

  4. #4
    Hello, could we see your code please, particularly the audio objects and connections - having objects created in the 'wrong' order will cause unwanted noise.

  5. #5
    I was able to reduce the effect by combining the original state var. filter and my moog filter into one object. That solved the problem in a way, that I can reach 65% now without troubles.
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    // GUItool: begin automatically generated code
    AudioSynthWaveform       lfo1;           //xy=70,460
    AudioSynthWaveformDc     dc3;            //xy=254,327
    AudioSynthWaveformDc     dc2;            //xy=255,178
    AudioSynthWaveformDc     dc1;            //xy=258,46
    AudioSynthWaveformHarmGen harm_fm3;       //xy=258,406
    AudioSynthWaveformDc     dc4;            //xy=258,471
    AudioSynthWaveformDc     dc6;            //xy=258,742
    AudioSynthWaveformHarmGen harm_fm1;       //xy=264,88
    AudioSynthWaveformDc     dc5;            //xy=262,590
    AudioSynthWaveformHarmGen harm_fm2;       //xy=264,227
    AudioSynthWaveformHarmGen harm_fm6;       //xy=266,790
    AudioSynthWaveformHarmGen harm_fm4;       //xy=269,522
    AudioSynthWaveformHarmGen harm_fm5;       //xy=269,661
    AudioSynthWaveformDc     dc9;            //xy=418,411
    AudioSynthWaveformDc     dc12;           //xy=423,814
    AudioSynthWaveformDc     dc10;           //xy=428,536
    AudioEffectMultiply      multiply4;      //xy=429,479
    AudioSynthWaveformDc     dc11;           //xy=433,643
    AudioSynthWaveformDc     dc8;            //xy=438,260
    AudioEffectMultiply      multiply3;      //xy=441,315
    AudioEffectMultiply      multiply5;      //xy=441,595
    AudioSynthWaveformDc     dc7;            //xy=443,115
    AudioEffectMultiply      multiply2;      //xy=444,185
    AudioEffectMultiply      multiply1;      //xy=445,51
    AudioEffectMultiply      multiply6;      //xy=444,749
    AudioSynthWaveform       lfo2;           //xy=566,449
    AudioEffectEnvelope      envelope6;      //xy=574,814
    AudioEffectEnvelope      envelope5;      //xy=576,644
    AudioEffectEnvelope      envelope3;      //xy=578,397
    AudioEffectEnvelope      envelope1;      //xy=580,114
    AudioEffectEnvelope      envelope4;      //xy=581,537
    AudioEffectEnvelope      envelope2;      //xy=587,261
    AudioMixer4              mixlfo1;        //xy=758.8888549804688,116.55555725097656
    AudioMixer4              mixlfo3;        //xy=760.3333740234375,402.4444580078125
    AudioMixer4              mixlfo4;        //xy=761.4444580078125,551.6666870117188
    AudioMixer4              mixlfo2;        //xy=763.6666259765625,274.2222595214844
    AudioMixer4              mixlfo6;        //xy=763.5556030273438,820.888916015625
    AudioMixer4              mixlfo5;        //xy=771,689.5555419921875
    AudioFilterMoog filter2;        //xy=914,78
    AudioFilterMoog filter5;        //xy=914.5556030273438,384.5555419921875
    AudioFilterMoog filter4;        //xy=921,218
    AudioFilterMoog filter6;        //xy=922.3333740234375,518.5556030273438
    AudioFilterMoog filter8;        //xy=924.4445190429688,783.0000610351562
    AudioFilterMoog filter7;        //xy=925,664
    AudioMixer4              mixfilter1;     //xy=1183.9998779296875,70
    AudioMixer4              mixfilter2;     //xy=1187,212
    AudioMixer4              mixfilter3;     //xy=1188.6666259765625,352.2221984863281
    AudioSynthWaveform       lfo3;           //xy=1193.77783203125,437.33331298828125
    AudioMixer4              mixfilter6;     //xy=1214.444580078125,768.7777709960938
    AudioMixer4              mixfilter4;     //xy=1215.888671875,504.6666259765625
    AudioMixer4              mixfilter5;     //xy=1215.8887939453125,629.2222290039062
    AudioEffectEnvelope      envelope12;     //xy=1400.4444580078125,769.2222290039062
    AudioEffectMultiply      multiply12;     //xy=1401.4444580078125,729.2222290039062
    AudioEffectEnvelope      envelope11;     //xy=1405.4444580078125,661.2222290039062
    AudioEffectMultiply      multiply11;     //xy=1405.6666259765625,623.7777709960938
    AudioEffectMultiply      multiply8;      //xy=1408.4444580078125,263.22222900390625
    AudioEffectMultiply      multiply9;      //xy=1408.4444580078125,357.22222900390625
    AudioEffectMultiply      multiply7;      //xy=1409.4444580078125,173.2222442626953
    AudioEffectMultiply      multiply10;     //xy=1408.4444580078125,516.2222290039062
    AudioEffectEnvelope      envelope10;     //xy=1409.4444580078125,555.2222290039062
    AudioEffectEnvelope      envelope7;      //xy=1412.4444580078125,215.22222900390625
    AudioEffectEnvelope      envelope8;      //xy=1412.4444580078125,310.22222900390625
    AudioEffectEnvelope      envelope9;      //xy=1412.4444580078125,401.22222900390625
    AudioMixer4              vca6;           //xy=1539,756
    AudioMixer4              vca5;           //xy=1550,661
    AudioMixer4              vca4;           //xy=1552,550
    AudioMixer4              vca3;           //xy=1559,395
    AudioMixer4              vca1;           //xy=1562,216
    AudioMixer4              vca2;           //xy=1564,294
    AudioMixer4              vca5_6;         //xy=1719,657
    AudioMixer4              vca1_4;         //xy=1722,327
    AudioMixer4              part_1;         //xy=1843,476
    AudioEffectFlange        flange1;        //xy=2066,483
    AudioMixer4              leftDelayFB;    //xy=2386.66650390625,591.7777709960938
    AudioMixer4              rightDelayFB;   //xy=2387.77783203125,658.8888549804688
    AudioEffectDelayExternal delayLeft; //xy=2446.222412109375,478.66668701171875
    AudioEffectDelayExternal delayRight;     //xy=2457.77783203125,751.666748046875
    AudioMixer4              rightDelayHeads; //xy=2680.4442749023438,728.2222900390625
    AudioMixer4              leftDelayHeads; //xy=2693.111083984375,456.11114501953125
    AudioMixer4              leftDryWet;     //xy=2927.6668701171875,466.5555725097656
    AudioMixer4              rightDryWet;    //xy=2929.4443359375,739.888916015625
    AudioMixer4              echo_mix; //xy=3136.4443359375,610.3333740234375
    AudioEffectFreeverbStereo freeverbs1;     //xy=3311.3334350585938,611.9999389648438
    AudioMixer4              delay_revl; //xy=3512.888671875,507.77789306640625
    AudioMixer4              delay_revr; //xy=3512.11083984375,766.8888549804688
    AudioOutputI2S           i2s2;           //xy=3701.1110229492188,622.2222290039062
    AudioConnection          patchCord1(lfo1, harm_fm1);
    AudioConnection          patchCord2(lfo1, harm_fm2);
    AudioConnection          patchCord3(lfo1, harm_fm3);
    AudioConnection          patchCord4(lfo1, harm_fm4);
    AudioConnection          patchCord5(lfo1, harm_fm5);
    AudioConnection          patchCord6(lfo1, harm_fm6);
    AudioConnection          patchCord7(dc3, 0, multiply3, 0);
    AudioConnection          patchCord8(dc2, 0, multiply2, 0);
    AudioConnection          patchCord9(dc1, 0, multiply1, 0);
    AudioConnection          patchCord10(harm_fm3, 0, multiply3, 1);
    AudioConnection          patchCord11(dc4, 0, multiply4, 0);
    AudioConnection          patchCord12(dc6, 0, multiply6, 0);
    AudioConnection          patchCord13(harm_fm1, 0, multiply1, 1);
    AudioConnection          patchCord14(dc5, 0, multiply5, 0);
    AudioConnection          patchCord15(harm_fm2, 0, multiply2, 1);
    AudioConnection          patchCord16(harm_fm6, 0, multiply6, 1);
    AudioConnection          patchCord17(harm_fm4, 0, multiply4, 1);
    AudioConnection          patchCord18(harm_fm5, 0, multiply5, 1);
    AudioConnection          patchCord19(dc9, envelope3);
    AudioConnection          patchCord20(dc12, envelope6);
    AudioConnection          patchCord21(dc10, envelope4);
    AudioConnection          patchCord22(multiply4, 0, mixfilter4, 0);
    AudioConnection          patchCord23(multiply4, 0, filter6, 0);
    AudioConnection          patchCord24(dc11, envelope5);
    AudioConnection          patchCord25(dc8, envelope2);
    AudioConnection          patchCord26(multiply3, 0, mixfilter3, 0);
    AudioConnection          patchCord27(multiply3, 0, filter5, 0);
    AudioConnection          patchCord28(multiply5, 0, mixfilter5, 0);
    AudioConnection          patchCord29(multiply5, 0, filter7, 0);
    AudioConnection          patchCord30(dc7, envelope1);
    AudioConnection          patchCord31(multiply2, 0, mixfilter2, 0);
    AudioConnection          patchCord32(multiply2, 0, filter4, 0);
    AudioConnection          patchCord33(multiply1, 0, mixfilter1, 0);
    AudioConnection          patchCord34(multiply1, 0, filter2, 0);
    AudioConnection          patchCord35(multiply6, 0, mixfilter6, 0);
    AudioConnection          patchCord36(multiply6, 0, filter8, 0);
    AudioConnection          patchCord37(lfo2, 0, mixlfo1, 1);
    AudioConnection          patchCord38(lfo2, 0, mixlfo3, 1);
    AudioConnection          patchCord39(lfo2, 0, mixlfo4, 1);
    AudioConnection          patchCord40(lfo2, 0, mixlfo5, 1);
    AudioConnection          patchCord41(lfo2, 0, mixlfo2, 1);
    AudioConnection          patchCord42(lfo2, 0, mixlfo6, 1);
    AudioConnection          patchCord43(envelope6, 0, mixlfo6, 0);
    AudioConnection          patchCord44(envelope5, 0, mixlfo5, 0);
    AudioConnection          patchCord45(envelope3, 0, mixlfo3, 0);
    AudioConnection          patchCord46(envelope1, 0, mixlfo1, 0);
    AudioConnection          patchCord47(envelope4, 0, mixlfo4, 0);
    AudioConnection          patchCord48(envelope2, 0, mixlfo2, 0);
    AudioConnection          patchCord49(mixlfo1, 0, filter2, 1);
    AudioConnection          patchCord50(mixlfo3, 0, filter5, 1);
    AudioConnection          patchCord51(mixlfo4, 0, filter6, 1);
    AudioConnection          patchCord52(mixlfo2, 0, filter4, 1);
    AudioConnection          patchCord53(mixlfo6, 0, filter8, 1);
    AudioConnection          patchCord54(mixlfo5, 0, filter7, 1);
    AudioConnection          patchCord55(filter2, 0, mixfilter1, 1);
    AudioConnection          patchCord56(filter2, 1, mixfilter1, 2);
    AudioConnection          patchCord57(filter2, 2, mixfilter1, 3);
    AudioConnection          patchCord58(filter5, 0, mixfilter3, 1);
    AudioConnection          patchCord59(filter5, 1, mixfilter3, 2);
    AudioConnection          patchCord60(filter5, 2, mixfilter3, 3);
    AudioConnection          patchCord61(filter4, 0, mixfilter2, 1);
    AudioConnection          patchCord62(filter4, 1, mixfilter2, 2);
    AudioConnection          patchCord63(filter4, 2, mixfilter2, 3);
    AudioConnection          patchCord64(filter6, 0, mixfilter4, 1);
    AudioConnection          patchCord65(filter6, 1, mixfilter4, 2);
    AudioConnection          patchCord66(filter6, 2, mixfilter4, 3);
    AudioConnection          patchCord67(filter8, 0, mixfilter6, 1);
    AudioConnection          patchCord68(filter8, 1, mixfilter6, 2);
    AudioConnection          patchCord69(filter8, 2, mixfilter6, 3);
    AudioConnection          patchCord70(filter7, 0, mixfilter5, 1);
    AudioConnection          patchCord71(filter7, 1, mixfilter5, 2);
    AudioConnection          patchCord72(filter7, 2, mixfilter5, 3);
    AudioConnection          patchCord73(mixfilter1, envelope7);
    AudioConnection          patchCord74(mixfilter1, 0, multiply7, 0);
    AudioConnection          patchCord75(mixfilter1, 0, vca1, 2);
    AudioConnection          patchCord76(mixfilter2, 0, multiply8, 0);
    AudioConnection          patchCord77(mixfilter2, envelope8);
    AudioConnection          patchCord78(mixfilter2, 0, vca2, 2);
    AudioConnection          patchCord79(mixfilter3, 0, multiply9, 0);
    AudioConnection          patchCord80(mixfilter3, envelope9);
    AudioConnection          patchCord81(mixfilter3, 0, vca3, 2);
    AudioConnection          patchCord82(lfo3, 0, multiply7, 1);
    AudioConnection          patchCord83(lfo3, 0, multiply8, 1);
    AudioConnection          patchCord84(lfo3, 0, multiply9, 1);
    AudioConnection          patchCord85(lfo3, 0, multiply10, 0);
    AudioConnection          patchCord86(lfo3, 0, multiply11, 0);
    AudioConnection          patchCord87(lfo3, 0, multiply12, 0);
    AudioConnection          patchCord88(mixfilter6, 0, multiply12, 1);
    AudioConnection          patchCord89(mixfilter6, envelope12);
    AudioConnection          patchCord90(mixfilter6, 0, vca6, 2);
    AudioConnection          patchCord91(mixfilter4, envelope10);
    AudioConnection          patchCord92(mixfilter4, 0, multiply10, 1);
    AudioConnection          patchCord93(mixfilter4, 0, vca4, 2);
    AudioConnection          patchCord94(mixfilter5, 0, multiply11, 1);
    AudioConnection          patchCord95(mixfilter5, envelope11);
    AudioConnection          patchCord96(mixfilter5, 0, vca5, 2);
    AudioConnection          patchCord97(envelope12, 0, vca6, 1);
    AudioConnection          patchCord98(multiply12, 0, vca6, 0);
    AudioConnection          patchCord99(envelope11, 0, vca5, 1);
    AudioConnection          patchCord100(multiply11, 0, vca5, 0);
    AudioConnection          patchCord101(multiply8, 0, vca2, 0);
    AudioConnection          patchCord102(multiply9, 0, vca3, 0);
    AudioConnection          patchCord103(multiply7, 0, vca1, 0);
    AudioConnection          patchCord104(multiply10, 0, vca4, 0);
    AudioConnection          patchCord105(envelope10, 0, vca4, 1);
    AudioConnection          patchCord106(envelope7, 0, vca1, 1);
    AudioConnection          patchCord107(envelope8, 0, vca2, 1);
    AudioConnection          patchCord108(envelope9, 0, vca3, 1);
    AudioConnection          patchCord109(vca6, 0, vca5_6, 1);
    AudioConnection          patchCord110(vca5, 0, vca5_6, 0);
    AudioConnection          patchCord111(vca4, 0, vca1_4, 3);
    AudioConnection          patchCord112(vca3, 0, vca1_4, 2);
    AudioConnection          patchCord113(vca1, 0, vca1_4, 0);
    AudioConnection          patchCord114(vca2, 0, vca1_4, 1);
    AudioConnection          patchCord115(vca5_6, 0, part_1, 1);
    AudioConnection          patchCord116(vca1_4, 0, part_1, 0);
    AudioConnection          patchCord117(part_1, flange1);
    AudioConnection          patchCord118(flange1, 0, leftDelayFB, 0);
    AudioConnection          patchCord119(flange1, 0, rightDelayFB, 0);
    AudioConnection          patchCord120(flange1, 0, rightDryWet, 0);
    AudioConnection          patchCord121(flange1, 0, leftDryWet, 0);
    AudioConnection          patchCord122(leftDelayFB, delayLeft);
    AudioConnection          patchCord123(rightDelayFB, delayRight);
    AudioConnection          patchCord124(delayLeft, 0, leftDelayHeads, 0);
    AudioConnection          patchCord125(delayLeft, 1, leftDelayHeads, 1);
    AudioConnection          patchCord126(delayLeft, 2, leftDelayHeads, 2);
    AudioConnection          patchCord127(delayLeft, 3, leftDelayHeads, 3);
    AudioConnection          patchCord128(delayRight, 0, rightDelayHeads, 0);
    AudioConnection          patchCord129(delayRight, 1, rightDelayHeads, 1);
    AudioConnection          patchCord130(delayRight, 2, rightDelayHeads, 2);
    AudioConnection          patchCord131(delayRight, 3, rightDelayHeads, 3);
    AudioConnection          patchCord132(rightDelayHeads, 0, rightDryWet, 1);
    AudioConnection          patchCord133(rightDelayHeads, 0, leftDelayFB, 1);
    AudioConnection          patchCord134(rightDelayHeads, 0, rightDelayFB, 2);
    AudioConnection          patchCord135(leftDelayHeads, 0, rightDelayFB, 1);
    AudioConnection          patchCord136(leftDelayHeads, 0, leftDryWet, 1);
    AudioConnection          patchCord137(leftDelayHeads, 0, leftDelayFB, 2);
    AudioConnection          patchCord138(leftDryWet, 0, echo_mix, 0);
    AudioConnection          patchCord139(leftDryWet, 0, delay_revl, 0);
    AudioConnection          patchCord140(rightDryWet, 0, echo_mix, 1);
    AudioConnection          patchCord141(rightDryWet, 0, delay_revr, 0);
    AudioConnection          patchCord142(echo_mix, freeverbs1);
    AudioConnection          patchCord143(freeverbs1, 0, delay_revl, 1);
    AudioConnection          patchCord144(freeverbs1, 1, delay_revr, 1);
    AudioConnection          patchCord145(delay_revl, 0, i2s2, 0);
    AudioConnection          patchCord146(delay_revr, 0, i2s2, 1);
    AudioControlSGTL5000     codec;          //xy=570,918
    // GUItool: end automatically generated code

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    I'm concerned there many be some unknown bug. Teensy 4.0 is relatively new and while I've done quite a lot of testing with much smaller audio systems, I've not attempted anything this large.

    But this list has at least 2 class names that aren't part of the official audio library. I also see 2 instances of the external delay, which could play havoc with anything else trying to use SPI.

    If you believe this really may be a bug in the audio library or other core library software for Teensy 4.0, I hope you'll put some work into creating a reproducible test case. I'm guessing your code probably responds to buttons or knobs or MIDI messages or other input. That sort of input can be extremely difficult to reproduce the same way. To investigate a possible bug, I really need a test case that just uses delays or things like elapsedMillis to call the many audio library functions in a reproducible way. If I can reproduce a problem, I can usually dig into the code and figure out what's causing it and come up with a fix.

  7. #7
    If you play all 6 voices/notes at once, do you get noises? The order of the audio objects needs to have objects created in order of audio signal flow and this includes objects feeding back to previous objects. I had noises appearing on my T3.6-based synth when playing two or more voices until I got the object creation order correct. Also, the external delay was significantly cpu heavy, which is why I decided not to use it.
    Everything looks fine up to 'leftDelayHeads' and 'rightDelayHeads', which I think should come before 'leftDelayFB' and 'rightDelayFB', which they're feeding back into.

  8. #8
    Sorry for my late reply: When I look at the web design, the head mixer is exactly after the delay and before the FB Mixer.
    And I'm getting noise, the the system seems to be overloaded.
    As Paul mentioned, the design depends on an external MIDI input (which comes from a PC based GUI via an USB-Router - actually a Teensy 3.2 which receives MIDI and sends OSC via Serial Wire to the T40).
    At the Moment which my new design (i.e. a new filter class with Moog Filter), there is no noise.

Posting Permissions

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