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?
22 posts
• Page 1 of 3 • 1, 2, 3
How can I get input audio "value" and make a decision?
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.
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?
- 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?
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?
Seems an error, but maybe I totally misunderstand. I'm a novice
- Nowhk
- Posts: 275
- Joined: Mon Oct 27, 2014 6:45 pm
Re: How can I get input audio "value" and make a decision?
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?
Ok. Now I got this situation for testing this:
Not sure I'm doing it right I don't see any Green
What do you mean with "modify the mono boolean readout module"?
Not sure I'm doing it right I don't see any Green
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?
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?
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:
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);
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: How can I get input audio "value" and make a decision?
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?
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:
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?
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?
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?
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
22 posts
• Page 1 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 75 guests