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

Status
Not open for further replies.
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.
 
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?
 
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.
 
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?
 
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
 
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.
 
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 :)
 
@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
 
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!!
 
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:
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...

file.png
 
@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 !
 
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!
 
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 ?
 
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.
 
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) ?

Capture d’écran 2018-04-30 à 15.09.12.png
 
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.
 
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 !
 
Status
Not open for further replies.
Back
Top