electro-music.org   Dedicated to experimental electro-acoustic
and electronic music
 
 Front Page  |  Radio  |  Forum  |  Media  |  Playlists  |  Wiki
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 

click on image to sign up

 Forum index » DIY Hardware and Software » ChucK programming language
Flute won't be quiet
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [14 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 270

PostPosted: Thu Feb 28, 2008 2:38 pm    Post subject: Flute won't be quiet
Subject description: It plays but then it won't stop
Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail
Kassen
Moderator


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Thu Feb 28, 2008 2:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

Wouldn't .stopBlowing() being a fairly obvious candidate for a solution?

I never understood the relationship between noteOn&noteOff 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
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 270

PostPosted: Thu Feb 28, 2008 3:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Thu Feb 28, 2008 3:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Kassen
Moderator


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Thu Feb 28, 2008 3:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 270

PostPosted: Thu Feb 28, 2008 3:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Thu Feb 28, 2008 3:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Kassen
Moderator


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Thu Feb 28, 2008 3:42 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website
Kassen
Moderator


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Thu Feb 28, 2008 3:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 270

PostPosted: Thu Feb 28, 2008 4:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hehe, Kassen, I'm never sure if I have a bug or not! Here's the source code. I call your attention to the latter part of the interior of all those nested loops at the end of the program, where you'll find the noteOn () and noteOff () method calls. I hope you find something really simple and stupid that I missed, haha! Thanks for your input too kijjaz, there seems to be at least something wrong here.


MAUI_BS_guitar_lab15.ck
 Description:
test code for possible bug **** do not download except for test ****

Download (listen)
 Filename:  MAUI_BS_guitar_lab15.ck
 Filesize:  48.41 KB
 Downloaded:  434 Time(s)

Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 270

PostPosted: Thu Feb 28, 2008 4:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

p.s. Kassen, your hyper-advanced work-around worked! yay! Now I can move on to adding the saxophone!
Back to top
View user's profile Send private message Send e-mail
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Thu Feb 28, 2008 4:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Kassen
Moderator


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Thu Feb 28, 2008 6:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 270

PostPosted: Thu Feb 28, 2008 7:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [14 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Log in
Username:     Password:      Log me on automatically each visit    


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2026 by electro-music.org