minabs at audiorate without loosing the sign
Date | 2016-04-20 17:51 |
From | Peter Burgess |
Subject | minabs at audiorate without loosing the sign |
How would I go about performing a minabs comparrison beteen audio rate variables, without losing the original sign? Every way I can think of to solve this problem eventually requires an if statement Pete |
Date | 2016-04-20 20:51 |
From | Iain McCurdy |
Subject | Re: minabs at audiorate without loosing the sign |
Assuming that you are comparing audio signals at 0dbfs=1, does this do what you want? amin minabs a1+1,a2+1 amin -= 1 > Date: Wed, 20 Apr 2016 17:51:35 +0100 > From: pete.soundtechnician@GMAIL.COM > Subject: [Csnd] minabs at audiorate without loosing the sign > To: CSOUND@LISTSERV.HEANET.IE > > How would I go about performing a minabs comparrison beteen audio rate > variables, without losing the original sign? Every way I can think of > to solve this problem eventually requires an if statement > > Pete > > -- > http://algorythmradio.com > https://soundcloud.com/algorythmradio > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here |
Date | 2016-04-21 14:14 |
From | Peter Burgess |
Subject | Re: minabs at audiorate without loosing the sign |
That wouldn't compare the absolute values anymore. I've just realised that what I need isn't a signed output necessarily, but I need to be able to retrieve the sign after the operation. If an if statement worked at audio rate, I'd be doing something like this: ; Threshold for both positive and negative parts of the signal kThreshold init 0.4 ; If signal is above threshold, output threshold aBelowThreshold minabs aSig, a(kThreshold) ; Make negative if aSig was negative if (aSig < 0) then aBelowTheshold *= -1 endif On Wed, Apr 20, 2016 at 8:51 PM, Iain McCurdy |
Date | 2016-04-21 14:24 |
From | Tarmo Johannes |
Subject | Re: minabs at audiorate without loosing the sign |
Not sure but would not opcode limit do the job? 21.04.2016 16:14 kirjutas kuupäeval "Peter Burgess" <pete.soundtechnician@gmail.com>:
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
That wouldn't compare the absolute values anymore. I've just realised |
Date | 2016-04-21 14:26 |
From | Peter Burgess |
Subject | Re: minabs at audiorate without loosing the sign |
.................... oh yeah! Lol :D And I just finished devising some cranky complex way to do this that actually involved limit later on. Doh! Thanks man ;) Pete On Thu, Apr 21, 2016 at 2:24 PM, Tarmo Johannes |
Date | 2016-04-21 14:28 |
From | Peter Burgess |
Subject | Re: minabs at audiorate without loosing the sign |
I just tried to do it like this, hahahah! ; Threshold for both positive and negative parts of the signal kThreshold init 0.4 ; If signal is above threshold, output threshold aBelowThreshold minabs aSig, a(kThreshold) ; Make negative if aSig was negative if (aSig < 0) then aBelowTheshold *= -1 endif ;;; Retrieve sign of original signal ; Has to be less than 1.0, and greater than -1.0 to work aLimit limit aSig, -0.9, 0.9 ; Returns 0 if positive, and -1 if negative aFloor = floor(aLimit) ; Returns 1 if positive, and 0 if negative aCeil = ceil(aLimit) ; Adding floor and ceiling gets -1 if negative, and 1 if positive aSignMult = aFloor + aCeil ; Multiply to get original sign aBelowTheshold *= aSignMult On Thu, Apr 21, 2016 at 2:26 PM, Peter Burgess |
Date | 2016-04-21 15:21 |
From | Anders Genell |
Subject | Re: minabs at audiorate without loosing the sign |
On Thu, Apr 21, 2016 at 3:28 PM, Peter Burgess <pete.soundtechnician@gmail.com> wrote: I just tried to do it like this, hahahah! |
Date | 2016-04-21 15:46 |
From | Peter Burgess |
Subject | Re: minabs at audiorate without loosing the sign |
Hahahaha. Is this a job you've applied for? On Thu, Apr 21, 2016 at 3:21 PM, Anders Genell |
Date | 2016-04-21 15:49 |
From | Anders Genell |
Subject | Re: minabs at audiorate without loosing the sign |
No, but that is of course only because I'm not qualified... On Thu, Apr 21, 2016 at 4:46 PM, Peter Burgess <pete.soundtechnician@gmail.com> wrote: Hahahaha. Is this a job you've applied for? |
Date | 2016-04-21 15:50 |
From | Rory Walsh |
Subject | Re: minabs at audiorate without loosing the sign |
I'm not sure anyone has ever applied for such a position, yet plenty find themselves in them! On 21 Apr 2016 3:46 pm, "Peter Burgess" <pete.soundtechnician@gmail.com> wrote:
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Hahahaha. Is this a job you've applied for? |
Date | 2016-04-21 15:55 |
From | Victor Lazzarini |
Subject | Re: minabs at audiorate without loosing the sign |
That has to go straight to social media... ======================== Dr Victor Lazzarini Dean of Arts, Celtic Studies and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 21 Apr 2016, at 15:21, Anders Genell |