June 22, 2008  
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30

[00:19:56] *** Walt has quit IRC
[00:28:05] *** Walt has joined #openal
[00:28:05] *** ChanServ sets mode: +v Walt
[00:56:13] *** kb1ooo has quit IRC
[02:13:43] *** Walt has quit IRC
[02:18:17] *** Walt has joined #openal
[02:18:17] *** ChanServ sets mode: +v Walt
[02:42:23] *** prophile has quit IRC
[03:39:39] *** kb1ooo has joined #openal
[03:39:39] *** ChanServ sets mode: +v kb1ooo
[05:02:50] *** juanmabc has quit IRC
[05:38:18] *** juanmabc has joined #openal
[05:38:18] *** ChanServ sets mode: +v juanmabc
[09:00:06] * KittyCat is back.
[10:37:25] *** barra has joined #openal
[10:37:25] *** ChanServ sets mode: +v barra
[11:54:37] *** juanmabc has quit IRC
[12:20:52] *** barra is now known as barraAway
[12:32:11] *** prophile has joined #openal
[12:32:11] *** ChanServ sets mode: +v prophile
[12:41:56] *** barraAway is now known as barra
[13:50:26] *** barra_ has joined #openal
[13:50:26] *** ChanServ sets mode: +v barra_
[13:52:41] *** barra has quit IRC
[15:48:47] *** kb1ooo has quit IRC
[16:27:40] *** Walt has quit IRC
[16:52:06] *** Walt_ has joined #openal
[16:52:06] *** ChanServ sets mode: +v Walt_
[16:56:47] *** kb1ooo has joined #openal
[16:56:48] *** ChanServ sets mode: +v kb1ooo
[17:36:34] *** barra_ is now known as barra_nap
[18:25:30] *** Walt has joined #openal
[18:25:30] *** ChanServ sets mode: +v Walt
[18:39:53] *** Walt_ has quit IRC
[19:51:47] *** barra_nap is now known as barra
[21:31:49] <kb1ooo> KittyCat, do you remeber my on/off modulation issue?
[21:32:44] <KittyCat> kb1ooo, I'm not sure. what was the issue?
[21:33:21] <kb1ooo> i need to be able to modulate a single freq tone on and off.
[21:34:37] <kb1ooo> The response time of an AL_GAIN change seems to be faster than the required buffer size for streaming, so I'm trying to modulate the gain as opposed to modulating the signal directly myself.
[21:35:04] <kb1ooo> modulate the gain via AL_GAIN that is
[21:35:15] *** yaakuro has joined #openal
[21:35:15] *** ChanServ sets mode: +v yaakuro
[21:35:52] <KittyCat> ah. well, the response time for updates isn't necessarilly static.
[21:36:45] <KittyCat> depending on CPU load, sound card buffer u pdate position, etc, the amount of data mixed for an update may change
[21:36:47] <kb1ooo> even with a 60ms fall time (i.e. modulate from gain 1 to gain 0 over 60ms) I still get clicks
[21:37:06] <kb1ooo> however, I don't get them at all on a rise (0 to 1).
[21:37:37] <KittyCat> how smooth is your changes, for the code's perspective?
[21:38:30] <KittyCat> 60ms is pretty small for a response time
[21:38:43] <kb1ooo> gaussian, with an alSourcef call every sample interval.
[21:38:59] <KittyCat> I'm not sure what you mean...
[21:39:02] <KittyCat> can you paste the code?
[21:39:21] <kb1ooo> hold on, let me see
[21:41:56] <kb1ooo> http://pastebin.com/m678c4433
[21:46:32] <kb1ooo> I really want to do it over 3ms, not 60ms!
[21:47:52] <KittyCat> a linear approach may be better. something like:
[21:47:55] <KittyCat> http://rafb.net/p/CEhxqd26.html
[21:49:28] <KittyCat> should be easilly "embeddable" into audio logic so you don't tie up your main logic loop
[21:49:50] <kb1ooo> why do you think that linear may be better?   You can prove that a gaussian is spectrally optimal for removing clicks.
[21:51:21] <KittyCat> mainly because I don't know how it'd work on a 1d path. :) but dealing with a linear scale is easier to handle
[21:52:01] <KittyCat> though if you can take that linear scale and derive a strength for a gaussian blur from it..
[21:52:02] <kb1ooo> i'm not streaming, just modulating a playing looped signal.
[21:52:30] <KittyCat> basically you just want to update the volume when you update the sound
[21:53:26] <KittyCat> so you set the start and end times, and at each update, you scale the volume by how close to the end time you are
[21:53:49] <KittyCat> when you pass the end time, set it to the target gain, and leave it
[22:07:16] *** Walt has quit IRC
[22:12:42] <KittyCat> something like this: http://rafb.net/p/834in518.html
[22:13:29] *** Walt has joined #openal
[22:13:29] *** ChanServ sets mode: +v Walt
[22:13:47] <KittyCat> how you get theGain is pretty much up to you. but when now==StartTime, theGain should == StartVolume, and when now==EndTime, theGain should == TargetVolume
[22:17:31] <kb1ooo> same thing, clicking
[22:17:49] <KittyCat> what fade time are you using?
[22:19:51] <kb1ooo> I'm trying to use 100ms.  In your loop however, you have no idea how long you are actually fading for.  you're just guaranteeing that it's the proper value according to the fade time.
[22:20:14] <kb1ooo> proper fraction of the fade time, that is.
[22:21:32] <kb1ooo> I'm not sure why your busier loop should help "embed" however?  I'm not streaming.  I just play a 10 sec sample with AL_LOOPING true.
[22:23:03] <kb1ooo> my modulation loop happens in a thread separate from my main program thread, is that an issue?
[22:23:26] <KittyCat> not as long as the source remains valid
[22:23:35] <kb1ooo> the weird thing is that there is no click at all on the rise, even if I don't modulate.
[22:23:50] <kb1ooo> modulate -> fade
[22:24:23] <KittyCat> you should do the fade in the sound object logic function instead of in its own thread
[22:24:43] <kb1ooo> what do you mean by the " sound object logic function" ?
[22:25:48] <KittyCat> do you have a function that processes the sound object? eg. changes the parameters for a sound (posiiton updates, starting/stopping, polling for streamed sources, etc)
[22:27:41] <kb1ooo> there are no changes/updates once i start playing.
[22:28:02] <kb1ooo> I'm just doing a
[22:28:18] <kb1ooo> _buffer = alutCreateBufferWaveform(ALUT_WAVEFORM_SINE, _freq, 0., 10);
[22:29:10] <kb1ooo> and binding to a source with AL_LOOPING set to true
[22:29:26] <kb1ooo> no updates other than the fade loop
[22:30:27] <kb1ooo> I can stream instead and modulate the signal directly, but then I have to live with the 20ms (1024) buffer size latency.  I was hoping to do better than that.
[22:30:56] <KittyCat> no need to stream (wouldn't help anyway, unless you change the PCM data directly)
[22:31:52] <KittyCat> but just like with graphics updates and game logic updates, you have sound updates, too
[22:32:34] <KittyCat> and you can update the sound volume over a period of time, given a start time, stop time, start/current volume, and target volume
[22:32:34] <kb1ooo> that's what I mean, changing the pcm data directly.
[22:33:02] <kb1ooo> the only updates i need to do in this app are to modulate the sound on and off.  it's a morse code application.
[22:33:18] <KittyCat> hmm..
[22:33:34] <kb1ooo> when the key is pressed, gain goes to 1, when it's released it goes to 0
[22:34:37] <KittyCat> that doesn't sound like a good application for openal (precisely because of the update latencies).
[22:35:26] <KittyCat> well..
[22:35:54] <KittyCat> I dunno, perhaps it can/does update fast enough.
[22:36:00] <kb1ooo> ya, that's what I'm realizing.  However,  it feels quite responsive other than the clicks.
[22:36:23] <KittyCat> hmm
[22:36:57] <kb1ooo> the fact that I don't get the clicks on the rise seems weird.
[22:37:22] <KittyCat> if it's always playing, yeah, that would be kinda wierd
[22:37:41] <KittyCat> but then, I've never had any clicks on rise or fall in anything I've done
[22:38:53] <KittyCat> well, you can do that fade method
[22:39:20] <kb1ooo> which method?
[22:39:49] <KittyCat> basically just call cSound::SetGain(1.0, sometime); when the key is detected as pressed, and cSound::SetGain(0.0, sometime); when it's detected as released
[22:40:20] <kb1ooo> what's cSound?
[22:40:38] <KittyCat> a class/struct, or namespace.
[22:40:53] <kb1ooo> yes, but how do I get access to it.
[22:41:01] <KittyCat> you make it
[22:41:57] <kb1ooo> so SetGain isn't a function available, you mean write it myself?  What would it do?
[22:42:02] <KittyCat> http://rafb.net/p/834in518.htmlif the app is only for simple morse-code, you can just remove the cSound:: and just use SetGain/Update
[22:42:14] <KittyCat> http://rafb.net/p/834in518.html   if the app is only for simple morse-code, you can just remove the cSound:: and just use SetGain/Update
[22:42:52] <KittyCat> a class/namespace is just for better encapsulation, which is good for larger projects
[22:43:43] <kb1ooo> yes, i'm quite familiar with namespaces.  I just didn't know if it was a namespace that was available in OpenAL that i didn't know about.
[22:43:55] <KittyCat> nah
[22:43:59] <KittyCat> OpenAL is C only
[22:44:51] <KittyCat> and OpenAL stuff is all prefixed with al and AL_ (and alc and ALC_)
[22:47:16] <kb1ooo> just looked at your code.  I'm not sure why that would work differently that what you suggested before?
[22:47:56] <kb1ooo> i've got to head out b/c the coffee shop i'm in is closing.  I'll catch you later.  tnx for your help.
[22:47:58] <KittyCat> that is what I sugeested before
[22:48:04] <KittyCat> cya
[22:48:54] <kb1ooo> I missed your post above which is why i was so confused about the namespace thing.  But i mean why different than the loop that you suggested before?
[22:49:09] <kb1ooo> missed your *paste* that is
[22:50:08] <KittyCat> because it'll remain responsive to the keypresses if it doesn't have to wait for the fade to complete
[22:53:20] <kb1ooo> i'm sending you an mp3 of what it sounds like.  This is a fast one so you probably won't be able to distinguish b/w rise and fall.
[22:53:43] <KittyCat> send timed out..
[22:54:04] <kb1ooo> hmm,  I'll try again
[22:54:24] *** angasule has quit IRC
[22:54:47] <KittyCat> same
[22:54:59] <kb1ooo> ok, doesn't seem to be working.  they're going to drag me out of here.  I'll catch you l8r.
[22:55:16] *** kb1ooo has quit IRC
[22:58:35] *** juanmabc has joined #openal
[22:58:35] *** ChanServ sets mode: +v juanmabc
[23:06:47] *** angasule has joined #openal
[23:06:47] *** ChanServ sets mode: +v angasule
[23:07:32] *** prophile has quit IRC
[23:07:51] *** prophile has joined #openal
[23:07:51] *** ChanServ sets mode: +v prophile

top