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

Thread: My audio.h fork - Tape delay, FM waveform input, granular effect and more

  1. #26
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Today I added another waveform object for the modulation features. I ended up writing things quite differently, but I believe it should have all the features. I also added phase modulation, which has been requested several times.

  2. #27
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Quote Originally Posted by john-mike View Post
    Variable delay now named Tape Delay - Interpolated delay time gives delay effect with a tape like response. Control of this interpolation speed and delay sample rate is now possible.
    Eventually I'd like to have another one that interpolates between samples rather than just time.
    This is the last part I haven't (yet) touched. I don't even know where to find it in the code. It doesn't seem to have dedicated .cpp and .h files and I don't see it inside the normal delay files.

    Can you please point me to where I should look for this Tape Delay code?

  3. #28
    I've just spotted the new audio objects in the audio design tool, am I correct that they are not yet integrated into the teensy code? when I tried to use them the compiler simply didn't recognise the new audio objects.

  4. #29
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,371
    Beta 3 of TD 1.42 was announced: Paul, 03-11-2018 05:04 PM

    Anything since then won't install before Beta 4 releases - so would have to pull from Github?

  5. #30
    Quote Originally Posted by defragster View Post
    Beta 3 of TD 1.42 was announced: Paul, 03-11-2018 05:04 PM

    Anything since then won't install before Beta 4 releases - so would have to pull from Github?
    Fair enough, I'll wait for beta4, might as well wait until paul has it all cleaned up and ready.

    Really looking forward to using the new waveforms with modulation

  6. #31
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Quote Originally Posted by grahamguitarman View Post
    Really looking forward to using the new waveforms with modulation
    You could help yourself to the code now. It's all on github.

    Inside your copy of Arduino, find hardware/teensy/avr/libraries/Audio. Delete everything in that folder, then get the ZIP file from github, extract it and copy all the files into hardware/teensy/avr/libraries/Audio.

    The Arduino IDE will pick up the new code automatically., but not the syntax coloring. Restart Arduino if you care about seeing the new object names in orange.

  7. #32
    cool I'll give that a go, never used github before but can't be that hard i guess lol

  8. #33
    Easy peasy, now to have fun with the new waveforms.
    I'm developing a custom synthesis engine that amongst other things creates harmonics on top of a waveform (not by filtering) then lets you phase modulate the harmonics, so being able to phase modulate the waveforms on top of that could create some really cool spacey sounds :-)

  9. #34
    Junior Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    16
    @john-mike I've been having a play around with the granular effect, great fun and actually really useful to get a better understanding of the AudioLib.

    I've been hoping someone would add some granular type effects so thanks for sharing and thanks to @PaulStoffregen for keeping the AudioLib fresh - just keeps getting better

    cheers, Paul

  10. #35
    Senior Member
    Join Date
    Oct 2016
    Posts
    170
    Quote Originally Posted by PaulStoffregen View Post
    This is the last part I haven't (yet) touched. I don't even know where to find it in the code. It doesn't seem to have dedicated .cpp and .h files and I don't see it inside the normal delay files.

    Can you please point me to where I should look for this Tape Delay code?
    Something new about this?
    It will be great!!

  11. #36
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    As nearly as I can tell, the "tape delay" code doesn't seem to be in this copy that was shared.

  12. #37
    Member
    Join Date
    Mar 2013
    Location
    Austin, TX
    Posts
    89
    Oh sorry I just saw this.
    Effect tape delay has been in in my github
    https://github.com/BleepLabs/Audio/b...tape_delay.cpp

    As I mentioned in the emails you can change the name to whatever you'd like or just add the interpolation feature to the existing delay.

  13. #38
    Member
    Join Date
    Mar 2013
    Location
    Austin, TX
    Posts
    89
    I found an issue with the amplitude feature of AudioSynthWaveformModulated.
    Using a scope hooked up to the DACs you can see the shape and with the audio out you can hear this triangle LFO is not the correct shape.
    All the waveforms seem to work except for WAVEFORM_TRIANGLE and WAVEFORM_TRIANGLE_VARIABLE


    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioSynthWaveformModulated waveformMod1;   //xy=217,453
    AudioMixer4              mixer3;         //xy=429,468
    AudioSynthWaveformModulated waveformMod2;   //xy=593,289
    AudioOutputAnalogStereo  dacs1;          //xy=717,407
    AudioOutputI2S           i2s2;           //xy=815,289
    AudioConnection          patchCord1(waveformMod1, 0, mixer3, 0);
    AudioConnection          patchCord2(mixer3, 0, waveformMod2, 0);
    AudioConnection          patchCord3(mixer3, 0, dacs1, 1);
    AudioConnection          patchCord4(mixer3, 0, dacs1, 0);
    AudioConnection          patchCord5(waveformMod2, 0, i2s2, 0);
    AudioConnection          patchCord6(waveformMod2, 0, i2s2, 1);
    AudioControlSGTL5000     sgtl5000_1;     //xy=587,139
    // GUItool: end automatically generated code
    
    float pot[16] = {0};
    float freq[16] = {};
    
    uint32_t cm, prev[20];
    
    
    void setup() {
    
      AudioNoInterrupts();
      AudioMemory(50);
      sgtl5000_1.enable();
      sgtl5000_1.volume(0.6);
      waveformMod1.begin(1, 1, WAVEFORM_TRIANGLE);
      waveformMod2.begin(1, 220, WAVEFORM_SINE);
      mixer3.gain(0, 1);
      analogReadResolution(12);
      AudioInterrupts();
    }
    
    void loop() {
      cm = millis();
    
      if (cm - prev[1] > 4 ) {
        prev[1] = cm;
        pot[0] = analogRead(A18) / 4095.00;
        pot[1] = (analogRead(A19) / 2048.00) -1.00;
        pot[2] = analogRead(A15) / 400.0 ;
    
        waveformMod1.frequency(pot[2]);
    
        static float offa = .005;
        float at1 = pot[0] - offa;
        if (at1 < 0) {
          at1 = 0;
        }
        
        waveformMod1.offset( pot[1]);
        waveformMod1.amplitude( pot[0]);
      }
    
    
      if (cm - prev[3] > 200) {
        prev[3] = cm;
        Serial.print(AudioProcessorUsageMax());
        Serial.print(" ");
        Serial.println(AudioMemoryUsageMax());
    
        Serial.print( pot[0], 4);
        Serial.print( " ");
        Serial.print( pot[1], 4);
        Serial.print( " ");
        Serial.println( pot[2]);
    
        AudioProcessorUsageMaxReset();
        AudioMemoryUsageMaxReset();
      }
    
    }
    Also it looks like pulseWidth isn't implemented in AudioSynthWaveformModulated so the only way to change the shape is with a DC object
    Last edited by john-mike; 04-15-2018 at 09:47 PM.

  14. #39
    Senior Member
    Join Date
    Oct 2016
    Posts
    170
    Quote Originally Posted by john-mike View Post
    Oh sorry I just saw this.
    Effect tape delay has been in in my github
    https://github.com/BleepLabs/Audio/b...tape_delay.cpp

    As I mentioned in the emails you can change the name to whatever you'd like or just add the interpolation feature to the existing delay.
    it's possibile to add this feature to a delay_ext object?

  15. #40
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Quote Originally Posted by john-mike View Post
    All the waveforms seem to work except for WAVEFORM_TRIANGLE and WAVEFORM_TRIANGLE_VARIABLE
    Just to confirm, I'm running it now and I see the triangle waveform issue. Working on a fix...

    Click image for larger version. 

Name:	file.png 
Views:	42 
Size:	34.1 KB 
ID:	13621

  16. #41
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Fixed the regular triangle waveform. Simple as this fix looks, took quite a while to get to it...

    https://github.com/PaulStoffregen/Au...752da8e6bdf579

    Now working on the variable triangle.

    Click image for larger version. 

Name:	file.png 
Views:	37 
Size:	37.1 KB 
ID:	13628

  17. #42
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    Ok, similar fix for WAVEFORM_TRIANGLE_VARIABLE.

    https://github.com/PaulStoffregen/Au...b9a91c8e3be060

  18. #43
    Member
    Join Date
    Aug 2017
    Location
    Bordeaux, France
    Posts
    51
    @john-mike :

    I just got back to this thread and discovered your reply. Thx a lot ! I've tried and it doesn't seem to work but I just saw that everything has been implemented in the lib. So I can't wait for testing all that new objects. Thank you very much for your work !

  19. #44
    Member
    Join Date
    Mar 2013
    Location
    Austin, TX
    Posts
    89
    Cool so the only big one left is the tape delay.

    One other thing I keep meaning to bring up is the envelope effect. It great you updated it to have a longer lengths but since it's linear it's not very useful musically. Any chance you could add a control to change the curve of it?


    @MadMind Thanks!

  20. #45
    Member
    Join Date
    Aug 2017
    Location
    Bordeaux, France
    Posts
    51
    Hey there,

    All that new objects recently included in the audio lib doesn't work for me as they're not recognised when I compile. Yet, I just installed the last version of teensyduino, the 1.42beta-3. I'm running Arduino 1.8.5 on mac osx Yosemite. I previously tried to install the Bleepslab github repository called audio-master. May be there is some kind of conflict ? Is it running well for you ?

  21. #46
    Member
    Join Date
    Mar 2013
    Location
    Austin, TX
    Posts
    89
    Quote Originally Posted by MadMind View Post
    Hey there,

    All that new objects recently included in the audio lib doesn't work for me as they're not recognised when I compile. Yet, I just installed the last version of teensyduino, the 1.42beta-3.
    I did have problems with 1.42. 1.41 is working fine.

  22. #47
    Member
    Join Date
    Aug 2017
    Location
    Bordeaux, France
    Posts
    51
    Quote Originally Posted by john-mike View Post
    I did have problems with 1.42. 1.41 is working fine.
    I just re-installed the teensy 1.41 with the 1.8.4 version of arduino (as it didn't want to work with the 1.8.5) and I still have the same issue. The IDE does not recognised the new objects in the audio lib. You can see the picture bellow for an example. Anyone has this issue with Mac OSX 10.10.5 (yosemite) ?

    Click image for larger version. 

Name:	Capture d’écran 2018-04-30 à 15.09.12.png 
Views:	43 
Size:	35.5 KB 
ID:	13703

  23. #48
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,929
    So far the new stuff is only on github. I plan to publish 1.42-beta4 this week, which will have all the new features and the excessive debug output of beta3 cleaned up.

    If you want the new code sooner, you need to get the audio lib from github. To install it, control-click Arduino and "show package contents". Then navigate to Contents/Java/hardware/teensy/avr/libraries/Audio. Delete everything in that folder and put a copy from github in there.

  24. #49
    Member
    Join Date
    Aug 2017
    Location
    Bordeaux, France
    Posts
    51
    Quote Originally Posted by PaulStoffregen View Post
    So far the new stuff is only on github. I plan to publish 1.42-beta4 this week, which will have all the new features and the excessive debug output of beta3 cleaned up.

    If you want the new code sooner, you need to get the audio lib from github. To install it, control-click Arduino and "show package contents". Then navigate to Contents/Java/hardware/teensy/avr/libraries/Audio. Delete everything in that folder and put a copy from github in there.
    Ok Paul ! Thanks for the tips ! Can't wait for trying all that new exciting stuff !

  25. #50
    Senior Member
    Join Date
    Oct 2016
    Posts
    170
    News about tape delay for delay_ext object?

Posting Permissions

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