Wiki

Reso-nance numérique | Arts et cultures libres

Outils du site


Panneau latéral

projets:light-synth:accueil

Ceci est une ancienne révision du document !


Table des matières

light-synth

  • Porteur du projet : fenshu resonance
  • Date : 09/07/2017/ - …
  • Licence : CC-by-sa-3.0
  • Description : synthé qui marche avec la lumiere
  • Fichiers sources : mettre un lien …
  • Lien : mettre un lien

Note d'intention

Synthé qui marche avec la lumiere : Plusieurs pistes sont possible, notamment en changeant les frequences des pwm avec library tone…

light-synth

Codes

Voici quelques codes pas mal… Certains utilisent les libraries Tone et Mozzi pour transformer l'arduino en petit synthé !

On capte le son emis en lumiere par des leds, via un panneau solaire. Ca donne ceci :

Le troisieme synth de la video est l'exemple de la librarie mozzi : Sensor/lighttemperature…

Boite a rythme a led

On fait clignoter 3 led a la noire, croche triolet, et on controle le temp avec un potentiometre et une photoresistance…

Le code

Synth fm avec 5 potentiomètres

On controle un synthe fm avec 5 potards, le son passe par la led en pin 9…

Le code

Code pour communiquer avec PureData COMPORT (2 led branché en 9 et 10):

On controle ainsi deux pins avec tone depuis Pure Data…

Patch PureData : voir fichier 4 dans la page ressource http://reso-nance.org/wiki/logiciels/serial/accueil?s[]=puredata&s[]=serial

Le code

Code sympa fluctuant Mozzi

2 pot volume et pitch

Le code

Theremin fluctuant Mozzi

2 pot (selecteur si pot ou ldr pour controler le pitch, pitch ) un ldr (pitch)….

++++ Le code |

/*  
*/
 
#include <MozziGuts.h>
#include <Oscil.h> // oscillator template
#include <tables/sin2048_int8.h> // sine table for oscillator
#include <RollingAverage.h>
#include <ControlDelay.h>
 
#define INPUT_PIN 0 // analog control input
#define INPUT_PINA 2 // analog control input
#define MIX_PIN 3 // analog control input
 
unsigned int echo_cells_1 = 32;
unsigned int echo_cells_2 = 60;
unsigned int echo_cells_3 = 127;
    int bumpy_input = 12;
 
#define CONTROL_RATE 64
ControlDelay <128, int> kDelay; // 2seconds
 
// oscils to compare bumpy to averaged control input
Oscil <SIN2048_NUM_CELLS, AUDIO_RATE> aSin0(SIN2048_DATA);
Oscil <SIN2048_NUM_CELLS, AUDIO_RATE> aSin1(SIN2048_DATA);
Oscil <SIN2048_NUM_CELLS, AUDIO_RATE> aSin2(SIN2048_DATA);
Oscil <SIN2048_NUM_CELLS, AUDIO_RATE> aSin3(SIN2048_DATA);
 
// use: RollingAverage <number_type, how_many_to_average> myThing
RollingAverage <int, 32> kAverage; // how_many_to_average has to be power of 2
int averaged;
 
void setup(){
  kDelay.set(echo_cells_1);
  startMozzi();
}
 
 
void updateControl(){
  int mix =  mozziAnalogRead(MIX_PIN);
  int pot = mozziAnalogRead(INPUT_PINA) ;
  int ldr = mozziAnalogRead(INPUT_PIN) ;
 
if (mix > 500)
{
  bumpy_input = ldr;
}
else
{
  bumpy_input = pot;
}
 
 
  averaged = kAverage.next(bumpy_input);
  aSin0.setFreq(averaged);
  aSin1.setFreq(kDelay.next(averaged));
  aSin2.setFreq(kDelay.read(echo_cells_2));
  aSin3.setFreq(kDelay.read(echo_cells_3));
}
 
 
int updateAudio(){
  return 3*((int)aSin0.next()+aSin1.next()+(aSin2.next()>>1)
    +(aSin3.next()>>2)) >>3;
}
 
 
void loop(){
  audioHook();
}
 
 
 
===== Matériaux et outils =====
Liste de matériel et outils nécessaires.
 
===== Photos =====
Code pour afficher les images du projet :
<code>{{gallery>?&crop&lightbox}}
/home/resonancg/www/wiki/data/attic/projets/light-synth/accueil.1512072124.txt.gz · Dernière modification: 2017/11/30 21:02 de resonance