Author |
Message |
sir honey
Joined: Aug 04, 2006 Posts: 36 Location: NY
|
Posted: Sat Feb 24, 2007 2:29 pm Post subject:
MIDI control of sample parameters question. |
|
|
hey again,
I'm trying to do some basic MIDI implementation, and having a bit of a time doing it. here's my code.
Code: |
// here we go MIDI implementation
//jack ryon 2007
SndBuf samp1 => Echo echo1 => dac;
"/andyloops/dnb/DNO78B~1.WAV" => samp1.read;
10::second => echo1.max;
MidiIn min;
MidiMsg msg;
min.open(2) => int minopen;
if(!minopen) me.exit();
while(true)
{
min => now;
while(min.recv(msg))
{
//<<<msg.data1,msg.data2,msg.data3,"here's MIDI!">>>;
if(msg.data2() == 74)
{
((msg.data3())/127) * samp1.samples() => samp1.pos;
}
}
}
|
what I'm trying to do is use controller 74 to change location of start point in my sample and effectively, "scrub," through the file.
I can't compile this code, and receive a "function call using non-function variable" message in command line. What does this mean, and what can I do to get rid of it? Thanks for the help, guys.
jack |
|
Back to top
|
|
|
moudi
Joined: Oct 07, 2006 Posts: 63 Location: Bern Switzerland
|
Posted: Sat Feb 24, 2007 2:57 pm Post subject:
|
|
|
hi sir honey
i think your problem is this part:
msg.data2 is not a function, so you don't need the brackets for reading the value.
(as you did it a line above).
jassas
/moudi |
|
Back to top
|
|
|
sir honey
Joined: Aug 04, 2006 Posts: 36 Location: NY
|
Posted: Sat Feb 24, 2007 3:18 pm Post subject:
|
|
|
hi moudi,
thanks, that does help me get going in the right direction.
I'm working on your comp/limiter question, but haven't got my code running properly yet. I'll let you know...
jack |
|
Back to top
|
|
|
|