When I click play beat plays every second, I want to use a slider that can increase its speed?

edited April 2017 in Library Questions

This is my code:

public void imgButton1_click1(GImageButton source, GEvent event) { //_CODE_:imgButton1:842456:
//  println("imgButton1 - GImageButton >> GEvent." + event + " @ " + millis());
  if (myplayer.isPlaying()) {
  myplayer.pause();
  }
  else  {
  myplayer.loop();
  }
} //_CODE_:imgButton1:842456:

Here is my slider:

public void slider1_change1(GSlider source, GEvent event) { //_CODE_:slider1:634065:
//  println("slider1 - GSlider >> GEvent." + event + " @ " + millis());
  tempo = slider1.getValueF();
} //_CODE_:slider1:634065:

  slider1 = new GSlider(this, 757, 341, 60, 30, 10.0);
  slider1.setRotation(PI/2, GControlMode.CORNER);
  slider1.setLimits(1.0, 1.0, 0.0);
  slider1.setNumberFormat(G4P.DECIMAL, 2);
  slider1.setLocalColorScheme(GCScheme.PURPLE_SCHEME);
  slider1.setOpaque(false);

I want to know in my main body of code how I can make a function where if I pull the slider up the more it goes up the higher the tempo.

Answers

  • Answer ✓

    Check the tickRate example in Minim. You can access this example in the processing IDE. Assuming you installed the minim library, you go to Files>>examples and then go to Contributed Libraries >> Minim >> Synthesis >> tickrateExample.pde I believe this example controls the rate your sound is being played.

    Kf

Sign In or Register to comment.