electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  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
Array of different oscillators?
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Khepri



Joined: Jul 20, 2009
Posts: 21
Location: Canada

PostPosted: Tue Sep 23, 2014 12:11 pm    Post subject: Array of different oscillators? Reply with quote  Mark this post and the followings unread

I know it's possible to create an array of UGens of the same type. How about an array of different types?

SinOsc Sin1;
SawOsc Saw1;
TriOsc Tri1;

[Sin1, Saw1, Tri1] @=> ???[];

_________________
Don't fear mistakes. There are none.
- Miles Davis
Back to top
View user's profile Send private message
kingcrabmeat



Joined: Sep 04, 2014
Posts: 4
Location: US and A

PostPosted: Wed Oct 01, 2014 10:40 am    Post subject: Reply with quote  Mark this post and the followings unread

I found the answer, thanks to ChucK's console output. I tried UGen out of curiosity and got this:

Code:
cannot assign '@=>' on types 'Osc[]' @=> 'UGen[]'


So, the object you're looking for is, indeed, Osc.

However, anything besides the four standard oscillators is classified under UGen. Therefor, it doesn't seem possible to have both standard oscillators and other UGens in a single array. One may opt to use the Blit UGen objects instead as a workaround.
Back to top
View user's profile Send private message
Khepri



Joined: Jul 20, 2009
Posts: 21
Location: Canada

PostPosted: Sun Oct 05, 2014 1:39 pm    Post subject: Reply with quote  Mark this post and the followings unread

kingcrabmeat wrote:
I found the answer, thanks to ChucK's console output. I tried UGen out of curiosity and got this:

Code:
cannot assign '@=>' on types 'Osc[]' @=> 'UGen[]'


So, the object you're looking for is, indeed, Osc.

However, anything besides the four standard oscillators is classified under UGen. Therefor, it doesn't seem possible to have both standard oscillators and other UGens in a single array. One may opt to use the Blit UGen objects instead as a workaround.


Thanks

_________________
Don't fear mistakes. There are none.
- Miles Davis
Back to top
View user's profile Send private message
essteb



Joined: Nov 03, 2014
Posts: 7
Location: Colombia

PostPosted: Wed Nov 05, 2014 1:33 pm    Post subject: in fact it is possible Reply with quote  Mark this post and the followings unread

its possible,

SinOsc sin; Blit blit;
[sin,blit] @=> UGen UGen_array[];
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 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
e-m mkii

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