Hello, this is my first post..!
I want to make a kind og music tracker using FMOD Ex, so my question is how to play sequences of samples precisely? For example, how do I play one sample at one moment and then play two other samples exactly one second after and at the same time (I would like an example in C#).
- Noufardn asked 12 years ago
By having taken a long look at the Modplug Tracker code, the delay/interval of the modplug tracker thread or timer (I don’t know which it is) is not as accurate as 1ms. It doesn’t even look MPT uses a multimedia timer as far as I remember.
Your app should just be able to act at tick intervals. For an IT module at T120 speed 6, the tick interval is the same as for a T120 speed 3, that is about 20ms. FMOD enables you, if your app can’t be responsive enough, to delay a sound triggering. Don’t have looked how much.
Normally, if you have succeeded in using multimedia timer, you can do what you’re looking for. It depends on whether it’s 1ms accurate or 15.
With Queue timers I have managed to making a functionnal beginning of sequencer, so FMOD is not incriminated.
[quote="Noufardn":3kys6h58]multimedia timers – it is part of new versions of the Windows API and is used with methods like timeSetEvent. From a bit of experimentation I found that this timer is actually quite accurate! [/quote:3kys6h58]
Ah yes it’s interesting, how accurate was this timer event ?
Regarding the code you’d like, if you look into the 2004/02/26 released code of Modplug Tracker (can be found at sourceforge.net), it looks like the code uses only timers and threads. However, it’s in no way a problem for the users: A module song played twice sounds the same twice (for a human being), so I think you don’t have to bother for the special DSP.
I have another question : OK, multimedia timers etc should be ok for sequencing sounds, but how to sequence sounds for non realtime rendering ? (for example a wav or mp3 writer)
[quote:3a7c1uws]Ah yes it’s interesting, how accurate was this timer event ? [/quote:3a7c1uws]
It depends on your machine but on my very old machine it seemed to be very precise within 1 ms.
[quote:3a7c1uws]how to sequence sounds for non realtime rendering ? (for example a wav or mp3 writer)[/quote:3a7c1uws]
Well if it is non realtime then it is not sequencing, I think.. but I guess you can render realtime and get FMOD to output to a file…?
About the DSP callback I think it is necessary. I’m thinking about playing two samples at the same time – in special cases you can actually hear these small delays – if for example you play the same sound twice at the same time where each sound is panned to left and right – if one of the sounds is played just a little bit later you can hear a kind of stereo effect (i used that trick when I made music with Fasttracker..)
btw I made a DSP callback work with some PureBasic code.. with C# i however get some strange protection errors..
- Noufardn answered 12 years ago
Please login first to submit.