-
DX8 Play LOOP Help
I started fiddling around with DX8 and laying samples.
I can load & play a .wav file in to the Buffer.
However, haven't figured out how to achieve the following.
https://www.vbforums.com/images/ieimages/2021/11/3.png
1.Play the whole .wav
2.continue Looping from LOOP Points
Any ideas?
-
Re: DX8 Play LOOP Help
Im using DirectSound8 typelib that The trick shared.
if I want a "normal" play, and not looped, I need to continuously check if the sound is done.
I use the "GetStatus" to know that.
after that is easy, I use the SetCurrentPosition parameter to whatever I want it to and start playing.
it is also possible to use the GetCurrentPosition to know where u are at for better precision.
maybe its possible to make some kind of hooking, that will raise when the sound is done playing, but not sure how to do that.
also, GetCurrentPosition will return the "memory" position so far of the wave, so the total is the Buffer size of the stream converted using the acmStream* API
-
Re: DX8 Play LOOP Help
Seems some wavetable synthesis :)
You should implement a circular buffer and write data to it. I'll prepare a small example.
-
Re: DX8 Play LOOP Help
@baka:
Yh I'm looking for ways to hook and get a callback somehow.
The trick
That's correct. Trying to do a small synthesis player of some sort.
Any small example would be great to look in to. Thanks
-
Re: DX8 Play LOOP Help
Update:
I've finally had some time to get back on to this.
I've managed to set up a DirectXEvent8_DXCallback and receive start/end notifications.
However, i haven't been able to figure out a way of getting which Buffer the event is being raised for?
Can anyone shed any light on this?
-
1 Attachment(s)
Re: DX8 Play LOOP Help
The wavetable synth is already done. Just I want to make repository with my DirectSound type library with some examples. I only need to finish capture example and I'll publish all. There are already done useful classes and controls like waveform range selector.
Attachment 183200
-
Re: DX8 Play LOOP Help
Cool.
Question: Does it support multiple .wavs per zone ranges ?
-
1 Attachment(s)
Re: Piano Note Sounds
This is a simple wavetable synthesizer (without ADSR envelope) using DirectSound (i'll update that thread as soon as the capture example is done).
-
Re: DX8 Play LOOP Help
Good stuff there. I've been taking a look for a while to try and figure out what's going on.
Thing is this works on a single .wav, however if we're thinking of a full synth 127 keys & samples, then that's another story.
I haven't been able to turn the CircularBuffer class in to an array as it is declared withevents ?
-
Re: DX8 Play LOOP Help
@The trick
Quite few months since this thread, but I've managed to do what I wanted, however, trying to do some speed optimizations now as there is some lag/latency of around 200 ms between PLAY and Begin of Play.
I've tracked it down to the m_cWaiter_OnWait Sub. More specifically the vbWaitForMultipleObjects
This causes the delay from pressing the button to actually playing the wav.
How can we optimize/speed this up ?