Audio data changed during transmission


#1

I wrote a plugin, periodically sending data to an audio track:
// This is the place where you’d normally do the guts of your plugin’s
_ // audio processing…_
_ int *tmp = new intbuffer.getNumSamples();_
_ for(int i = 0; i < buffer.getNumSamples(); i++)_
_ tmp[i] = 0x3E800000 + i;_
_ _
_ for (int channel = 0; channel < totalNumOutputChannels; ++channel)_
_ {_
_ // …do something to the data…_
_ memcpy(buffer.getWritePointer(channel), tmp, buffer.getNumSamples() * sizeof(int));_
_ }_
_ _
_ delete[] tmp;_
_ tmp = 0;_
(nothing to do with int or float, just to check the memory data)

Then I connected Pro Tools system(HD MADI out) with RME MADIface(MADI in) w/ coaxial cable, just to check whether the data at RME input was still the same.

Then I opened the JUCE Recording Demo and observe the “const float **inputChannelData” in audioDeviceIOCallback, but the data was not the same:
According to the plugin code, I should get 0x3e800000, 0x3e800001, then 02, 03, 04…3ff, 00, 01, 02, 03, etc.
But int the Recording Demo I got 00, 00, 00, 00, 04, 04, 04, 04, 08, 08, 08, 08…
And when I changed the plugin code into i*2, I got 0, 0, 4, 4, 8, 8, c, c…(should be 0 2 4 6 8 a c e…)

I really wanna know who changed the data…Any ideas?
Is there a way that can keep the data unchanged?


#2

I guess the MADI data is 24-bit. If you get 0 0 4 4 8… when you expect 0 2 4 6 8… then it looks like the lowest bit is dropped - maybe there is a -6 dB gain somewhere in the chain? Do you get full-scale on all meters if you output 1.0f ?


#3

you can format your code by surrounding it with 3 ` characters

like this

#4

Yes MADI data is 24-bit, so there’s a conversion from float to 24-bit int.
Thanks