Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Dalek Megaphone effect.
- // Add NeoPixel support to match video build when get home
- // Use mic input and headphone amp cap coupled into megaphone
- // microphone node or line out. No difference.
- #include <Audio.h>
- #include <Wire.h>
- #include <SPI.h>
- #include <SD.h>
- #include <SerialFlash.h>
- AudioInputI2S i2s2; //xy=1436,440
- AudioSynthWaveformSine sine1; //xy=1437,515
- AudioAnalyzePeak peak1; //xy=1600.33332824707,363.66666158040357
- AudioEffectMultiply multiply1; //xy=1617,482
- AudioOutputI2S i2s1; //xy=1788,489
- AudioConnection patchCord1(i2s2, 0, multiply1, 0);
- AudioConnection patchCord2(i2s2, 0, peak1, 0);
- AudioConnection patchCord3(sine1, 0, multiply1, 1);
- AudioConnection patchCord4(multiply1, 0, i2s1, 0);
- AudioConnection patchCord5(multiply1, 0, i2s1, 1);
- AudioControlSGTL5000 sgtl5000_1; //xy=1441,637
- // GUItool: end automatically generated code
- float ModulationFreq=30.00;
- float ModulationDepth=0.617;
- char receivedChar;
- void setup() {
- Serial.begin(9600);
- Serial.print("Serial Port Configgled!");
- AudioMemory(8);
- sgtl5000_1.enable();
- sgtl5000_1.volume(.5);
- sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
- sgtl5000_1.micGain(32);
- sine1.frequency(ModulationFreq);
- sine1.amplitude(ModulationDepth);
- // Waveshape doesn't seem to work yet,
- // When it does y'all should use Hans Summer's diode curves and spreadsheets
- // To generate arrays of the proper lenght.
- // Diode clipping effect now is done by overmodulation. Cheap hack but it sounds ok.
- // http://www.hanssummers.com/diodeiv.html
- }
- elapsedMillis msecs;
- void loop() {
- if (msecs > 40) {
- if (peak1.available()) {
- msecs = 0;
- float leftNumber = peak1.read();
- //Multiply this by 255, and pass it to setStripBrightness
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement