| Author |
Message |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 270
|
Posted: Thu Feb 28, 2008 2:38 pm Post subject:
Flute won't be quiet Subject description: It plays but then it won't stop |
 |
|
| I'm having trouble with the Flute. During initialization I use the pressure () and startBlowing () functions, then when I get to the notes I use noteOn () and noteOff (), but it never stops playing the note. I need to get this fixed before I add the saxophone to my code. What am I doing wrong? |
|
|
Back to top
|
|
 |
Kassen
Moderator

Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Thu Feb 28, 2008 2:49 pm Post subject:
|
 |
|
Wouldn't .stopBlowing() being a fairly obvious candidate for a solution?
I never understood the relationship between noteOn¬eOff and those, some of that stuff could really do with some documentation, the source is a bit beyond me, there. It probably extends lots of stuff but I don't feel like untangling it _________________ Kassen |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 270
|
Posted: Thu Feb 28, 2008 3:06 pm Post subject:
|
 |
|
| yes, I have tried stopBlowing in various combinations and it doesn't stop the flute. I have tried removing startBlowing and stopBlowing all together. I have tried different values passed to noteOff (). Not sure what this one is. It does not appear to be very clearly explained. |
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Thu Feb 28, 2008 3:11 pm Post subject:
|
 |
|
I was using .noteOn(velocity) with .noteOff(velocity)
the velocity is the same.
i was using noteOff(0) and it wouldn't go off also. |
|
|
Back to top
|
|
 |
Kassen
Moderator

Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Thu Feb 28, 2008 3:15 pm Post subject:
|
 |
|
Hmmm. could be a bug. A the very least it should be more clear.
Maybe it's one of the STK thingies that uses the Envelope, perhaps it's confused about the edited envelope? _________________ Kassen |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 270
|
Posted: Thu Feb 28, 2008 3:30 pm Post subject:
|
 |
|
| I have eliminated startBlowing () and stopBlowing() and made sure that the interpreter sees only noteOn (0.5) and noteOff (0.5). It never shuts off. I dunno, is it a bug? |
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Thu Feb 28, 2008 3:38 pm Post subject:
|
 |
|
I didn't changed any values of the flute instrument,
only work with .freq ...
.noteOn(velocity) and .noteOff(velocity) play and stop correctly.
is yours still not stopping, Inventor? hmm i'm confused hehe. |
|
|
Back to top
|
|
 |
Kassen
Moderator

Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Thu Feb 28, 2008 3:42 pm Post subject:
|
 |
|
Yeah, I call it a bug,
I'd say add it to the WiKi and in the meantime use this here hyper-advanced work-around ;¬)
| Code: | Flute f => dac;
f.noteOn(1);
second => now;
f.noteOn(0);
second => now;
f.noteOn(1);
second => now;
f.noteOn(0);
second => now;
|
_________________ Kassen |
|
|
Back to top
|
|
 |
Kassen
Moderator

Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Thu Feb 28, 2008 3:44 pm Post subject:
|
 |
|
Hmmmmm, Inventor, are you sure you don't have a bug in your own code? This works just fine for me as well;
| Code: | Flute f => dac;
f.noteOn(1);
second => now;
f.noteOff(.1);
second => now;
f.noteOn(1);
second => now;
f.noteOff(1);
second => now; |
_________________ Kassen |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 270
|
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 270
|
Posted: Thu Feb 28, 2008 4:18 pm Post subject:
|
 |
|
| p.s. Kassen, your hyper-advanced work-around worked! yay! Now I can move on to adding the saxophone! |
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Thu Feb 28, 2008 4:23 pm Post subject:
|
 |
|
oh no.. i was wondering if noteOn and noteOff are working fine..
but playing around with it for a hour produces this: .. -_-"
so i'd like to share just for fun.
| Code: | Flute s1 => PRCRev rev => Dyno limiter => dac;
BlowBotl s2 => rev;
BlowHole s3 => rev;
rev.mix(.02);
limiter.limit();
s1.gain(.3);
s2.gain(.3);
s3.gain(.2);
Std.mtof(72) => s1.freq;
Std.mtof(60) => s2.freq;
Std.mtof(0) => s3.freq;
<<< "jetDelay: ", s1.jetDelay() >>>;
<<< "jetReflection: ", s1.jetReflection() >>>;
<<< "endReflection: ", s1.endReflection() >>>;
<<< "noiseGain: ", s1.noiseGain() >>>;
<<< "vibratoFreq: ", s1.vibratoFreq() >>>;
<<< "vibratoGain: ", s1.vibratoGain() >>>;
<<< "pressure: ", s1.pressure() >>>;
<<< "rate: ", s1.rate() >>>;
300.0 => float BPM; minute / BPM => dur beat;
.05 => s1.noiseGain;
.2 => s3.noteOn;
int i;
while(true)
{
(i % 13) $ float / 13 => s1.endReflection;
(i % 11) $ float / 11 => s1.jetReflection;
(i % 9) $ float / 9 * .001 => s1.rate;
(i % 4) $ float / 4 => s1.pressure;
(i % 7) $ float / 7 => s1.jetDelay;
1 => s1.noteOn;
.4 => s2.noteOn;
(i % 13) $ float / 13 => s3.tonehole;
(i % 11) $ float / 11 => s3.vent;
(i % 9) $ float / 9 => s3.reed;
.3::beat => now;
1 => s1.noteOff;
.4 => s2.noteOff;
.7::beat => now;
i++;
} |
|
|
|
Back to top
|
|
 |
Kassen
Moderator

Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Thu Feb 28, 2008 6:09 pm Post subject:
|
 |
|
This is quite weird. I wonder what the miss-behaving depends on. Could it be that there might be a error in your .state() infrastructure?. _________________ Kassen |
|
|
Back to top
|
|
 |
Inventor
Stream Operator

Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 270
|
Posted: Thu Feb 28, 2008 7:56 pm Post subject:
|
 |
|
| Kassen wrote: | | This is quite weird. I wonder what the miss-behaving depends on. Could it be that there might be a error in your .state() infrastructure?. |
That's definitely possible, though I've been looking over it very carefully. Everything is working fine now with your fix, I just decided to let the notes play on, and then when the instrument is shut off I do a noteOn (0). |
|
|
Back to top
|
|
 |
|