We are about to switch to a new forum software. Until then we have removed the registration on this forum.
My sliders are as follows:
public void slider1_change1(GSlider source, GEvent event) { //_CODE_:slider1:634065:
// println("slider1 - GSlider >> GEvent." + event + " @ " + millis());
tempo = slider1.getValueF();
} //_CODE_:slider1:634065:
public void slider2_change1(GSlider source, GEvent event) { //_CODE_:slider2:997515:
// println("slider2 - GSlider >> GEvent." + event + " @ " + millis());
gain = slider2.getValueF();
} //_CODE_:slider2:997515:
Here is my button that plays my audio file in repeat:
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:
When I click the play/pause button my audio file plays out loud, but I want it to be silent and when I increase the gain the volume increases, along with this the beat plays every second but I want it to increase speed with the slider, help would be greatly appreciated!
My slider values are:
slider1 = new GSlider(this, 736, 342, 60, 30, 10.0);
slider1.setRotation(PI/2, GControlMode.CORNER);
slider1.setLimits(1.0, 1.0, 0.0);
slider1.setNumberFormat(G4P.DECIMAL, 2);
slider2 = new GSlider(this, 688, 341, 60, 30, 10.0);
slider2.setRotation(PI/2, GControlMode.CORNER);
slider2.setLimits(1.0, 1.0, 0.0);
slider2.setNumberFormat(G4P.DECIMAL, 2);
Answers
Related to the speed, this post provides some insight: https://forum.processing.org/two/discussion/21842/is-it-possible-to-perform-fft-with-fileplayer-object-minim/p1
For volume, you need to work with setGain. I am not sure if there is a mute function in minim. I believe there is mute/unmute in SoundFile library. however I believe minim is your best option. After you figure the volume in minim, then you can create your own mute function when you set the gain to zero.
Before integrating your music component to the GUI, I suggest you explore the examples provided by minim (File>>examples and then Additional Libraries) or explore previous post: https://forum.processing.org/two/search?Search=setgain
Kf
Thank you! I am using minim I will use your advice and try figure this out!