Posted: Sun Jul 23, 2006 7:27 pm
Amazing job 

http://www.purebasic.com
https://www.purebasic.fr/english/
Well it's not really for me to say - but if there's to be a new module player built in to PB I'd want it to be fully cross platform and also support Impulse Tracker modules with filter cutoff and resonance controls (which aren't available in the .xm format)Amiga5k wrote:I would REALLY like to get a commitment from Fred about adding this officially to the PB package.
In theory, at least it, mod and s3m are losslessly "convertable" into xm. All these module formats are considered somewhat obsolete and I'd suggest using v2m instead. Actually, I've started to use v2m in my own apps. Unfortunately, there isn't any good open source or at least freeware lib to play those files and no public specs available.BTW, Madtracker and some other mod players can load different formats and save them as .xm, so not all mod formats need to be supported by uFMod (In fact, that's one of the things that makes it so small and fast: Only need to support one format).
Well, uFMOD runs in Win32, Linux and BSD. So, it's more crossplatform than many other similar libraries. We're starting to support Kolibri as well. I guess you mean lack of Mac and Amiga support. It's funny an originally amiga module format not supported in Amiga :) Let's say it's still work in progress...but if there's to be a new module player built in to PB I'd want it to be fully cross platform and also support Impulse Tracker modules with filter cutoff and resonance controls (which aren't available in the .xm format)
Code: Select all
[+] uFMOD_PlaySong supports a new flag: XM_NOLOOP
(play the track only once)
[+] Added a new tool: xmstrip
[+] 2 new examples for Borland C++ Builder contributed by
dododo.
[*] Modified XM effects implementation to make some
tracks sound better. This affects 'porta tone'
effects and unaligned bidirectional (aka ping-pong
loops)
[*] Documentation completely updated. A new section added:
tools (about eff and xmstrip).
[*] A lot of size and speed optimization.
Code: Select all
Global DirectSound.IDirectSound
InitSound()
!extrn _PB_DirectSound
!MOV dword EAX, [_PB_DirectSound]
!MOV dword [v_DirectSound],EAX
Code: Select all
bufDesc.DSBUFFERDESC\dwFlags = #DSBCAPS_GLOBALFOCUS | #DSBCAPS_GETCURRENTPOSITION2
Some people don't like inline asm. So, I'm not sure wich way is the proper one. But thats a valuable point anyway. Thanks!chris_b wrote: BTW, the DirectSound version seems to work nicely in conjunction with Windows PB's native sound functions if you use the following:
DirectSound stops a buffer when it's window (the one registered with SetCooperativeLevel) loses the focus. In the example we don't even have a window handle of our own, because there's no main window in the app. So, sticky focus is required to make uFMOD buffer audible. Doesn't the example work on your system?chris_b wrote: (Although on my system the streaming buffer needs global instead of sticky focus for it to behave properly
Seems more like a PB conflict in PB native sound lib (internally using DirectSound). Are you using PB native sound functions at the same time?chris_b wrote: I don't know much about DirectSound so perhaps it doesn't work properly on all systems?
The original example works perfectly. The problem I had is when the sticky focus buffer is created in conjunction with PB's InitSound() function: when calling uFMOD_DSPlaySong() the first second or two of music is sort of sped up or it jumps a bit at the start.Quantum wrote:DirectSound stops a buffer when it's window (the one registered with SetCooperativeLevel) loses the focus. In the example we don't even have a window handle of our own, because there's no main window in the app. So, sticky focus is required to make uFMOD buffer audible. Doesn't the example work on your system?
Yes - there'd be no need to use PB's InitSound() function just to play the music - I assumed my method would be preferable to having a single application create two seperate IDirectSound interfaces (one for music and one for sound effects), but I'm not sure if I'm doing it correctly.Quantum wrote:Are you using PB native sound functions at the same time?
Then, it's OK, IMHO. I guess InitSound registers a sticky focus too (or a global one) for the primary buffer used in PB.chris_b wrote:Yes - there'd be no need to use PB's InitSound() function just to play the music - I assumed my method would be preferable to having a single application create two seperate IDirectSound interfaces (one for music and one for sound effects), but I'm not sure if I'm doing it correctly.
Added another DirectSound PB example based on your code, among other changes. Thanks!chris_b wrote:BTW, the DirectSound version seems to work nicely in conjunction with Windows PB's native sound functions[...]