From the original SynthMaker forum (2004–2014), with its members’ names and dates.
Tom7777 ·
Hi, this is probably simple to do but i am in stupid mode today 🙂 Originally i thought the level meter would contain a 0-1 value somewhere but apparently not it seems to give negative values, does anyone have a module that that would sense the volume level ect and output a 0-1 value, mono to float and a tick25 doesnt seem to do the trick either, please help, many thanks 🙂
caco ·
You should be able to take the absolute value and use that for your 0-1 🙂
Tom7777 ·
Hmm using mono to float and having a abs after im getting 2.64(some other numbers) and it's constantly moving for some reason, could you show me an example of what you mean if possible please caco? thanks
caco ·
The best example is the level meter itself. Open its properties and tick the absolute box and it outputs a 0-1 value rather than -1 to +1.
If you go inside the schematic you should see a module called something like Abs?. When absolute is selected this chops off the negative sign to give a positive value, eg -1 becomes +1, -0.5 is +0.5 etc
Tom7777 ·
Hmm this does seem to work but only for the readout graphics what i need is a float value the abs still doesnt help for this, maybe im being stupid and doing something wrong.
caco ·
Okay maybe I don't understand what you are looking to do but the absolute value generated inside the level meter is a float which you can then do whatever you want with. Hope this helps 😀
dreamkeeper ·
Assuming you want to stay in the stream realm:
If you want to map values that range from -1 to +1 into 0-1, add 1 and divide by 2.
If you want the absolute stream value, multiply by -1 and feed both the result and the original value into a stream max component. HTH
werner
Tom7777 ·
If you want to map values that range from -1 to +1 into 0-1, add 1 and divide by 2.
Thanks guys, i try this though and for some reason it's still not giving me 0-1 values 🙁
oddson ·
dreamkeeper wrote: If you want to map values that range from -1 to +1 into 0-1, add 1 and divide by 2.
You probably don't want to map actual values as zero signal would become 0.5 and that seems pretty meaningless.
dreamkeeper wrote: If you want the absolute stream value, multiply by -1 and feed both the result and the original value into a stream max component. HTH
I think this is assuming you're taking the steam value directly instead of taking the level value from the Level Meter.
If you're taking the meter level it should already be between zero and 1 when the absolute option is checked provided the input steam is limited to that range... if you're not limiting the input levels it will read the absolute value of the signal as sampled by the ticker via the mono2float component (although it doesn't seem to go as high as the input signal does and I don't know why that is).
Maybe you could let us know what you're trying to accomplish and we could be more help. 😇
dreamkeeper ·
oddson wrote:
dreamkeeper wrote: If you want to map values that range from -1 to +1 into 0-1, add 1 and divide by 2.
You probably don't want to map actual values as zero signal would become 0.5 and that seems pretty meaningless.
Yes... err... no... I mean: you're right! 😀
oddson wrote:
dreamkeeper wrote: If you want the absolute stream value, multiply by -1 and feed both the result and the original value into a stream max component. HTH
I think this is assuming you're taking the steam value directly instead of taking the level value from the Level Meter.
Yup! It's not quite clear to me what Tom is trying to do.
oddson ·
Knowing Dan (aka Tom7777) he's doing something fiendishly clever and getting stuck on a simple detail. 😉
Tom7777 ·
Well i was going to make a switch event when the synth has been non active for a while, i want to try and get as low CPU as i can and that was just a quick idea i had which is why i need a 0-1 value, if its definately at 0 the whole synth gets switched to nothing, theres other uses i would use it for at some point though like a beat replacer which atomatically adjusts the triggered drums volume to match the originals. 🙂
oddson ·
OK well it like I said above... the level coming off the level meter is already between zero and one when absolute is checked but only if the input is limited to -1 to +1.
For an output switch you could try this.
outputSwitch.osm
Tom7777 ·
Thanks oddson 😀
oddson ·
Your welcome... 🙂
A couple of notes:
1) My example has a potential bug. Since it uses the 'True' trigger it will only shut off it there is a non-zero value in the float array after the 'note on' triggers the flipper. If you have a note on and no sound output it won't know to shut things down. Could be overcome but you don't need to if your synth always gives output after a note on.
2) This isn't likely to save much CPU if any. Many of the sound processes shut off on thier own. I'd say it's only worth using if the synth causes a lot of processing even when idle. But knowing you like to make complex event mechanisms that run all the time I can imagine it might pay off on some of your projects.
Tom7777 ·
Another simple thing i would use audio to 0-1 values for is on LFO's i would make a light pulse getting stonger the higher the value, i can do stuff like this using timers but it would be handy in general for lots of things, in SE you can connect a sine to various things to control them like a lfo and thats one of the only things i havent been able to do in SM and i think there should be a default module to do it as it opens up a whole load of experimental options, i can only do it if its a clean 0-1 float value, of course i know you can use midi data to control various things like in your example but its not really the same 😀
oddson ·
Hi Dan... you're up early, or is it late?
The cycling Float Array part of my example could easily be extended to such uses.
The problem with using the data coming off the mono-to-float component is it's only an instantainious sample of the wave forum and may have nothing to do with the 'volume'. You could use the envelope follower instead but that's overkill if you don't require such accuracy.
The float array could be shortened to a few data points (say 5 for 1/5 of a second duration) and then averaged. It won't be a completely accurate representation of volume but would be better than a single point in time.
I hope this isn't crap... I haven't given it as much thought as I should and I haven't tried any of this out so no guarentees. Sleep time now. 😝
Tom7777 ·
Hi Dan... you're up early, or is it late?
Been up all night 🙂 Could you please make a quick example if possible, i dont mind if its not perfectly accurate just as long as it works reasonably well 😀
oddson ·
It doesn't work as well as I'd hoped... but here it is
averageEG.osm
you might need to use the envelope follower after all.
Must sleep now... some of us older people need our rest before work.
Tom7777 ·
Thanks 🙂
Tom7777 ·
I thought the outputSwitch.osm was working ok but found out it cuts the signal at a certain point if your holding down the piano key for a certain time, i have sort of done it using the peakfollower and the M2F but it cuts off a moment to soon because i have delay and reverb but it wont let them finish, devs a stream 2 float (0-1) module would be great 🙂
Edit - Yeah i tried the EQ example now also again its helpful in some cases but again not what im after, unless someone thats great at mathmatics can make a module for me i think this is going to require a new module in the toolbox, basically it need to be a perfect 0-1 volume sensor so examples like the output switch could use it on synths that had reverb and long delays and it would know exactly when to switch off, with everything i currently have tried it cuts out to soon.
Wrote something here? To have a post removed or your name hidden, write to [email protected].