Music projects

Dub Siren

Last updated: 2021-12-27

under construction

Software

Audio library first test

waveform1-dac

Here is the sketch:

  /* waveform1_dac */

  #include <Audio.h>
  #include <Wire.h>
  #include <SPI.h>
  #include <SD.h>
  #include <SerialFlash.h>

  // GUItool: begin automatically generated code
  AudioSynthWaveform       waveform1;      //xy=180.3333282470703,423.3333282470703
  AudioOutputAnalog        dac1;           //xy=393.3333282470703,433.3333282470703
  AudioConnection          patchCord1(waveform1, dac1);
  // GUItool: end automatically generated code

  int current_waveform=0;

  void setup() {
    analogWriteResolution(12);
    analogWrite(DAC0,0);
    AudioMemory(10); //// Audio connections require memory to work.
    waveform1.frequency(440);  
    waveform1.amplitude(1.0);
    current_waveform = WAVEFORM_TRIANGLE;
    waveform1.begin(current_waveform);
  }

  void loop() {}

and the output signal:

waveform1-dac

Download