Wiki

Reso-nance numérique | Arts et cultures libres

Outils du site


projets:fiat_lux:accueil

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

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:04]
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 :  [[:user:resonance|resonance]]  Fenshu  avec complicité d'Eric+  * Porteur du projet :  [[:user:resonance|resonance]]  Fenshu et Eric
   * Date : 01/09/2017/ - 01/07/2018/    * Date : 01/09/2017/ - 01/07/2018/ 
   * Licence : [[http://creativecommons.org/licenses/by-sa/3.0/legalcode|CC-by-sa-3.0]]   * Licence : [[http://creativecommons.org/licenses/by-sa/3.0/legalcode|CC-by-sa-3.0]]
Ligne 10: Ligne 10:
  
 ===== Description ===== ===== Description =====
-Synthé fonctionnant avec lumiere et arduino ... +Fiat lux est un triple synthétiseur fonctionnant avec des led et des panneaux solaires
---------- +3 Arduino programmés en synthétiseur (avec la library Mozzi pour certains), envoient du signal audio (électrique) dans des leds. 
-3 Arduino servent de synthétiseur (notamment avec la library mozzi) , au lieu d'envoyer le son dans un ampli ou haut parleur, on envoi le signal dans une led..la lumiere oscilleraet cette lumiere peut etre capté par des panneaux solaires pour la reconvertir en Electricité et donc en son... la position des leds permet de gérer le volume de chaque instrument.+Celles-ci sont manipulables et orientablesfont face à des panneaux solaires qui capte la lumiere. 
 +Ces panneaux solaires ont des sorties jack, permettant de se brancher à un ampli audio. 
 + 
 +**Cet instruments a été exposé :** 
 + 
 +  * Mixart Myris Toulouse - Sonoptic 2020 
 +  * Printemps de Bourges - 2018 
 +  * CityLab Barcelona - 2017 (beta) 
 +  * ... et utilisé dans des concerts de Fenshu
  
 {{projets:fiat_lux:accueil:img_20180609_140822.jpg?1100|Fiat lux}} {{projets:fiat_lux:accueil:img_20180609_140822.jpg?1100|Fiat lux}}
Ligne 22: Ligne 30:
 {{youtube>nbi2d_UTToQ?large}} {{youtube>nbi2d_UTToQ?large}}
 //Le troisieme synth de la video est l'exemple de la librarie mozzi  : Sensor/lighttemperature...// //Le troisieme synth de la video est l'exemple de la librarie mozzi  : Sensor/lighttemperature...//
 +
 +{{youtube>AMaS_aPNssI?large}}
  
  
Ligne 27: Ligne 37:
  
 ===== Circuit basique =====  ===== Circuit basique ===== 
-Et réaliser dans les regles de l'art .... mouais... ... la police enquete..+Un montage digne des plus grands moments de l'électronique française
 {{ :projets:fiat_lux:img_20180609_113815.jpg?nolink |}} {{ :projets:fiat_lux:img_20180609_113815.jpg?nolink |}}
  
Ligne 49: Ligne 59:
 Output Pin 9 - led ... Output Pin 9 - led ...
 */ */
 + 
 #include <MozziGuts.h> #include <MozziGuts.h>
 #include <Oscil.h> // oscillator  #include <Oscil.h> // oscillator 
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're inverted for reverse dynamics // desired intensity max and min, for AutoMap, note they're inverted for reverse dynamics
 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're inverted for reverse dynamics // desired mod speed max and min, for AutoMap, note they're inverted for reverse dynamics
 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,1023,MIN_CARRIER_FREQ,MAX_CARRIER_FREQ); AutoMap kMapCarrierFreq(0,1023,MIN_CARRIER_FREQ,MAX_CARRIER_FREQ);
 AutoMap kMapIntensity(0,1023,MIN_INTENSITY,MAX_INTENSITY); AutoMap kMapIntensity(0,1023,MIN_INTENSITY,MAX_INTENSITY);
Ligne 81: Ligne 91:
 AutoMap mapThis(0,1023,MIN,MAX); AutoMap mapThis(0,1023,MIN,MAX);
 AutoMap mapThisToo(0,1023,MIN_2,MAX_2); AutoMap mapThisToo(0,1023,MIN_2,MAX_2);
- +  
-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; // Harmonic 
-const int LDR4_PIN=4; +const int LDR4_PIN=4; // reso-nance 
 + 
 Oscil<COS2048_NUM_CELLS, AUDIO_RATE> aCarrier(COS2048_DATA); Oscil<COS2048_NUM_CELLS, AUDIO_RATE> aCarrier(COS2048_DATA);
 Oscil<COS2048_NUM_CELLS, AUDIO_RATE> aModulator(COS2048_DATA); Oscil<COS2048_NUM_CELLS, AUDIO_RATE> aModulator(COS2048_DATA);
 Oscil<COS2048_NUM_CELLS, CONTROL_RATE> kIntensityMod(COS2048_DATA); Oscil<COS2048_NUM_CELLS, CONTROL_RATE> kIntensityMod(COS2048_DATA);
 + 
 int mod_ratio = 5; // brightness (harmonics) int mod_ratio = 5; // brightness (harmonics)
 long fm_intensity; // carries control info from updateControl to updateAudio long fm_intensity; // carries control info from updateControl to updateAudio
 + 
 // 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 <long> aSmoothIntensity(smoothness); Smooth <long> aSmoothIntensity(smoothness);
- +  
 + 
 void setup(){ void setup(){
   Serial.begin(115200); // set up the Serial output so we can look at the light level   Serial.begin(115200); // set up the Serial output so we can look at the light level
   startMozzi(); // :))   startMozzi(); // :))
 } }
 + 
 void updateControl(){ void updateControl(){
-  + 
 //  freqVal = map(LDR3_PIN, 0, 1023, 1, 100);  //  freqVal = map(LDR3_PIN, 0, 1023, 1, 100); 
    int freqVal = mozziAnalogRead(LDR3_PIN); // value is 0-1023    int freqVal = mozziAnalogRead(LDR3_PIN); // value is 0-1023
Ligne 112: Ligne 122:
    int knob2 = mozziAnalogRead(LDR4_PIN); // value is 0-1023    int knob2 = mozziAnalogRead(LDR4_PIN); // value is 0-1023
    int knob2Val = mapThis(knob2);    int knob2Val = mapThis(knob2);
-  + 
   // read the knob   // read the knob
   int knob_value = mozziAnalogRead(KNOB_PIN); // value is 0-1023   int knob_value = mozziAnalogRead(KNOB_PIN); // value is 0-1023
 + 
   // 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); // value is 0-1023   int LDR1_value= mozziAnalogRead(LDR1_PIN); // value is 0-1023
   // 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))>>8; // shift back to range after 8 bit multiply   fm_intensity = ((long)LDR1_calibrated * knob2Val * (kIntensityMod.next()+128))>>8; // shift back to range after 8 bit multiply
- +  
-  + 
   // 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); // value is 0-1023   int LDR2_value= mozziAnalogRead(LDR2_PIN); // value is 0-1023
- +  
-  + 
                                      Serial.print("LDR0 = ");                                       Serial.print("LDR0 = "); 
                                       Serial.print(knob_value);                                       Serial.print(knob_value);
                                       Serial.print("\t"); // prints a tab                                       Serial.print("\t"); // prints a tab
-                                      + 
                                          Serial.print("LDR1 = ");                                           Serial.print("LDR1 = "); 
                                       Serial.print(LDR1_value);                                       Serial.print(LDR1_value);
                                       Serial.print("\t"); // prints a tab                                       Serial.print("\t"); // prints a tab
-                                      + 
                                          Serial.print("LDR2 = ");                                           Serial.print("LDR2 = "); 
                                       Serial.print(LDR2_value);                                       Serial.print(LDR2_value);
                                       Serial.print("\t"); // prints a tab                                       Serial.print("\t"); // prints a tab
- +  
 + 
                                       Serial.print("LDR3 = ");                                        Serial.print("LDR3 = "); 
                                       Serial.print(freqVal);                                       Serial.print(freqVal);
                                       Serial.print("\t"); // prints a tab                                       Serial.print("\t"); // prints a tab
 + 
                                       Serial.print("LDR4 = ");                                        Serial.print("LDR4 = "); 
                                       Serial.print(knob2);                                       Serial.print(knob2);
                                       Serial.print("\t"); // prints a tab                                       Serial.print("\t"); // prints a tab
-   +  
 + 
   // use a float here for low frequencies   // use a float here for low frequencies
   float mod_speed = (float)kMapModSpeed(LDR2_value)/1000;   float mod_speed = (float)kMapModSpeed(LDR2_value)/1000;
 + 
   kIntensityMod.setFreq(mod_speed);   kIntensityMod.setFreq(mod_speed);
-  + 
   Serial.println(); // finally, print a carraige return for the next line of debugging info   Serial.println(); // finally, print a carraige return for the next line of debugging info
 } }
 + 
 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 <MozziGuts.h> #include <MozziGuts.h>
 #include <Oscil.h> // oscillator template #include <Oscil.h> // oscillator template
Ligne 314: Ligne 321:
 #include <ControlDelay.h> #include <ControlDelay.h>
  
-#define INPUT_PIN 0 // analog control input +#define INPUT_PIN 0 // analog control input LDR 
-#define INPUT_PINA // analog control input +#define INPUT_PINA // analog control input 
-#define MIX_PIN // analog control input+#define MIX_PIN // analog control input
  
 unsigned int echo_cells_1 = 32; unsigned int echo_cells_1 = 32;
Ligne 444: Ligne 451:
 ++++  ++++ 
  
-==== Code sympa fluctuant Mozzi ==== +==== Relaxation didgeridoo Mozzi ==== 
-pot volume et pitch+Synth ou 3  \\ 
 +Audio pin 9
  
 ++++ Le code    ++++ Le code   
Ligne 498: Ligne 506:
 ++++  ++++ 
  
-==== Code sympa fluctuant Mozzi ==== +==== Multitone Bug ==== 
-pot volume et pitch+synth ou 3 : bug avec 3 tone... 
 +audio out : pin 9
  
 ++++ Le code    ++++ Le code   
 <code c+> <code c+>
-#include <MozziGuts.h> +#define led1 9 
-#include <Oscil.h> // oscillator template +#define led2 5   
-#include <tables/sin2048_int8.h> // sine table for oscillator+#define led3 10  
  
-const char KNOB_PIN = 0; // set the input for the knob to analog pin 0 +void setup() { 
-const char LDR_PIN = 1; // set the input for the LDR to analog pin 1 +  pinMode(led1, OUTPUT);    
- +  pinMode(led2, OUTPUT);   
-// use: Oscil <table_size, update_rate> oscilName (wavetable), look in .h file of table #included above +  pinMode(led3, OUTPUT);  
-Oscil <SIN2048_NUM_CELLS, AUDIO_RATE> aSin(SIN2048_DATA); +
- +
-byte volume; +
- +
-void setup(){ +
-  startMozzi(); // :))+
 } }
  
 +void loop() {
 +int sensorValue = analogRead(A1);
 +sensorValue = map(sensorValue, 0, 1023, 0, 100000);
 + 
 +int sensorValueB = analogRead(A0);
 +sensorValueB = map(sensorValueB, 0, 1023, 0, 10000);
  
-void updateControl(){ +int sensorValueC analogRead(A2); 
-  // read the potentiometer +sensorValueC = map(sensorValueC,010230,random (5) + 100);
-  int knob_value mozziAnalogRead(KNOB_PIN); // value is 0-1023 +
-   +
-  // map it to an 8 bit volume range for efficient calculations in updateAudio +
-  volume = knob_value >> 2;  // 10 bits (0->1023) shifted right by 2 bits to give 8 bits (0->255) +
-   +
-  // read the light dependent resistor +
-  int light_level = mozziAnalogRead(LDR_PIN); // value is 0-1023+
  
-  light_level = map(light_level,0,1023,0,12); +tone(led1,sensorValue,sensorValueC); 
-  light_level = light_level*100 + 200; +delay (sensorValueC); 
- +tone(led1,sensorValueB,sensorValueC); 
-  // set the frequency +delay (sensorValueC); 
-  aSin.setFreqlight_level); +tone(led1,sensorValueC,sensorValueC); 
-   +delay (sensorValueC);
-+
- +
- +
-int updateAudio(){ +
-  // cast char output from aSin.next() to int to make room for multiplication +
-  return ((int)aSin.next() * volume) >> 8// shift back into range after multiplying by 8 bit value +
- +
-+
- +
-void loop(){ +
-  audioHook(); // required here +
-  delay(100);+
 } }
 </code> </code>
Ligne 575: Ligne 565:
   * feràsouder...   * feràsouder...
   * patience (compter 2 jours sans manger)   * patience (compter 2 jours sans manger)
 +
 +
  
 ===== Photos ===== ===== Photos =====
 +{{:projets:fiat_lux:fiatlux.png?1100|}}
 +
  
 {{gallery>?&crop&lightbox}} {{gallery>?&crop&lightbox}}
  
 +
 +===== Notice d'utilisation =====
 +  - 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'alimentation sur la prise micro usb a gauche. (coté FM)
 +  - Brancher l'alimentation usb sur une prise avec un bouton interrupteur
 +  - Si les lampions s'allume tous ou clignote c'est bon, si certains ne s'allume pas.. ou ne sonnent pas ... eteindre et rallumer la prise pour reset.
 +
 +
 +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)
  
  
  
/home/resonancg/www/wiki/data/attic/projets/fiat_lux/accueil.1528801466.txt.gz · Dernière modification: 2018/06/12 13:04 de resonance