0
0

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#).

  • You must to post comments
0
0

[quote:8n9t8zcx]The delay you’re talkin about (the delay causing the stereo effect like the one achieved with the Offset command in FT2) can happen in FMOD ? [/quote:8n9t8zcx]

If you make two calls to playsound I think you can be unlucky that they are put into different buffers..

[quote:8n9t8zcx]Some sample code on what you’ve managed doing would be a cool thing.[/quote:8n9t8zcx]

Don’t know if you’re a PureBasic user..? (see http://www.purebasic.com) this is the very simple code:

[code:8n9t8zcx]#FMOD_INIT_NORMAL = $00000000

FMOD_HARDWARE = $00000020

FMOD_LOOP_OFF = $00000001

FMOD_CHANNEL_FREE = -1

Structure FMOD_DSP_DESCRIPTION
name.b[32]
version.l
channels.l
create.l
release.l
reset.l
read_.l
setposition.l
numparameters.l
paramdesc.l
setparameter.l
getparameter.l
config.l
configwidth.l
configheight.l
userdata.l
EndStructure

Procedure DSPCallback(a, b, c, d, e, f)
Debug "hep"
EndProcedure

OpenLibrary(0,"fmodex.dll")
CallFunction(0,"FMOD_System_Create", @system)
CallFunction(0, "FMOD_System_Init", system, 32, #FMOD_INIT_NORMAL, 0)

description.FMOD_DSP_DESCRIPTION
description\read_ = @DSPCallback()
CallFunction(0, "FMOD_System_CreateDSP", system, description, @dsp)
CallFunction(0, "FMOD_System_AddDSP", system, dsp)

Delay(1000)

;Clean up
CallFunction(0, "FMOD_DSP_Remove", dsp)
CallFunction(0, "FMOD_Sound_Release", sound)
CallFunction(0, "FMOD_System_Close", system)
CallFunction(0, "FMOD_System_Release", system)

CloseLibrary(0)
[/code:8n9t8zcx]

  • You must to post comments
0
0

[quote:3ekxgc47]So the mixer has to write its sound in the next free available block. [/quote:3ekxgc47]

Then I don’t understand why my first sample code doesn’t sound right – in that code PlaySound is called from a DSP playback that is called once for each block – so every time I call PlaySound the sound should be put exactly at the start of the following block? it does not sound like that..

  • You must to post comments
0
0

brett, what do you mean by ‘sample accurate timing’? will two samples not be played at exactly the same time by the above method?

About the granularity, 25 ms (default?) is small enough for me..

  • You must to post comments
0
0

Could you send me an executable you made with PureBasic, to see what you mean, I admit I don’t understand all of your problem. Just send me a private message if you’re ok

  • You must to post comments
Showing 21 - 24 of 24 results
Your Answer

Please first to submit.