electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
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
Trying to play an array of Noise objects
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
Someone...



Joined: Mar 07, 2014
Posts: 8
Location: Somewhere

PostPosted: Mon Mar 10, 2014 5:22 am    Post subject: Trying to play an array of Noise objects
Subject description: but getting no sound. There are no syntax errors.
Reply with quote  Mark this post and the followings unread

Code:
Noise noiseArray[10];
LPF lpfArray[10];

0.1 => float gain;
200.0 => float lpfFreq;

//initialize values for the noises in the array
for (0 => int i; i <10> lpfArray[i] => dac;
    gain => noiseArray[i].gain;
    0.01 -=> gain;
    lpfFreq => lpfArray[i].freq;
    20 +=> lpfFreq;
}

//play all the noises
while (true){
    1::second => now;
}


So I'm trying to make an array of noises with different low pass filters on them and play all these noises at the same time but I'm getting no sound.
Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Wed Mar 12, 2014 12:12 am    Post subject: Reply with quote  Mark this post and the followings unread

It's difficult to see since your code has been mangled a bit - please click the "Disable HTML in this post" and "Disable Smilies in this post" checkboxes when posting code.
_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Someone...



Joined: Mar 07, 2014
Posts: 8
Location: Somewhere

PostPosted: Wed Mar 12, 2014 4:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

Wow, it really did get mangled. I didn't even notice. I'll be sure to disable HTML and smilies in the future...

Embarrassingly enough... the code I wrote works. It wasn't working when I posted that message but it started working when I opened it up and ran it 2 days later. No idea why. I suppose I'll post the working code in case anyone is curious.

Code:


Noise noiseArray[10];
LPF lpfArray[10];

0.1 => float gain;
200.0 => float lpfFreq;


for (0 => int i; i < 10; i++){
    noiseArray[i] => lpfArray[i] => dac;
    gain => noiseArray[i].gain;
    0.01 -=> gain;
    lpfFreq => lpfArray[i].freq;
    20 +=> lpfFreq;
}


while (true){
    1::second => now;
}

Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Thu Mar 13, 2014 11:25 am    Post subject: Reply with quote  Mark this post and the followings unread

Heh glad you got it working. Smile Maybe it was some audio interface issue or something, like if you have more than one soundcard to choose from?
_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Someone...



Joined: Mar 07, 2014
Posts: 8
Location: Somewhere

PostPosted: Fri Mar 14, 2014 7:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'm not sure... I only have a built in soundcard. Now I'm getting practically the same problem (which I posted in another thread) but I've closed it and gone back to it twice over the past few days and still no sound.
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 [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


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