| Author |
Message |
Inventor

Joined: Oct 13, 2007 Posts: 5699 Location: San Antonio, Tx, USA
Audio files: 245
|
Posted: Fri Jul 18, 2008 3:05 am Post subject:
The new shred features Subject description: How do they work? |
 |
|
OK, so in the new release we can do this:
| Code: |
spork ~ go() => Shred @ offspring;
|
But there is no mention of ways to use this variable offspring of type Shred, that I can see. How do I stop a sporked shred from running, for example? _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 7682 Location: The Hague, NL
G2 patch files: 3
|
Posted: Fri Jul 18, 2008 5:20 am Post subject:
|
 |
|
like this;
| Code: |
spork ~go() @=> Shred offspring;
<<<offspring.id()>>>;
offspring.exit(); |
I'm not yet sure how the new ones work. _________________ Kassen |
|
|
Back to top
|
|
 |
Inventor

Joined: Oct 13, 2007 Posts: 5699 Location: San Antonio, Tx, USA
Audio files: 245
|
Posted: Fri Jul 18, 2008 8:32 am Post subject:
|
 |
|
OK, yeah, thanks Kas, cause I need that for my Guitar Motion Sensor software. four channels of over a dozen effects each and two shreds per effect multiplies out to equal too many shreds! Gotta code this one efficiently since I don't know whatever junky notebook some musician (or I) will try to use for the effects. _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
Inventor

Joined: Oct 13, 2007 Posts: 5699 Location: San Antonio, Tx, USA
Audio files: 245
|
Posted: Wed Jul 23, 2008 8:26 pm Post subject:
|
 |
|
You know what, that .exit() function isn't working for me. I define my Shred variables like this:
| Code: | Shred potentiometer_adjust[num_stages]; // shred objects for potentiometer adjust function
Shred accelerometer_adjust[num_stages]; // shred objects for accelerometer adjust function
|
and use them like this:
| Code: | if (effect[stage] == 2) {
node[stage] =< reverb_object[stage].input; // unhook downstream
reverb_object[stage].output =<node> wah_object[stage].input; // hook downstream
wah_object[stage].output => node[stage+1]; // hook upstream
potentiometer_adjust[stage].exit (); // remove old shred
accelerometer_adjust[stage].exit (); // remove old shred
// spork new shreds
spork ~ wah_object[stage].potentiometer_adjust () @=> potentiometer_adjust[stage];
spork ~ wah_object[stage].accelerometer_adjust () @=> accelerometer_adjust[stage];
0 => sndbuf[7].pos;
}
if (effect[stage] == 3) {
node[stage] =< wah_object[stage].input; // unhook downstream
wah_object[stage].output =<node> distortion_object[stage].input; // hook downstream
distortion_object[stage].output => node[stage+1]; // hook upstream
potentiometer_adjust[stage].exit (); // remove old shred
accelerometer_adjust[stage].exit (); // remove old shred
// spork new shreds
spork ~ distortion_object[stage].potentiometer_adjust () @=> potentiometer_adjust[stage];
spork ~ distortion_object[stage].accelerometer_adjust () @=> accelerometer_adjust[stage];
0 => sndbuf[8].pos;
}
|
And what I get is more and more shreds, they never exit! What's up with that? _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
Inventor

Joined: Oct 13, 2007 Posts: 5699 Location: San Antonio, Tx, USA
Audio files: 245
|
Posted: Thu Jul 24, 2008 2:47 am Post subject:
|
 |
|
Interestingly, i noticed more about the program that may explain this. The shreds do go away when i move the mouse. These shreds have infinite while loops that are waiting on mouse events. So the shreds are shreduled to exit, but they do not exit until the next mouse movement. I don't think it's a real problem, it's just kind of awkward. Whatever. _________________ "Let's make noise for peace." - Kijjaz |
|
|
Back to top
|
|
 |
|