Wiki

Reso-nance numérique | Arts et cultures libres

Outils du site


projets:tourne-data: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:tourne-data:accueil [2020/09/07 13:06]
oyomaker [Matériaux]
projets:tourne-data:accueil [2020/09/07 13:22] (Version actuelle)
oyomaker [Description]
Ligne 44: Ligne 44:
 === todo=== === todo===
 dessiner les 5 modèles/déclinaisons différentes (fonctionnalités, comportements, particularité... dessiner les 5 modèles/déclinaisons différentes (fonctionnalités, comportements, particularité...
-===== Tutoriel ===== +===== DEV =====
-Guide pas à pas pour la réalisation du projet.+
  
 +==== Arduino Mozzi ====
 +++++ Le codebase de test (sinusoide frequence variable (potentiometre)  |  
 +<code c+>
 +/*  Example playing a sinewave at a set frequency,
 +    using Mozzi sonification library.
 +  
 +    Demonstrates the use of Oscil to play a wavetable.
 +  
 +    Circuit: Audio output on digital pin 9 on a Uno or similar, or
 +    DAC/A14 on Teensy 3.0/3.1, or 
 +    check the README or http://sensorium.github.com/Mozzi/
 +  
 +    Mozzi help/discussion/announcements:
 +    https://groups.google.com/forum/#!forum/mozzi-users
 +  
 +    Tim Barrass 2012, CC by-nc-sa.
 +*/
 +
 +//#include <ADC.h>  // Teensy 3.0/3.1 uncomment this line and install http://github.com/pedvide/ADC
 +#include <MozziGuts.h>
 +#include <Smooth.h>
 +#include <Oscil.h> // oscillator template
 +#include <tables/sin2048_int8.h> // sine table for oscillator
 +#include <AutoMap.h> // maps unpredictable inputs to a range
 +
 +// use: Oscil <table_size, update_rate> oscilName (wavetable), look in .h file of table #included above
 +Oscil <SIN2048_NUM_CELLS, AUDIO_RATE> aSin(SIN2048_DATA);
 +
 +// desired carrier frequency max and min, for AutoMap
 +const int MIN_CARRIER_FREQ = 22;
 +const int MAX_CARRIER_FREQ = 440;
 +const int KNOB_PIN = 0; // Pitch
 +
 +// use #define for CONTROL_RATE, not a constant
 +#define CONTROL_RATE 64 // powers of 2 please
 +
 +AutoMap kMapCarrierFreq(0,1023,MIN_CARRIER_FREQ,MAX_CARRIER_FREQ);
 +float smoothness = 0.95f;
 +Smooth <long> aSmoothIntensity(smoothness);
 +
 +void setup(){
 +  startMozzi(CONTROL_RATE); // set a control rate of 64 (powers of 2 please)
 +  Serial.begin(115200); // set up the Serial output so we can look at the light level
 +  aSin.setFreq(440); // set the frequency
 +}
 +
 +
 +void updateControl(){
 +  // put changing controls in here
 +  int freqVal = mozziAnalogRead(KNOB_PIN); // value is 0-1023
 +  //int FRQ = mapThis(freqVal);
 +  aSin.setFreq(freqVal); // set the frequency
 +}
 +
 +
 +int updateAudio(){
 +  return aSin.next(); // return an int signal centred around 0
 +}
 +
 +
 +void loop(){
 +  audioHook(); // required here
 +}
 +
 +
 +
 +</code>
 +++++
 ===== Photos ===== ===== Photos =====
-Code pour afficher les images du projet : +{{gallery>?&crop&lightbox}}
-<code>{{gallery>?&crop&lightbox}}</code>+
  
  
  
/home/resonancg/www/wiki/data/attic/projets/tourne-data/accueil.1599476786.txt.gz · Dernière modification: 2020/09/07 13:06 de oyomaker