1. import controlP5.*;
  2. import beads.*;
  3. ControlP5 cp5;
  4. controlP5.Slider Slider_son;
  5. controlP5.Slider Slider_musique;Gain g;
  6. AudioContext Musique_menu;
  7. Void setup {
  8. cp5 = new ControlP5(this);
  9. Slider_musique = cp5.addSlider("Musique")
  10. .setPosition(300, 236)
  11. .setSize(250, 23)
  12. .setRange(0, 100) // on choisit l'interValle
  13. .setValue(50) // Valeur de démarrage
  14. .setLabel("");
  15. Musique_menu = new AudioContext();
  16. String audioFileName = savePath("") +"data/musique/Musique_Menu.mp3";
  17. SamplePlayer player = new SamplePlayer(Musique_menu, SampleManager.sample(audioFileName));
  18. g = new Gain(Musique_menu, 1, 0.025);
  19. g.addInput(player);
  20. Musique_menu.out.addInput(g);
  21. Musique_menu.setKillOnEnd(); // Unknown function ?
  22. }
  23. void Musique (float v) {
  24. g.setGain(v / 2000);
  25. }
Comments powered by Disqus