Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
kassrat
kassrat's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Volume Change Souncipher library?
[0 Replies]
22-Jan-2013 01:44 AM
Forum:
Contributed Library Questions
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
«Prev
Next »
Moderate user : kassrat
Forum