From the original SynthMaker forum (2004–2014), with its members’ names and dates.
Zyxoas ·
Hey peeps.
I've been working on a little ACG schematic for normalising vocals in real time (though it may also be used as a special effect). As part of the analysis stage, I chain an RMS detector, a Hilbert transform-based envelope follower, and a normal adjustable envelope follower. Both the RMS and Hilbert detectors need to find the square root of a mono signal as part of their processing.
Initially, I used the stream power module that came with Synthmaker. Then I realised that I could speed it up by only processing the [0] data in the assembler component (the included module processes the parameters 4 times, because of SSE packing, but my analysis signal is a simple mono value).
Now, it had been a while since I learnt Assembly Language, so it took me a little time to realise that, instead of using a stream power with the exponent input permanently set to 0.5, I could actually directly calculate the square root itself.
Now, here comes the problem. Although it is a valid floating point instruction, the asm module DOES NOT RECOGNISE THE FSQRT INSTRUCTION. Using it shows a syntax error, and the module produces a bunch of NANs as output, corrupting every component downstream (by the way, the use of a loop in the level meter module, inside the smoothing module, means that you have to actually get inside the schematic and manually reset the looped float every time it gets strange values like NANs).
Why doesn't fsqrt work in the asm module, and can anyone possibly provide me with very fast square root code I can use in the asm module?
TomC ·
Zyxoas wrote: Then I realised that I could speed it up by only processing the [0] data in the assembler component (the included module processes the parameters 4 times, because of SSE packing, but my analysis signal is a simple mono value).
A good assumption would be that the standard stream power primitive uses SSE coding, so it doesn't matter (much) if the signal is mono.
Zyxoas wrote: ...and can anyone possibly provide me with very fast square root code I can use in the asm module?
Never tested if it's actually faster than the primitive, but since I had it laying around anyway I've uploaded my sqrt(x) approximation to the Wiki.
Tom
TomC ·
Umh, nevermind, there's already a mono/poly version from Shif et. al. around here which uses the sqrtps command and which is WAY faster than my approximation.
Just do a search.
Tom
Zyxoas ·
Thanks a lot, Tom! I used the single SSE instruction method, simply because downloading files is a pain for me due to technical issues. If you'd like to copy your code here then I'll try it out.
However, none of this answers the question of why fsqrt does not work in Synthmaker. Developers?
TomC ·
Zyxoas wrote: Thanks a lot, Tom! I used the single SSE instruction method, simply because downloading files is a pain for me due to technical issues. If you'd like to copy your code here then I'll try it out.
Actually, there is only a very limited subset of ASM instructions available, here is the menue from which you can choose:
[old link]
Zyxoas ·
Okay, thanks a lot guys.
I guess that, since Synthmaker is not a dedicated assembler, the developers might find it time-consuming/challenging to implement full assembly support.
Wrote something here? To have a post removed or your name hidden, write to [email protected].