electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Links  |  Store
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 
 Forum index » DIY Hardware and Software » ChucK programming language
The new shred features
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Inventor



Joined: Oct 13, 2007
Posts: 5699
Location: San Antonio, Tx, USA
Audio files: 245

PostPosted: Fri Jul 18, 2008 3:05 am    Post subject: The new shred features
Subject description: How do they work?
Reply with quote  Mark this post and the followings unread

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


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

PostPosted: Fri Jul 18, 2008 5:20 am    Post subject: Reply with quote  Mark this post and the followings unread

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



Joined: Oct 13, 2007
Posts: 5699
Location: San Antonio, Tx, USA
Audio files: 245

PostPosted: Fri Jul 18, 2008 8:32 am    Post subject: Reply with quote  Mark this post and the followings unread

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



Joined: Oct 13, 2007
Posts: 5699
Location: San Antonio, Tx, USA
Audio files: 245

PostPosted: Wed Jul 23, 2008 8:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

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



Joined: Oct 13, 2007
Posts: 5699
Location: San Antonio, Tx, USA
Audio files: 245

PostPosted: Thu Jul 24, 2008 2:47 am    Post subject: Reply with quote  Mark this post and the followings unread

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
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 [5 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
Niio1

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use