mirror of
https://github.com/le-studio-5/MachineInfernale.git
synced 2025-04-03 16:29:38 +02:00
Codes_par_module_modules1&4
This commit is contained in:
parent
a2c7f4ab74
commit
3d00ff2487
35
ArduinoTeensyCodes/ColorPalette/ColorPalette.ino
Normal file
35
ArduinoTeensyCodes/ColorPalette/ColorPalette.ino
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include <FastLED.h>
|
||||
|
||||
#define LED_PIN 0
|
||||
#define NUM_LEDS 1
|
||||
#define BRIGHTNESS 64
|
||||
#define LED_TYPE WS2812
|
||||
#define COLOR_ORDER GRB
|
||||
CRGB leds[NUM_LEDS];
|
||||
|
||||
#define UPDATES_PER_SECOND 100
|
||||
|
||||
CRGBPalette16 currentPalette;
|
||||
TBlendType currentBlending;
|
||||
|
||||
extern CRGBPalette16 myRedWhiteBluePalette;
|
||||
extern const TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM;
|
||||
|
||||
|
||||
void setup() {
|
||||
delay( 3000 ); // power-up safety delay
|
||||
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
|
||||
FastLED.setBrightness( BRIGHTNESS );
|
||||
|
||||
currentPalette = RainbowColors_p;
|
||||
currentBlending = LINEARBLEND;
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
leds[0]= CHSV( random8(), 255, 128);
|
||||
|
||||
FastLED.show();
|
||||
FastLED.delay(500);
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
// Joystick Logitec extreme3Dpro to teensy3.6 avec Mic PDM
|
||||
#include <Audio.h>
|
||||
#include <Wire.h>
|
||||
#include <SPI.h>
|
||||
#include <SD.h>
|
||||
#include <SerialFlash.h>
|
||||
AudioInputPDM pdm1; //xy=218.88888888888889,241.11111111111111
|
||||
AudioEffectGranular granular1; //xy=372.22216796875,159.9999542236328
|
||||
AudioEffectBitcrusher bitcrusher1; //xy=543.3333129882812,161.11109924316406
|
||||
AudioOutputAnalogStereo dacs1; //xy=685.888916015625,246.88890075683594
|
||||
AudioConnection patchCord1(pdm1, granular1);
|
||||
AudioConnection patchCord2(granular1, bitcrusher1);
|
||||
AudioConnection patchCord3(bitcrusher1, 0, dacs1, 0);
|
||||
AudioConnection patchCord4(bitcrusher1, 0, dacs1, 1);
|
||||
// GUItool: end automatically generated code
|
||||
#define GRANULAR_MEMORY_SIZE 12800 // 12800 enough for 290 ms at 44.1 kHz
|
||||
int16_t granularMemory[GRANULAR_MEMORY_SIZE];
|
||||
#include "USBHost_t36.h"
|
||||
USBHost usbHost1;
|
||||
USBHIDParser usbHid1( usbHost1 );
|
||||
JoystickController stick( usbHost1 );
|
||||
bool freeze = 0;
|
||||
bool bouton[13];
|
||||
|
||||
void setup( ) {
|
||||
AudioMemory(30);
|
||||
usbHost1.begin();
|
||||
bitcrusher1.bits(16); /////////////////
|
||||
bitcrusher1.sampleRate(44100);
|
||||
granular1.begin(granularMemory, GRANULAR_MEMORY_SIZE);
|
||||
//granular1.beginPitchShift(25);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
usbHost1.Task();
|
||||
int Xjoy = stick.getAxis( 0 );
|
||||
int Yjoy = stick.getAxis( 1 );
|
||||
int Zjoy = stick.getAxis( 5 );
|
||||
int Cross = stick.getAxis( 9 );
|
||||
uint32_t buttons = stick.getButtons();
|
||||
for (int i = 1; i < 13; i++) { ///////////////////à tester...
|
||||
bouton[i] = (buttons >> (i - 1)) & 1;
|
||||
}
|
||||
if (bouton[2]) bitcrusher1.bits(1);
|
||||
else if (bouton[3]) bitcrusher1.bits(2);
|
||||
else if (bouton[4]) bitcrusher1.bits(3);
|
||||
else if (bouton[5]) bitcrusher1.bits(4);
|
||||
else if (bouton[6]) bitcrusher1.bits(4);
|
||||
else bitcrusher1.bits(16);
|
||||
///////// fin à tester
|
||||
long SR = sq(1023 - Yjoy) / 40;
|
||||
//Serial.print( buttons, BIN);
|
||||
Serial.print( Zjoy);
|
||||
Serial.println();
|
||||
bitcrusher1.sampleRate(SR);
|
||||
if (bouton[1] == 1 && freeze == 0) {
|
||||
freeze = 1;
|
||||
float msec = 10 + (1023 - Xjoy) / 2; //500.0; // + (knobA3 * 190.0);
|
||||
granular1.beginFreeze(msec);
|
||||
}
|
||||
if (bouton[1] == 0 && freeze == 1) {
|
||||
freeze = 0;
|
||||
granular1.stop();
|
||||
}
|
||||
if (bouton[12]==1 ) {
|
||||
|
||||
granular1.beginPitchShift(10);
|
||||
}
|
||||
//
|
||||
if(freeze==1){
|
||||
float ratio;
|
||||
if (Zjoy >= 0 && Zjoy < 32) ratio = 0.25;
|
||||
if (Zjoy >= 32 && Zjoy < 96) ratio = 0.5;
|
||||
if (Zjoy >= 96 && Zjoy < 160) ratio = 1.0;
|
||||
if (Zjoy >= 160 && Zjoy < 224) ratio = 2.0;
|
||||
if (Zjoy >= 224 && Zjoy < 256) ratio = 4.0;
|
||||
//ratio = powf(2.0, (Zjoy)/255.0 * 2.0 - 1.0); // 0.5 to 2.0
|
||||
//ratio = powf(2.0, knobA2 * 6.0 - 3.0); // 0.125 to 8.0 -- uncomment for far too much range!
|
||||
granular1.setSpeed(ratio);
|
||||
}
|
||||
else{
|
||||
float pitch = Xjoy/1024.0;
|
||||
pitch=map(pitch, 0.0, 1.0, 0.75, 1.25);
|
||||
granular1.setSpeed(pitch);
|
||||
}
|
||||
delay(10);
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
#define bounceTime 20
|
||||
#include <Bounce.h>
|
||||
Bounce bouncer0 = Bounce( 0, bounceTime );
|
||||
Bounce bouncer1 = Bounce( 1, bounceTime );
|
||||
Bounce bouncer2 = Bounce( 2, bounceTime );
|
||||
Bounce bouncer3 = Bounce( 3, bounceTime );
|
||||
Bounce bouncer4 = Bounce( 4, bounceTime );
|
||||
Bounce bouncer5 = Bounce( 5, bounceTime );
|
||||
Bounce bouncer6 = Bounce( 6, bounceTime );
|
||||
Bounce bouncer7 = Bounce( 7, bounceTime );
|
||||
Bounce bouncer8 = Bounce( 8, bounceTime );
|
||||
#include <Audio.h>
|
||||
#include <Wire.h>
|
||||
#include <SPI.h>
|
||||
#include <SD.h>
|
||||
#include <SerialFlash.h>
|
||||
#define LED 13
|
||||
// GUItool: begin automatically generated code
|
||||
AudioPlaySdRaw playSdRaw0; //xy=107,22
|
||||
AudioPlaySdRaw playSdRaw1; //xy=144,53
|
||||
AudioPlaySdRaw playSdRaw2; //xy=173,83
|
||||
AudioPlaySdRaw playSdRaw3; //xy=199,114
|
||||
AudioPlaySdRaw playSdRaw4; //xy=224,146
|
||||
AudioPlaySdRaw playSdRaw5; //xy=252,182
|
||||
AudioPlaySdRaw playSdRaw6; //xy=275,215
|
||||
AudioPlaySdRaw playSdRaw7; //xy=300,248
|
||||
AudioPlaySdRaw playSdRaw8; //xy=333,280
|
||||
AudioMixer4 mixer1; //xy=440,67
|
||||
AudioMixer4 mixer2; //xy=488,158
|
||||
AudioMixer4 mixer3; //xy=647,215
|
||||
AudioOutputAnalogStereo dacs; //xy=825,247
|
||||
AudioConnection patchCord1(playSdRaw0, 0, mixer1, 0);
|
||||
AudioConnection patchCord2(playSdRaw1, 0, mixer1, 1);
|
||||
AudioConnection patchCord3(playSdRaw2, 0, mixer1, 2);
|
||||
AudioConnection patchCord4(playSdRaw3, 0, mixer1, 3);
|
||||
AudioConnection patchCord5(playSdRaw4, 0, mixer2, 0);
|
||||
AudioConnection patchCord6(playSdRaw5, 0, mixer2, 1);
|
||||
AudioConnection patchCord7(playSdRaw6, 0, mixer2, 2);
|
||||
AudioConnection patchCord8(playSdRaw7, 0, mixer2, 3);
|
||||
AudioConnection patchCord9(playSdRaw8, 0, mixer3, 2);
|
||||
AudioConnection patchCord10(mixer1, 0, mixer3, 0);
|
||||
AudioConnection patchCord11(mixer2, 0, mixer3, 1);
|
||||
AudioConnection patchCord12(mixer3, 0, dacs, 0);
|
||||
AudioConnection patchCord13(mixer3, 0, dacs, 1);
|
||||
// Use these with the Teensy 3.5 & 3.6 SD card
|
||||
#define SDCARD_CS_PIN BUILTIN_SDCARD
|
||||
#define SDCARD_MOSI_PIN 11 // not actually used
|
||||
#define SDCARD_SCK_PIN 13 // not actually used
|
||||
uint8_t pinBouton[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
|
||||
|
||||
void setup() {
|
||||
AudioMemory(30);
|
||||
pinMode(13, OUTPUT);
|
||||
for (int i = 0; i < 9; i++) {
|
||||
pinMode(pinBouton[i], INPUT_PULLUP);
|
||||
}
|
||||
SPI.setMOSI(SDCARD_MOSI_PIN);
|
||||
SPI.setSCK(SDCARD_SCK_PIN);
|
||||
while (!(SD.begin(SDCARD_CS_PIN))) {
|
||||
digitalWrite(13, LOW);
|
||||
delay (100);
|
||||
digitalWrite(13, HIGH);
|
||||
delay (100);
|
||||
}
|
||||
digitalWrite(13, HIGH);
|
||||
delay(100);
|
||||
mixer3.gain(0, 0.7);
|
||||
mixer3.gain(1, 0.7);
|
||||
mixer3.gain(2, 0.7);
|
||||
mixer3.gain(3, 0.7);
|
||||
}
|
||||
void loop() {
|
||||
// ++ deux potentiomètres => bitcrusher / stutter /
|
||||
bouncer0.update ( );
|
||||
bouncer1.update ( );
|
||||
bouncer2.update ( );
|
||||
bouncer3.update ( );
|
||||
bouncer4.update ( );
|
||||
bouncer5.update ( );
|
||||
bouncer6.update ( );
|
||||
bouncer7.update ( );
|
||||
bouncer8.update ( );
|
||||
if ( bouncer0.fallingEdge()) {
|
||||
playSdRaw0.play("s0.raw");
|
||||
}
|
||||
if ( bouncer1.fallingEdge()) {
|
||||
playSdRaw1.play("s1.raw");
|
||||
}
|
||||
if ( bouncer2.fallingEdge()) {
|
||||
playSdRaw2.play("s2.raw");
|
||||
}
|
||||
if ( bouncer3.fallingEdge()) {
|
||||
playSdRaw3.play("s3.raw");
|
||||
}
|
||||
if ( bouncer4.fallingEdge()) {
|
||||
playSdRaw4.play("s4.raw");
|
||||
}
|
||||
if ( bouncer5.fallingEdge()) {
|
||||
playSdRaw5.play("s5.raw");
|
||||
}
|
||||
if ( bouncer6.fallingEdge()) {
|
||||
playSdRaw6.play("s6.raw");
|
||||
}
|
||||
if ( bouncer7.fallingEdge()) {
|
||||
playSdRaw7.play("s7.raw");
|
||||
}
|
||||
if ( bouncer8.fallingEdge()) {
|
||||
playSdRaw8.play("s8.raw");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
#define bounceTime 10
|
||||
#include <Bounce.h>
|
||||
Bounce bouncer0 = Bounce( 0, bounceTime );
|
||||
Bounce bouncer1 = Bounce( 1, bounceTime );
|
||||
Bounce bouncer2 = Bounce( 2, bounceTime );
|
||||
Bounce bouncer3 = Bounce( 3, bounceTime );
|
||||
Bounce bouncer4 = Bounce( 4, bounceTime );
|
||||
Bounce bouncer5 = Bounce( 5, bounceTime );
|
||||
Bounce bouncer6 = Bounce( 6, bounceTime );
|
||||
Bounce bouncer7 = Bounce( 7, bounceTime );
|
||||
Bounce bouncer8 = Bounce( 8, bounceTime );
|
||||
#include <Audio.h>
|
||||
#include <Wire.h>
|
||||
#include <SPI.h>
|
||||
#include <SD.h>
|
||||
#include <SerialFlash.h>
|
||||
#define LED 13
|
||||
// GUItool: begin automatically generated code
|
||||
AudioPlaySdRaw playSdRaw0; //xy=132,76
|
||||
AudioPlaySdRaw playSdRaw1; //xy=169,107
|
||||
AudioPlaySdRaw playSdRaw2; //xy=198,137
|
||||
AudioPlaySdRaw playSdRaw3; //xy=224,168
|
||||
AudioPlaySdRaw playSdRaw4; //xy=249,200
|
||||
AudioPlaySdRaw playSdRaw5; //xy=277,236
|
||||
AudioPlaySdRaw playSdRaw6; //xy=300,269
|
||||
AudioPlaySdRaw playSdRaw7; //xy=325,302
|
||||
AudioPlaySdRaw playSdRaw8; //xy=358,334
|
||||
AudioMixer4 mixer1; //xy=465,121
|
||||
AudioMixer4 mixer2; //xy=513,212
|
||||
AudioMixer4 mixer3; //xy=672,269
|
||||
AudioEffectGranular granular; //xy=835,240
|
||||
AudioEffectBitcrusher bitcrusher; //xy=849,331
|
||||
AudioOutputAnalogStereo dacs; //xy=1040,259
|
||||
AudioConnection patchCord1(playSdRaw0, 0, mixer1, 0);
|
||||
AudioConnection patchCord2(playSdRaw1, 0, mixer1, 1);
|
||||
AudioConnection patchCord3(playSdRaw2, 0, mixer1, 2);
|
||||
AudioConnection patchCord4(playSdRaw3, 0, mixer1, 3);
|
||||
AudioConnection patchCord5(playSdRaw4, 0, mixer2, 0);
|
||||
AudioConnection patchCord6(playSdRaw5, 0, mixer2, 1);
|
||||
AudioConnection patchCord7(playSdRaw6, 0, mixer2, 2);
|
||||
AudioConnection patchCord8(playSdRaw7, 0, mixer2, 3);
|
||||
AudioConnection patchCord9(playSdRaw8, 0, mixer3, 2);
|
||||
AudioConnection patchCord10(mixer1, 0, mixer3, 0);
|
||||
AudioConnection patchCord11(mixer2, 0, mixer3, 1);
|
||||
AudioConnection patchCord12(mixer3, granular);
|
||||
AudioConnection patchCord13(granular, bitcrusher);
|
||||
AudioConnection patchCord14(bitcrusher, 0, dacs, 0);
|
||||
AudioConnection patchCord15(bitcrusher, 0, dacs, 1);
|
||||
// GUItool: end automatically generated code
|
||||
|
||||
// Use these with the Teensy 3.5 & 3.6 SD card
|
||||
#define SDCARD_CS_PIN BUILTIN_SDCARD
|
||||
#define SDCARD_MOSI_PIN 11 // not actually used
|
||||
#define SDCARD_SCK_PIN 13 // not actually used
|
||||
uint8_t pinBouton[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
|
||||
#define GRANULAR_MEMORY_SIZE 12800 // enough for 290 ms at 44.1 kHz
|
||||
float ratio;
|
||||
int knobA9;
|
||||
int16_t granularMemory[GRANULAR_MEMORY_SIZE];
|
||||
//#define DEBUG 1
|
||||
|
||||
void setup() {
|
||||
#ifdef DEBUG
|
||||
delay(500);
|
||||
Serial.begin(9600);
|
||||
while (!Serial) {
|
||||
;
|
||||
}
|
||||
#endif
|
||||
AudioMemory(30);
|
||||
pinMode(13, OUTPUT);
|
||||
for (int i = 0; i < 9; i++) {
|
||||
pinMode(pinBouton[i], INPUT_PULLUP);
|
||||
}
|
||||
SPI.setMOSI(SDCARD_MOSI_PIN);
|
||||
SPI.setSCK(SDCARD_SCK_PIN);
|
||||
while (!(SD.begin(SDCARD_CS_PIN))) {
|
||||
digitalWrite(13, LOW);
|
||||
delay (100);
|
||||
digitalWrite(13, HIGH);
|
||||
delay (100);
|
||||
}
|
||||
digitalWrite(13, HIGH);
|
||||
delay(100);
|
||||
mixer3.gain(0, 0.7);
|
||||
mixer3.gain(1, 0.7);
|
||||
mixer3.gain(2, 0.7);
|
||||
mixer3.gain(3, 0.7);
|
||||
granular.begin(granularMemory, GRANULAR_MEMORY_SIZE);
|
||||
bitcrusher.bits(16);
|
||||
bitcrusher.sampleRate(8888);
|
||||
granular.beginPitchShift(20);
|
||||
}
|
||||
void loop() {
|
||||
|
||||
// ++ deux potentiomètres => bitcrusher / stutter /
|
||||
// float knobA8 = (float)analogRead(A8) / 1023.0;
|
||||
// float knobA9 = (float)analogRead(A9) / 1023.0;
|
||||
//bitcrusher.bits(12);
|
||||
int bitres = 2 + sq((float)analogRead(A8)) / 100000.0;
|
||||
bitcrusher.bits(bitres);
|
||||
bitcrusher.sampleRate(50+sq((float)analogRead(A8))/ 24.0);
|
||||
int knobA9 = analogRead(A9);
|
||||
if (knobA9 <= 512) {
|
||||
ratio = map((float)knobA9, 0,512,0.25,1.0);
|
||||
}
|
||||
if (knobA9 > 512) {
|
||||
ratio = map((float)knobA9, 512,1023,1.0,4.0);
|
||||
}
|
||||
if (ratio < 1.05 && ratio > 0.95) granular.stop();
|
||||
else {
|
||||
granular.beginPitchShift(20); granular.setSpeed(ratio);
|
||||
}
|
||||
|
||||
bouncer0.update ( );
|
||||
bouncer1.update ( );
|
||||
bouncer2.update ( );
|
||||
bouncer3.update ( );
|
||||
bouncer4.update ( );
|
||||
bouncer5.update ( );
|
||||
bouncer6.update ( );
|
||||
bouncer7.update ( );
|
||||
bouncer8.update ( );
|
||||
if ( bouncer0.fallingEdge()) {
|
||||
playSdRaw0.play("s0.raw");
|
||||
}
|
||||
if ( bouncer1.fallingEdge()) {
|
||||
playSdRaw1.play("s1.raw");
|
||||
}
|
||||
if ( bouncer2.fallingEdge()) {
|
||||
playSdRaw2.play("s2.raw");
|
||||
}
|
||||
if ( bouncer3.fallingEdge()) {
|
||||
playSdRaw3.play("s3.raw");
|
||||
}
|
||||
if ( bouncer4.fallingEdge()) {
|
||||
playSdRaw4.play("s4.raw");
|
||||
}
|
||||
if ( bouncer5.fallingEdge()) {
|
||||
playSdRaw5.play("s5.raw");
|
||||
}
|
||||
if ( bouncer6.fallingEdge()) {
|
||||
playSdRaw6.play("s6.raw");
|
||||
}
|
||||
if ( bouncer7.fallingEdge()) {
|
||||
playSdRaw7.play("s7.raw");
|
||||
}
|
||||
if ( bouncer8.fallingEdge()) {
|
||||
playSdRaw8.play("s8.raw");
|
||||
}
|
||||
#ifdef DEBUG
|
||||
Serial.println(bitres);
|
||||
//Serial.print( buttons, BIN);
|
||||
//Serial.println(analogRead(A8));
|
||||
// Serial.println(cutoff);
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
#include <Audio.h>
|
||||
|
||||
AudioSynthWaveform lfo; //xy=241,194
|
||||
AudioSynthNoiseWhite noise; //xy=243,111
|
||||
AudioSynthWaveformDc shapeosc; //xy=392,260
|
||||
AudioMixer4 mixerfm; //xy=471,89
|
||||
AudioSynthWaveformModulated trisaw; //xy=626,144
|
||||
AudioMixer4 mixerfilter; //xy=630,210
|
||||
AudioFilterStateVariable filter; //xy=809,157
|
||||
AudioEffectFreeverb freeverb; //xy=908,240
|
||||
AudioMixer4 mixer; //xy=1018,163
|
||||
AudioOutputAnalogStereo dacs; //xy=1197,163
|
||||
AudioConnection patchCord1(lfo, 0, mixerfm, 1);
|
||||
AudioConnection patchCord2(lfo, 0, mixerfilter, 1);
|
||||
AudioConnection patchCord3(noise, 0, mixerfm, 0);
|
||||
AudioConnection patchCord4(noise, 0, mixerfilter, 0);
|
||||
AudioConnection patchCord5(shapeosc, 0, trisaw, 1);
|
||||
AudioConnection patchCord6(mixerfm, 0, trisaw, 0);
|
||||
AudioConnection patchCord7(trisaw, 0, filter, 0);
|
||||
AudioConnection patchCord8(mixerfilter, 0, filter, 1);
|
||||
AudioConnection patchCord9(filter, 0, freeverb, 0);
|
||||
AudioConnection patchCord10(filter, 0, mixer, 0);
|
||||
AudioConnection patchCord11(freeverb, 0, mixer, 1);
|
||||
AudioConnection patchCord12(mixer, 0, dacs, 0);
|
||||
AudioConnection patchCord13(mixer, 0, dacs, 1);
|
||||
|
||||
#include "USBHost_t36.h"
|
||||
USBHost usbHost1;
|
||||
USBHIDParser usbHid1( usbHost1 );
|
||||
JoystickController stick( usbHost1 );
|
||||
bool bouton[13];
|
||||
float touch;
|
||||
float smooTouch = 0.90;
|
||||
float Xjoy, Yjoy, Zjoy;
|
||||
float smooJoy = 0.20;
|
||||
bool gamme = 1;
|
||||
float penta[11] = {98.0, 110.0, 130.81, 146.83, 164.81, 196.0, 220.0, 261.63, 293.66, 329.63, 392.0};
|
||||
byte mode = 7;
|
||||
|
||||
//#define DEBUG 1
|
||||
|
||||
void setup( ) {
|
||||
#ifdef DEBUG
|
||||
delay(500);
|
||||
Serial.begin(9600);
|
||||
while (!Serial) {
|
||||
;
|
||||
}
|
||||
#endif
|
||||
AudioMemory(30);
|
||||
usbHost1.begin();
|
||||
|
||||
noise.amplitude(1.0);
|
||||
shapeosc.amplitude(1);//(Zjoy / 255.0);
|
||||
lfo.begin(1.0, 4, WAVEFORM_SINE);
|
||||
// lfo.frequency(20.0);
|
||||
// lfo.amplitude(0.1);
|
||||
mixerfm.gain(0 , 0.0);
|
||||
mixerfm.gain(1 , 0.0);
|
||||
trisaw.begin(WAVEFORM_SAWTOOTH); /// type d'oscillateur
|
||||
trisaw.amplitude(0.5);
|
||||
trisaw.frequency(220.0);
|
||||
trisaw.frequencyModulation(2); //1 -12 octaves
|
||||
//trisaw.phaseModulation(180.0); // full phase modulation
|
||||
mixerfilter.gain(0 , 0.0);
|
||||
mixerfilter.gain(1 , 0.0);
|
||||
filter.frequency(4444);
|
||||
filter.resonance(2.7); //0.7 à 5.0 résonnance
|
||||
filter.octaveControl(2.0);
|
||||
freeverb.roomsize(0.5); // 0.0 à 1.0
|
||||
freeverb.damping(0.1); // 0.0 à 1.0
|
||||
mixer.gain(0 , 0.5);
|
||||
mixer.gain(1 , 0.2);
|
||||
|
||||
delay(400);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
|
||||
touch = (1.0 - smooTouch) * touch + smooTouch * touchRead(30);
|
||||
usbHost1.Task();
|
||||
Xjoy = (1.0 - smooJoy) * Xjoy + smooJoy * stick.getAxis( 0 );
|
||||
Yjoy = (1.0 - smooJoy) * Yjoy + smooJoy * stick.getAxis( 1 );
|
||||
Zjoy = (1.0 - smooJoy) * Zjoy + smooJoy * stick.getAxis( 5 );
|
||||
//int Cross = stick.getAxis( 9 );
|
||||
uint32_t buttons = stick.getButtons();
|
||||
for (int i = 1; i < 13; i++) {
|
||||
bouton[i] = (buttons >> (i - 1)) & 1;
|
||||
}
|
||||
/////////////////////////////////////////////FIN aquisition
|
||||
if (!gamme)trisaw.frequency((1023 - Xjoy) / 4.0 + 60.0);
|
||||
else {
|
||||
trisaw.frequency(penta[(int) (1023 - Xjoy) / 94]);
|
||||
}
|
||||
float cutoff = constrain(touch - 1800.0, 0, 5555.0);
|
||||
cutoff = sq(cutoff) / 300;
|
||||
|
||||
filter.frequency(cutoff);
|
||||
//shapeosc.amplitude(1.0); //(Zjoy / 255.0);
|
||||
if (mode == 7) {
|
||||
if (Yjoy >= 511) mixerfilter.gain(1, (Yjoy - 511.0) / 512.0);
|
||||
else {
|
||||
mixerfm.gain(1, (511.0 - Yjoy) / 2000.0);
|
||||
}
|
||||
}
|
||||
if (mode == 8) {
|
||||
if (Yjoy >= 511) mixerfilter.gain(0, (Yjoy - 511.0) / 512.0);
|
||||
else {
|
||||
mixerfm.gain(0, (511.0 - Yjoy) / 512.0);
|
||||
}
|
||||
}
|
||||
|
||||
lfo.frequency(((1024 - Xjoy) / 4.0 + 60.0) / 4);
|
||||
//shapeosc.amplitude((Zjoy) / 1024.0); //(Zjoy / 255.0);
|
||||
if (bouton[12]) gamme = 0;
|
||||
if (bouton[11]) gamme = 1;
|
||||
if (bouton[7]) mode = 7 ;
|
||||
if (bouton[8]) mode = 8;
|
||||
if (bouton[9]) mode = 9 ;
|
||||
if (bouton[10]) mode = 10 ;
|
||||
|
||||
if (bouton[2]) ;
|
||||
///////// fin à tester
|
||||
delay(5);
|
||||
#ifdef DEBUG
|
||||
Serial.println(touch);
|
||||
//Serial.print( buttons, BIN);
|
||||
Serial.println( Xjoy);
|
||||
Serial.println(cutoff);
|
||||
#endif
|
||||
}
|
Loading…
Reference in New Issue
Block a user