We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › minim volume control problem **help!!**
Page Index Toggle Pages: 1
minim volume control problem **help!!** (Read 1789 times)
minim volume control problem **help!!**
Jul 28th, 2009, 12:17am
 
I'm in emergency, please help me with this.

I'm using just following sample code:

import ddf.minim.*;
import ddf.minim.signals.*;

Minim minim;
AudioOutput out;
//WaveformRenderer waveform;
SawWave saw;

void setup()
{
 size(512, 200);
 minim = new Minim(this);
 out = minim.getLineOut();

 //waveform = new WaveformRenderer();
 // see the example Recordable >> addListener for more about this
 //out.addListener(waveform);

 // see the example AudioOutput >> SawWaveSignal for more about this
 saw = new SawWave(100, 0.2, out.sampleRate());
 // see the example Polyphonic >> addSignal for more about this
 out.addSignal(saw);

 textFont(createFont("Arial", 12));
}

void draw()
{
 background(0);
 // see waveform.pde for more about this
 //waveform.draw();

 if ( out.hasControl(Controller.PAN) )
 {
   text("The current pan value is " + out.getPan() + ".", 5, 15);
 }
 else
 {
   text("The output doesn't have a pan control.", 5, 15);
 }

 if ( out.hasControl(Controller.VOLUME) )
 {
   text("The current volume value is " + out.getVolume() + ".", 5, 30);
 }
 else
 {
   text("The output doesn't have a volume control.", 5, 30);
 }

 if ( out.hasControl(Controller.BALANCE) )
 {
   text("The current balance value is " + out.getBalance() + ".", 5, 45);
 }
 else
 {
   text("The output doesn't have a balance control.", 5, 45);
 }

 if ( out.hasControl(Controller.GAIN) )
 {
   text("The current gain value is " + out.getGain() + ".", 5, 60);
 }
 else
 {
   text("The output doesn't have a gain control.", 5, 60);
 }
}

void keyReleased()
{
 if ( key == 'v' ) out.shiftVolume(0, 1, 2000);
 if ( key == 'g' ) out.shiftGain(-40, 0, 2000);
 if ( key == 'b' ) out.shiftBalance(-1, 1, 2000);
 if ( key == 'p' ) out.shiftPan(1, -1, 2000);
}

void stop()
{
 // always close Minim audio classes when you are finished with them
 out.close();
 minim.stop();

 super.stop();
}





and the result on the screen is:

The current pan value is 0.0.
The output doesn't have a volume control.
The current balance value is 0.0.
The current gain value is 0.0.


It says this program doesn't have a volume control.
and I have the same problems on other computers.

I just need to get a volume control, but I just cannot find the way to do it.

How can I get a volume control?!!!!!!!

PLEASE HELP ME!!!!!PLEASE!!!!!!!! Im about to cry




Re: minim volume control problem **help!!**
Reply #1 - Oct 4th, 2009, 1:39pm
 
Not all JMVs will provide a Volume control. From the printout there, I see that there is a Gain control and this will work basically the same as Volume. Lower gain means quieter sound. The only different between the two is units. Gain is expressed in dB (decibels) and Volume is expressed in I'm not sure what, but it will typically be a 0 -> 1 range, whereas Gain will run from like -60dB -> +5 dB.

Google it if you're not familiar with decibels.
Page Index Toggle Pages: 1