Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
|
projets:fiat_lux:accueil [2018/06/12 13:07] resonance [Code sympa fluctuant Mozzi] |
projets:fiat_lux:accueil [2022/11/17 11:51] (Version actuelle) resonance |
||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Fiat lux ====== | ====== Fiat lux ====== | ||
| - | * Porteur du projet : [[: | + | * Porteur du projet : [[: |
| * Date : 01/09/2017/ - 01/ | * Date : 01/09/2017/ - 01/ | ||
| * Licence : [[http:// | * Licence : [[http:// | ||
| Ligne 10: | Ligne 10: | ||
| ===== Description ===== | ===== Description ===== | ||
| - | Synthé | + | Fiat lux est un triple synthétiseur |
| - | --------- | + | 3 Arduino |
| - | 3 Arduino | + | Celles-ci sont manipulables et orientables, font face à des panneaux solaires |
| + | Ces panneaux solaires ont des sorties jack, permettant | ||
| + | |||
| + | **Cet instruments a été exposé :** | ||
| + | |||
| + | * Mixart Myris Toulouse - Sonoptic 2020 | ||
| + | * Printemps | ||
| + | * CityLab Barcelona - 2017 (beta) | ||
| + | * ... et utilisé dans des concerts de Fenshu | ||
| {{projets: | {{projets: | ||
| Ligne 22: | Ligne 30: | ||
| {{youtube> | {{youtube> | ||
| //Le troisieme synth de la video est l' | //Le troisieme synth de la video est l' | ||
| + | |||
| + | {{youtube> | ||
| Ligne 27: | Ligne 37: | ||
| ===== Circuit basique ===== | ===== Circuit basique ===== | ||
| - | Et réaliser dans les regles | + | Un montage digne des plus grands moments |
| {{ : | {{ : | ||
| Ligne 49: | Ligne 59: | ||
| Output Pin 9 - led ... | Output Pin 9 - led ... | ||
| */ | */ | ||
| + | |||
| #include < | #include < | ||
| #include < | #include < | ||
| Ligne 61: | Ligne 71: | ||
| const int MIN_CARRIER_FREQ = 22; | const int MIN_CARRIER_FREQ = 22; | ||
| const int MAX_CARRIER_FREQ = 440; | const int MAX_CARRIER_FREQ = 440; | ||
| + | |||
| const int MIN = 1; | const int MIN = 1; | ||
| const int MAX = 10; | const int MAX = 10; | ||
| + | |||
| const int MIN_2 = 1; | const int MIN_2 = 1; | ||
| const int MAX_2 = 15; | const int MAX_2 = 15; | ||
| + | |||
| // desired intensity max and min, for AutoMap, note they' | // desired intensity max and min, for AutoMap, note they' | ||
| const int MIN_INTENSITY = 700; | const int MIN_INTENSITY = 700; | ||
| const int MAX_INTENSITY = 10; | const int MAX_INTENSITY = 10; | ||
| + | |||
| // desired mod speed max and min, for AutoMap, note they' | // desired mod speed max and min, for AutoMap, note they' | ||
| const int MIN_MOD_SPEED = 10000; | const int MIN_MOD_SPEED = 10000; | ||
| const int MAX_MOD_SPEED = 1; | const int MAX_MOD_SPEED = 1; | ||
| + | |||
| AutoMap kMapCarrierFreq(0, | AutoMap kMapCarrierFreq(0, | ||
| AutoMap kMapIntensity(0, | AutoMap kMapIntensity(0, | ||
| Ligne 81: | Ligne 91: | ||
| AutoMap mapThis(0, | AutoMap mapThis(0, | ||
| AutoMap mapThisToo(0, | AutoMap mapThisToo(0, | ||
| - | + | ||
| - | const int KNOB_PIN = 0; // set the input for the knob to analog pin 0 | + | const int KNOB_PIN = 0; // Pitch |
| - | const int LDR1_PIN=1; // set the analog input for fm_intensity to pin 1 | + | const int LDR1_PIN=5; // RingMOD |
| - | const int LDR2_PIN=2; // set the analog input for mod rate to pin 2 | + | const int LDR2_PIN=2; // LFO speed |
| - | const int LDR3_PIN=3; | + | const int LDR3_PIN=3; |
| - | const int LDR4_PIN=4; | + | const int LDR4_PIN=4; |
| + | |||
| Oscil< | Oscil< | ||
| Oscil< | Oscil< | ||
| Oscil< | Oscil< | ||
| + | |||
| int mod_ratio = 5; // brightness (harmonics) | int mod_ratio = 5; // brightness (harmonics) | ||
| long fm_intensity; | long fm_intensity; | ||
| + | |||
| // smoothing for intensity to remove clicks on transitions | // smoothing for intensity to remove clicks on transitions | ||
| float smoothness = 0.95f; | float smoothness = 0.95f; | ||
| Smooth < | Smooth < | ||
| - | + | ||
| + | |||
| void setup(){ | void setup(){ | ||
| Serial.begin(115200); | Serial.begin(115200); | ||
| startMozzi(); | startMozzi(); | ||
| } | } | ||
| + | |||
| void updateControl(){ | void updateControl(){ | ||
| - | | + | |
| // freqVal = map(LDR3_PIN, | // freqVal = map(LDR3_PIN, | ||
| int freqVal = mozziAnalogRead(LDR3_PIN); | int freqVal = mozziAnalogRead(LDR3_PIN); | ||
| Ligne 112: | Ligne 122: | ||
| int knob2 = mozziAnalogRead(LDR4_PIN); | int knob2 = mozziAnalogRead(LDR4_PIN); | ||
| int knob2Val = mapThis(knob2); | int knob2Val = mapThis(knob2); | ||
| - | | + | |
| // read the knob | // read the knob | ||
| int knob_value = mozziAnalogRead(KNOB_PIN); | int knob_value = mozziAnalogRead(KNOB_PIN); | ||
| + | |||
| // map the knob to carrier frequency | // map the knob to carrier frequency | ||
| int carrier_freq = kMapCarrierFreq(knob_value); | int carrier_freq = kMapCarrierFreq(knob_value); | ||
| - | | + | |
| //calculate the modulation frequency to stay in ratio | //calculate the modulation frequency to stay in ratio | ||
| int mod_freq = carrier_freq * mod_ratio * FRQ; | int mod_freq = carrier_freq * mod_ratio * FRQ; | ||
| - | | + | |
| // set the FM oscillator frequencies | // set the FM oscillator frequencies | ||
| aCarrier.setFreq(carrier_freq); | aCarrier.setFreq(carrier_freq); | ||
| aModulator.setFreq(mod_freq); | aModulator.setFreq(mod_freq); | ||
| - | | + | |
| // read the light dependent resistor on the width Analog input pin | // read the light dependent resistor on the width Analog input pin | ||
| int LDR1_value= mozziAnalogRead(LDR1_PIN); | int LDR1_value= mozziAnalogRead(LDR1_PIN); | ||
| // print the value to the Serial monitor for debugging | // print the value to the Serial monitor for debugging | ||
| + | |||
| int LDR1_calibrated = kMapIntensity(LDR1_value); | int LDR1_calibrated = kMapIntensity(LDR1_value); | ||
| + | |||
| // calculate the fm_intensity | // calculate the fm_intensity | ||
| fm_intensity = ((long)LDR1_calibrated * knob2Val * (kIntensityMod.next()+128))>> | fm_intensity = ((long)LDR1_calibrated * knob2Val * (kIntensityMod.next()+128))>> | ||
| - | + | ||
| - | + | ||
| // read the light dependent resistor on the speed Analog input pin | // read the light dependent resistor on the speed Analog input pin | ||
| int LDR2_value= mozziAnalogRead(LDR2_PIN); | int LDR2_value= mozziAnalogRead(LDR2_PIN); | ||
| - | + | ||
| - | + | ||
| | | ||
| Serial.print(knob_value); | Serial.print(knob_value); | ||
| Serial.print(" | Serial.print(" | ||
| - | | + | |
| | | ||
| Serial.print(LDR1_value); | Serial.print(LDR1_value); | ||
| Serial.print(" | Serial.print(" | ||
| - | | + | |
| | | ||
| Serial.print(LDR2_value); | Serial.print(LDR2_value); | ||
| Serial.print(" | Serial.print(" | ||
| - | + | ||
| + | |||
| Serial.print(" | Serial.print(" | ||
| Serial.print(freqVal); | Serial.print(freqVal); | ||
| Serial.print(" | Serial.print(" | ||
| + | |||
| Serial.print(" | Serial.print(" | ||
| Serial.print(knob2); | Serial.print(knob2); | ||
| Serial.print(" | Serial.print(" | ||
| - | | + | |
| + | |||
| // use a float here for low frequencies | // use a float here for low frequencies | ||
| float mod_speed = (float)kMapModSpeed(LDR2_value)/ | float mod_speed = (float)kMapModSpeed(LDR2_value)/ | ||
| + | |||
| kIntensityMod.setFreq(mod_speed); | kIntensityMod.setFreq(mod_speed); | ||
| - | | + | |
| Serial.println(); | Serial.println(); | ||
| } | } | ||
| + | |||
| int updateAudio(){ | int updateAudio(){ | ||
| long modulation = aSmoothIntensity.next(fm_intensity) * aModulator.next(); | long modulation = aSmoothIntensity.next(fm_intensity) * aModulator.next(); | ||
| return aCarrier.phMod(modulation); | return aCarrier.phMod(modulation); | ||
| } | } | ||
| + | |||
| void loop(){ | void loop(){ | ||
| audioHook(); | audioHook(); | ||
| Ligne 305: | Ligne 315: | ||
| ++++ Le code | ++++ Le code | ||
| <code c+> | <code c+> | ||
| - | / | ||
| - | */ | ||
| - | |||
| #include < | #include < | ||
| #include < | #include < | ||
| Ligne 314: | Ligne 321: | ||
| #include < | #include < | ||
| - | #define INPUT_PIN 0 // analog control input | + | #define INPUT_PIN 0 // analog control input LDR |
| - | #define INPUT_PINA | + | #define INPUT_PINA |
| - | #define MIX_PIN | + | #define MIX_PIN |
| unsigned int echo_cells_1 = 32; | unsigned int echo_cells_1 = 32; | ||
| Ligne 558: | Ligne 565: | ||
| * feràsouder... | * feràsouder... | ||
| * patience (compter 2 jours sans manger) | * patience (compter 2 jours sans manger) | ||
| + | |||
| + | |||
| ===== Photos ===== | ===== Photos ===== | ||
| + | {{: | ||
| + | |||
| {{gallery>?& | {{gallery>?& | ||
| + | |||
| + | ===== Notice d' | ||
| + | - Brancher les 5 lampions sur les sorties instruments | ||
| + | - Brancher les sortie audio principale (panneau solaire) sur une table de mixage ou enceintes audio | ||
| + | - Brancher l' | ||
| + | - Brancher l' | ||
| + | - Si les lampions s' | ||
| + | |||
| + | |||
| + | Il ya quelques problemes qui sont encore a resoudre : | ||
| + | * Retirer les lampions peut aussi arreter le synthé du milieu... donc eviter de brancher et debrancher celui ci en live... (commencer tout branché) | ||
| + | * Possible faux contact pres des leds par moments... il faut les bouger un peu et ca repart (a moins que la led soit grillée) | ||