Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

How can I get input audio "value" and make a decision?

For general discussion related FlowStone

How can I get input audio "value" and make a decision?

Postby Nowhk » Thu Apr 16, 2015 2:36 pm

I'd like to do this in FlowStone:

once an audio input signal reach a threshold (let say, 1 in Meter Bi-directional), trigger "false".
Else, when it go below 0.5, trigger "true".

Can I do it with actual FlowStone Modules or need I to make some Ruby script?
Thanks.
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: How can I get input audio "value" and make a decision?

Postby KG_is_back » Thu Apr 16, 2015 2:58 pm

Code: Select all
streamin in;
streamboolout out;


out=in<0.5;


the output will be streamboolean. If you want to convert it to green, modify the mono boolean readout module.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: How can I get input audio "value" and make a decision?

Postby Nowhk » Thu Apr 16, 2015 3:26 pm

KG_is_back wrote:
Code: Select all
streamin in;
streamboolout out;


out=in<0.5;


the output will be streamboolean. If you want to convert it to green, modify the mono boolean readout module.

God, you are fast enough :) What should I need to do with that code? Insert on a ruby script?

Immagine.png
Immagine.png (5.96 KiB) Viewed 13550 times

Seems an error, but maybe I totally misunderstand. I'm a novice :lol:
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: How can I get input audio "value" and make a decision?

Postby KG_is_back » Thu Apr 16, 2015 3:33 pm

Use DSP code component
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: How can I get input audio "value" and make a decision?

Postby Nowhk » Thu Apr 16, 2015 4:03 pm

Ok. Now I got this situation for testing this:

Immagine.png
Immagine.png (30.37 KiB) Viewed 13545 times

Not sure I'm doing it right :) I don't see any Green :geek:

What do you mean with "modify the mono boolean readout module"?
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: How can I get input audio "value" and make a decision?

Postby KG_is_back » Thu Apr 16, 2015 9:12 pm

Double click the mono boolean module. Inside you will see how streams are converted to boolean. Add one output prim and connect it there.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: How can I get input audio "value" and make a decision?

Postby martinvicanek » Thu Apr 16, 2015 10:43 pm

You don't want to perform the operation on the audio signal itself but rather on the envelope (which is basically a rectified and then lowpassed audio signal). Fortunately there is a stock envelope follower module in the toolbox which you can simply place between the volume knob and the code box in your schematic above.

Another, more subtle consideration regards the implementation of a hysteresis (if I read your original post correctly). You can achieve that with the following code:
Code: Select all
streamin in;
streamboolout out;

out = (out|(in<0.5))&(in<1);
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: How can I get input audio "value" and make a decision?

Postby Nowhk » Fri Apr 17, 2015 8:29 am

KG_is_back wrote:Double click the mono boolean module. Inside you will see how streams are converted to boolean. Add one output prim and connect it there.

In this way?

Immagine.png
Immagine.png (17.19 KiB) Viewed 13507 times

I see the Boolean in the output of Mono Boolean module, but it doesn't works: it doesn't trigger any bool with your method.

martinvicanek wrote:You don't want to perform the operation on the audio signal itself but rather on the envelope (which is basically a rectified and then lowpassed audio signal). Fortunately there is a stock envelope follower module in the toolbox which you can simply place between the volume knob and the code box in your schematic above.

Yes. I will place an Envelope follower when I'll make the complete plugs. Now for test also the original signal would be ok I guess.

EDIT: my actual progress is here:
Test.fsm
(159.24 KiB) Downloaded 738 times

Changing the volume knob does nothing :(
Nowhk
 
Posts: 275
Joined: Mon Oct 27, 2014 6:45 pm

Re: How can I get input audio "value" and make a decision?

Postby tulamide » Fri Apr 17, 2015 10:52 am

Hey Nowhk,

I'm not sure if all details are clear to you. So pardon my descriptions, if already known:

What you see from the meter is not the actual value from the stream for several reasons.
1) The bi-directional meter is buggy. There's a "minmax" module inside it that maps all values to the 0-1 range of two directions of the meter.
2) A meter always shows as positive values. A signal of -0.5 will be shown as 0.5 just as a signal of +0.5.
3) A meter is just a slow peek at the values. Approx. 25 times per second is the signal evaluated. But a signal has 22050 values per second at least.

A signal consists of values in the range -1..+1, where 0 means no amplitude. At first I thought you'd try to establish some kind of persistent peak level meter (where the last peak is shown until a stronger peak comes in). But you are only interested in positive values in your example. Could you please tell a little bit more? What is the final goal of this test?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: How can I get input audio "value" and make a decision?

Postby KG_is_back » Fri Apr 17, 2015 10:56 am

tulamide wrote:Changing the volume knob does nothing


There is something wrong with the formula in the DSPcode part.
Code: Select all
out = (out|(in<0.5))&(in<1);

Unless the initial value is in 0.5-1 range this statement is always true for values below 1 and stays that way until in>1
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Next

Return to General

Who is online

Users browsing this forum: No registered users and 75 guests

cron