[chuck-users] polyphony (what happens after note off)? was: Killing thread from without
Robert Poor
rdpoor at gmail.com
Sat Apr 25 22:38:18 EDT 2009
>> do you get another generator, or is the already sounding generator
>> of the key reset?
The answer is "yes" -- it behaves one of those two ways. :) But it's
a trivial change -- about four lines of code -- to make it behave the
other way. I don't want to presume your proficiency in coding, but I
wrote this as an example for people to look at and adapt as
appropriate. Let me know off-list if you want more help.
- Rob
On 24 Apr 2009, at 00:47, Hans Aberg wrote:
> On 23 Apr 2009, at 18:53, Robert Poor wrote:
>
>> The philosophy is simple: *Every* note-on event spawns a thread.
>> That thread patches in the UGs and plays sound until there's a note-
>> off event, at which it *begins* to shut down the note. Only after
>> the note actually ends does the the thread unpatch the UGs and kill
>> itself.
> ...
>> If you hit C4 twice in a row, it will actually spawn two threads --
>> this is exactly what you want for something with a long decay.
>
> So what happens in your code if the same key is hit again before the
> decay has ended: do you get another generator, or is the already
> sounding generator of the key reset?
>
> Hans
>
>
More information about the chuck-users
mailing list