Author |
Message |
Someone...
Joined: Mar 07, 2014 Posts: 8 Location: Somewhere
|
Posted: 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. |
|
|
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
|
|
|
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Wed Mar 12, 2014 12:12 am Post subject:
|
|
|
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
|
|
|
Someone...
Joined: Mar 07, 2014 Posts: 8 Location: Somewhere
|
Posted: Wed Mar 12, 2014 4:02 pm Post subject:
|
|
|
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
|
|
|
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Thu Mar 13, 2014 11:25 am Post subject:
|
|
|
Heh glad you got it working. 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
|
|
|
Someone...
Joined: Mar 07, 2014 Posts: 8 Location: Somewhere
|
Posted: Fri Mar 14, 2014 7:28 pm Post subject:
|
|
|
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
|
|
|
|