0
0

Is it possible to invert the phase of a wav in FMOD?

  • You must to post comments
0
0

You could definitely do it with a custom DSP. I don’t think FMOD supports negative volumes.

  • You must to post comments
0
0

I don’t think it would be negative volume, but negative panning.

I’m trying to figure out how to approach this, I’m not a math major. I guess what I’m trying to figure out is how to take a wav turn it into an array of numbers per sample, then reverse the order of the array so it’s upside down.

A
9
8
7
6
5
4
3
2
1

becomes

1
2
3
4
5
6
7
8
9
A

at least thats what I’m thinking after looking at a wave editor and seeing how the wav display changes from inverting the phase. It looks as if the waveform is upside down.

I feel that is in already in FMOD since it does 3d sound, and phase inversion sounds like stuff is behind you when your using stereo speakers (also the base for dobly prologic, ie: 3d sound from 2 track audio). Is there a way to trick FMOD into doing this for me, without having to figure out all this math.

  • You must to post comments
0
0

The easiest way to generate a prologic signal is to call System::setSpeakerMode(FMOD_SPEAKERMODE_PROLOGIC).

Negative volume is a concept that doesn’t really have a physical meaning. It is how to invert the phase of digital signal.

Prologic signals are driven by phase inversions using negative volumes. When the two channels are completely out of phase (left volume = negative right volume), the sound will be played evenly from the two rear speakers. You can pan across the the rear speakers by reducing the volume of one channel to shift the sound to the other side. For example, left volume = 0.8 right volume = -0.6 will play from the rear channels, slightly panned to the left.

  • You must to post comments
0
0

good, hopefully this works. I need the inverted signal to control the feedback coils in the cutterhead. The main drive coils have the positive signal, while the feedback coils have the inverted or negative signal, in a push/pull configuration. ๐Ÿ˜‰

  • You must to post comments
0
0

Beware, a phase-matrix "pro-logic" signal is not at all the same as a truly inverted stereo signal. If I were mastering a vinyl disc, I would not want anything in the chain that had to do with prologic unless I actually intended to use it.

It would be much more accurate to write custom dsp or to read fmod’s output and generate your own inversion.

  • You must to post comments
0
0

ahh.. I see, now I just have to figure out how to code that.. 8)

  • You must to post comments
0
0

would it proper to use getWavdata, and then use a normal routine for reversing an array as a long?
Like this maybe?
[code:j5z5zkth]
Public Sub Reverse(ByRef lParams() As Long)

Dim i As Long
Dim tmp As Long

For i = 0 To UBound(lParams) / 2 - 1
    tmp = lParams(i)
    lParams(i) = lParams(UBound(lParams) - i)
    lParams(UBound(lParams) - i) = tmp
Next i

End Sub
[/code:j5z5zkth]

Also is there any information on how to start coding a DSP for fmod?

  • You must to post comments
0
0

Reversing the array would mean the audio would be played in reverse.

Inverting is done on a per-sample basis. Say that each sample is in the range of -1.0 to +1.0, then all you need to do is something like:

[code:ax9ji5fx]For i = 0 To nbSamples
samples(i) = -samples(i)
Next[/code:ax9ji5fx]

  • You must to post comments
0
0

ahh, I see thanks Adion. I’m going to try to get this working today. Once it’s complete, I’ll post a snip of code. ๐Ÿ˜€

  • You must to post comments
Showing 9 results
Your Answer

Please first to submit.