Square root in code

DSP related issues, mathematics, processing and techniques
Post Reply
flowstone
Posts: 21
Joined: Fri Aug 27, 2010 10:53 pm

Square root in code

Post by flowstone »

Hi,

I'm a Flowstone novice trying to make an RMS voltmeter for the output of an audio processing stream. It would be fairly easy to do in code as the square root of the sum of the squares for an adjustable number of samples of the stream, but I don't see a square root function listed in the code expressions. Is there one? If not, how can I do it just in code?

Is there an alternative method using only the components? So far, I am trying to use mono to float from the output of an amplifier, then stack, square, square root. If that's right, all I need to do is trigger the mono to float block on every sample, but I don't see how to do that.

Thanks in advance for any advice and suggestions.
Exo
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK
Contact:

Re: Square root in code

Post by Exo »

Hi Flowstone,

Your right there is no square root in the code component. But there is a square root command in the assembler component, you have to use that. I'm sure it will be implemented in code at some point.

Your method using components will not work because the triggers cannot be sent at sample rate. When working in 'green' the fastest anything can go is about 100hz using the ticker.

I've knocked up a quick example of how to do RMS in Flowstone. Sorry if I've just done it for you but it's easier for me to just do it than it is to try an explain it :D .

Cheers ;)

Exo
Attachments
RMS.fsm
(14.99 KiB) Downloaded 2000 times
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
flowstone
Posts: 21
Joined: Fri Aug 27, 2010 10:53 pm

Re: Square root in code

Post by flowstone »

Hi Exo,

That great! Thanks very much for your help! Can you recommend a good reference for assembler commands?

Clayton
Exo
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK
Contact:

Re: Square root in code

Post by Exo »

Here's a list of the know supported ASM opcodes

Since Flowstone is based on synthmaker it's a good idea to check out the Synthmaker site and forum lots of useful info over there.

Cheers ;)

Exo
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
User avatar
admin
Site Admin
Posts: 231
Joined: Tue May 11, 2010 6:30 pm

Re: Square root in code

Post by admin »

FYI: Square Root in now added to the list of funtions in the code compoent :)
Post Reply