maxmod update 1.16
BlitzMax Forums/BlitzMax Module Tweaks/maxmod update 1.16
| ||
New version of maxmod is up, just click the link in my sig... |
| ||
There is a few changes in this version, that will break current apps, I've seperated the TMusic object and streaming into two seperate object...Local Music:TMusic = LoadMusic(RequestFile("Select music to play...",MusicExtensions())) If Not Music RuntimeError "Unable to open music" Local Stream:TAudioStream = StreamMusic(Music) If Not Stream Notify "Unable to open stream" PlayStream(Stream) So now the TMusic object is the player/decoder and TAudioStream handles the streaming to directsound. Sorry, its a bit awkward, but IMO required in the long run. (ie, its easier to plug into other sound engines ;) ) on the plus side, you can now load the entire track and play it back with freeaudio, without touching a maxmod stream. This release was rushed, so it wasn't as tested as i would have liked, so if you find some bugs, give me a shout. |
| ||
Eek! Slowly getting my head around all this. But what's happened to the 'Pause' method? Is there still a way to pause music then resume it from the same point?? |
| ||
LOL, I'm on it.. ? lol |
| ||
Ok, another version for ya 1.16a, with a pause function! Stream.pause or PauseStream(Stream) Call it once to pause it, and again to unpause. If you have any more problems (probably), let me know mate, I'll fix it asap, gotta get some sleep now tho -.- anyway, sorry for the inconvenience, this update was a bit of a surprise. |
| ||
Thanks Redi ! |
| ||
Couple of problems turning up. 1. Geti(MM_ISPLAYING) - always returns 0. 2. tAudioStream.SetVolume(v) - "Too many function parameters" 3. Setf(MM_VOLUME,v) - does nothing. 4. SetStreamVolume(stream,v) - does nothing. 5. tMusic.Getf(MM_VOLUME) - always returns 0. |
| ||
Redi, Any chance on taking a look at the SidStream changes at some stage?? Unfortunately, a bit beyond me!! |
| ||
thanks GfK, now thats what I call sloppy work! ;) 1. thanks easy fix 2. TAudioStream.SetVolume is a private method, forget that one (your right, i will make it uniform) 3. see 4 4. just tried it here and works okay, value should be between 0.0-1.0 5. oops, use Stream.alPitch as a temp fix @Matt, sure thing, will do it tonight. night all |
| ||
Thanks Redi |
| ||
no problems mate, fixes will be available tonite at some point. |
| ||
REDi, in regards to streaming, I was wondering about the following change to freeaudioaudio.bmx[149] <edit> Method Playing() Local status=fa_ChannelStatus( fa_channel ) & ~(FA_CHANNELSTATUS_STOPPED) ' If status Return True If status Return fa_ChannelPosition(fa_channel)+1 End Method Which should give you the current readpointer of the channel in samples. For music synthesis, you should be then able to play a looped sample and write your data ahead of the mixer's read pointer. Kindof busy at the moment but will try and test / post some helper classes soon. |
| ||
Great news skid, much appreciated! :D |
| ||
OK, it seems to be working, new freeaudio here, and the start of a synth class that supports 8/16/mono/stereo streaming, currently setdriver is required due to a nullaudiodevice somehow being installed after freeaudio default, not sure about that one.... A TFloatSynth is probably needed next, and then a hook to the oggreader code should hopefully be possible. |
| ||
Fixed (I hope) version of maxmod is now up 1.16b, including sidstream.mod update. WOW, Thanks skidracer!, here's a quick bodged tester using maxmod... :D |
| ||
Redi, Thanks for the update and the changes for SidPlayer! |
| ||
No probs mate, give me a shout if you have problems with it. Skid, how about filling the entire sample at creation first, then chasing the play cursor (filling in from the last write position to the play cursor), that way you should always have the entire sample size worth of audio prebuffered (less chance of glitches), also means you dont fill the buffer in same sized chuncks (more evenly spread cpu usage?) See TAudioStream.Update in maxmod.mod/stream.bmx for an idea of how i done it for that. Just a thought. Anyway thanks again, made my day that has! |
| ||
Everyone, To simplify the playing of SIDs using Redi's excellent module, I have created a wrapper to give you access to the required items without flipping between the music and stream types. example: Please download it from here http://www.projectstudioide.com/files/sidstream.zip Unpack it into the \BlitzMax\mod\sid.mod folder If anyone can tidy it up further go right ahead!! |
| ||
Skid, how about filling the entire sample at creation first, then chasing the play cursor (filling in from the last write position to the play cursor), that way you should always have the entire sample size worth of audio prebuffered (less chance of glitches), also means you dont fill the buffer in same sized chuncks (more evenly spread cpu usage?) See TAudioStream.Update in maxmod.mod/stream.bmx for an idea of how i done it for that. Thanks, will take a look. The theory behind current design is the mixer thread does force frag size on most drivers so I am most interested in syncing a synth to the mixer by having it poll at least twice the frequency of that frag length. The Apple CoreAudio driver is a bit unique and it pulls what ever size it wants, I'm more into the fixed size, especially for decoder synths. Hmmm, changing the channel rate on a synth is going to be interesting, it's going to need fragsize * maximum rate for a buffer size, perhaps tsynth should extend tchannel so algorithmic synths can implement rate while decoder style streams get rate change for free but have to deliver more data. Oh, also brl.freeaudioaudio now needs to maintain a reference to sample as pub.freeaudio is no longer making it's own copy of the memory so samples were going out of scope in my game, and when they were deleted freeaudio starts playing corrupted memory which sounded pretty awful, quick hack: |
| ||
Looks like streaming to OpenAL is not going to be quite as straight forward (your test has error in driver name) as there are no dynamic buffers, streamed samples are going to need to have multiple buffers that are queued which need to refresh from the dynamic sample, yuck. |
| ||
There's something bothering me about all this streaming audio lark. Blit3D's PlayMusic() handled it pretty well. Why's Blitzmax apparently such a different kettle of fish? |
| ||
Because b3d used FMOD, and max doesn't? |
| ||
Yeah but my point is, is FMOD can do it, why is it proving to be so difficult for BRL? |
| ||
GfK, IMHO the point is FMOD wasn't written in a week mate! Those guys also have years of experience in audio, way back to the amiga days IIRC. (LOL @ driver name error) |
| ||
REDi, for freeaudio 1.20 which I think is now up on syncmods the channelplaying value now correctly returns position in samples so longer needs to be divided by channels, so where the synth has: readpos=ChannelPlaying(channel)/channels change to readpos=ChannelPlaying(channel) if you don't expect clicking buffer overruns... |
| ||
yeah thanks mate, i figured that one already ;) nice work, sounding good with the default driver, but the directsound one still jumps about abit! (eg, when i use the mouse wheel to scroll in IE) Anyway I'll just wait and see what you come up with for ogg/wav streaming, then I'll follow suit afterwards. tester for maxmod users... Note, since the syncmods it now works without altering any modules. if you have maxmod installed just copy, paste and run. |
| ||
Cool, that maxmod synth seems to play just fine on Apple and Linux although on Linux the mod continues to play even though the process is reportedly finished, very strange... |
| ||
LOL, SWEET! |
| ||
REDi, make sure to bring no loop functionality with next release :) best Roman |
| ||
What has happened to the site? :( |
| ||
Redi's site is down, does anyone else have a link for the download? Many thanks |
| ||
Seek and ye shall find: http://www.blitzbasic.com/Community/posts.php?topic=67827 :) |
| ||
Using the FreeAudio methodology, is this version compatible with all platforms? And on that note, does the entire mod have to be sampled into memory, or could this also be streamed (using FreeAudio for cross-compatibility)? Sampling a 5 minute .xm file, uncompressed, could be quite large! ;) Russell |
| ||
Sorry guys, not online ATM, will be back soon I hope. to skint to be paying out on internet bills ATM. Just to let you know work on maxmod is still going on, sound feking awesome now! and its a hell of a lot quicker to! |
| ||
REDi, that's Good News and hope everything will going well. I really hope there'll be the possibility to "plug" the module part of MaxMod into official audio system so we can have a TModule class or something and they'll be fully cross platfrom. uGMOD have DSound/OpenAL implementations too, but have conflict with official moduls that make it inconvenient to use, I hope MaxMod can integrate everything well.... |
| ||
matts sid.mod link is down have anyone an upload please ..... mfg |
| ||
Panno, Sorry, removed the mod as Redi released a 1.20 version. Have a quick check around the forums for this version. |
| ||
Anybody knows why when I make the game change between the windowed mode and the fullscreen mode my music repeats some seconds using maxmod streaming?? Anybody knows if its possible to fix it? Thanks |
| ||
The repeating is caused by pauses in event handling being bigger than the audios circular buffer, you can make the streaming buffer bigger by changing the global variables used by maxmod... TDirectSoundAudioStream.buffersize = 44100*3 TOpenALAudioStream._buffersize = 1024*8 the values above are the defaults for maxmod, so you could try doubling the buffer sizes, this should be enougth to fix the problem. |