Volume Change Souncipher library?
in
Contributed Library Questions
•
9 months ago
Hello,
for a Project on my university i do have to create a music instrument with the help of arduino and processing.
What i want to do is a Processing sketch, which will get values from the arduino and change them into music.
As a special thing i do want to change the value of the Volume with the help of a distance sensor.
Here is my sketch:
- import arb.soundcipher.*;
- import processing.serial.*;
- SoundCipher[] sc = new SoundCipher[9];
- int portValue = 9;
- int octave = 160;
- Serial port;
- void setup()
- {
- for (int i = 0; i < sc.length; i++)
- {
- sc[i] = new SoundCipher(this);
- }
- println(Serial.list());
- port = new Serial(this, Serial.list()[0], 9600);
- frameRate(20);
- }
- void draw()
- {
- while (port.available() > 0) {
- portValue = int(port.readString().substring(0, 1));
- print(portValue);
- sc[portValue].playNote(octave - (portValue * 7), 100, 2.5);
- }
- }
Now my problem is, that i have no idea how to change the volume, everything else is working without problems.
is there any easier way than working with CONTROL_CHANGE from soundcipher itself, because i do not get how to work with it.
Would be great to get an answere! :)
Thanks
1