Outils pour utilisateurs

Outils du site


wiki:flossmanuals:theremin:accueil

Ceci est une ancienne révision du document !


Theremin

  • Porteur(s) du projet : Flora Vander Poorte (DSAADG2), Damien MUTI (Prof. de Numérique)
  • Date : 03/2021
  • Contexte : Macroprojet
  • Fichiers :
  • Liens :
  • Capteurs : Capteur de distance Ultrasonic Grove

Pour faire un thérémine nous avons besoin de :

  • Carte Arduino Uno
  • Cable de branchement usb
  • Carte Seeduino
  • Capteur Grove Ultrasonic Ranger
  • Fils de connexions

Branchement de la carte :

Nous allons utiliser Arduino et Processing afin de réaliser notre Thérémine.

Pour brancher la carte et commencer le programme, nous allons suivre ce tuto tuto capteur grove.


Faire un Thérémine avec le Leap Motion et Processing

Programme 2021 import processing.sound.*; librairie sound import de.voidplus.leapmotion.*; libraire leap motion LeapMotion leap; Theremin leapTheremin; ArrayList<PVector> points; PVector handPos; objet position main

TriOsc tri;

void setup () {

size(640,800);
leap = new LeapMotion(this);
points = new ArrayList<PVector>();
tri = new TriOsc(this);    
leapTheremin = new Theremin(tri);

}

void draw() {

leapTheremin.renderSound();
for (Hand hand : leap.getHands()) {
    handPos = hand.getPosition(); 
    boolean handIsLeft = hand.isLeft();
    boolean handIsRight = hand.isRight();
    if (handPos.z <= 75) {
     points = new ArrayList<PVector>();
     points.add(new PVector(handPos.x, handPos.y));
     background((handPos.x)/2.5,(width-handPos.x)/3,handPos.y-(height/3.5));
    }
     if (hand.isRight()) {   //position de la main droite
      leapTheremin.setPitch(); // objet change la hauteur 
 }
    if (hand.isLeft()) { // position de la main gauche
      leapTheremin.setVolume(); //objet change le volume 
    }   
 }

}

class Theremin {

float freq; float amp; int sound;

Theremin (TriOsc tri_g) {

setPitch();
sound = 1;
tri = tri_g;

}

void setPitch () {
  for (int i = points.size()-1; i >= 0; i--) {
  PVector p = points.get(i);
  freq = map((height-handPos.y)+10, 0, height, 40, 880); //"antenne verticale", main qui contrôle la hauteur de la note
  // la couleur s'associe avec la hauteur de la note - créer un dégradé 
  }   
}
void setVolume() {
  for (int i = points.size()-1; i >= 0; i--) {
  PVector p = points.get(i);
  amp = map(width-p.x, 0, width, 1, .01); //"antenne boucle", la main qui contrôle le volume
  }
}
void renderSound() {
  tri.freq(freq);
  tri.amp(amp);
  tri.play();
}

}

wiki/flossmanuals/theremin/accueil.1621791604.txt.gz · Dernière modification: 2021/05/23 19:40 de flora