Csound Csound-dev Csound-tekno Search About

Dam opcode phazy (also includes an example from my app that I promised ages ago!)

Date2016-01-28 22:08
FromPeter Burgess
SubjectDam opcode phazy (also includes an example from my app that I promised ages ago!)
AttachmentsDam Test - No Comp.mp3  Dam Test - Ratios Of 1.mp3  
Hi there! Ive just noticed that the opcode Dam seems to make my bass
sound a bit phasy, even when both upper and lower ratios are set to 1.

I have attached 2 examples, 1 passes through the compressor with
ratios set to one, the other bypasses the compressor.

ithresh = 0.8
iratio1 = 1
iratio2 = 1
iatt = 0.01
irel = 0.5
acompL dam amixL, ithresh, iratio1, iratio2, iatt, irel
acompR dam amixR, ithresh, iratio1, iratio2, iatt, irel

Why is that?

I promised a while back to post some examples of what the app I'm
developing does, so I guess the non phasy one of these could be
counted as the first example, which will make it the first public
example! :D I will post some more quite different examples soon too.

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

Date2016-01-28 22:16
FromPeter Burgess
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
Just been messing around with the attack and release time's too, and I
have to set them both as high as 0.5 to only have a mild buzz when the
bass plays

On Thu, Jan 28, 2016 at 10:08 PM, Peter Burgess
 wrote:
> Hi there! Ive just noticed that the opcode Dam seems to make my bass
> sound a bit phasy, even when both upper and lower ratios are set to 1.
>
> I have attached 2 examples, 1 passes through the compressor with
> ratios set to one, the other bypasses the compressor.
>
> ithresh = 0.8
> iratio1 = 1
> iratio2 = 1
> iatt = 0.01
> irel = 0.5
> acompL dam amixL, ithresh, iratio1, iratio2, iatt, irel
> acompR dam amixR, ithresh, iratio1, iratio2, iatt, irel
>
> Why is that?
>
> I promised a while back to post some examples of what the app I'm
> developing does, so I guess the non phasy one of these could be
> counted as the first example, which will make it the first public
> example! :D I will post some more quite different examples soon too.

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

Date2016-01-28 23:15
FromRory Walsh
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)

Not sure about your question but the flute sound good!

On 28 Jan 2016 22:16, "Peter Burgess" <pete.soundtechnician@gmail.com> wrote:
Just been messing around with the attack and release time's too, and I
have to set them both as high as 0.5 to only have a mild buzz when the
bass plays

On Thu, Jan 28, 2016 at 10:08 PM, Peter Burgess
<pete.soundtechnician@gmail.com> wrote:
> Hi there! Ive just noticed that the opcode Dam seems to make my bass
> sound a bit phasy, even when both upper and lower ratios are set to 1.
>
> I have attached 2 examples, 1 passes through the compressor with
> ratios set to one, the other bypasses the compressor.
>
> ithresh = 0.8
> iratio1 = 1
> iratio2 = 1
> iatt = 0.01
> irel = 0.5
> acompL dam amixL, ithresh, iratio1, iratio2, iatt, irel
> acompR dam amixR, ithresh, iratio1, iratio2, iatt, irel
>
> Why is that?
>
> I promised a while back to post some examples of what the app I'm
> developing does, so I guess the non phasy one of these could be
> counted as the first example, which will make it the first public
> example! :D I will post some more quite different examples soon too.

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
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

Date2016-01-29 00:04
FromPeter Burgess
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
It does doesn't it! Thank you Hans Mikelson and Perry Cook :D

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

Date2016-01-29 07:52
FromOeyvind Brandtsegg
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
Nice!.
I agree about the distortion/artifacts on the bass. Not sure about
dam, never used it much. Did you try the compress opcode?
Also, if you want more detailed control and easier artifact-finding,
you could easily implement a compressor yourself, something along
these lines:

iamp = ampdbfs(p4) ; Amp in -dB
kthresh = p5 ; compression threshold
kratio = p6 ; compression ratio
kattack = p7 ; attack time
krelease = p8 ; release time

arms follow2 a1, kattack/1000, krelease ; envelope follower
karms downsamp arms ; workaround for dbfsamp (should take a-rate input)
arms_dB = dbfsamp(karms) ; convert to dB scale
aovershoot = arms_dB - kthresh ; how much over the threshold are we?
atarget = kthresh + (aovershoot*(1/kratio)) ; target output level
(with current input level, threshold and ratio)
ampMod_dB =  atarget - arms_dB ; difference from target = adjust amount
ampMod_dB limit ampMod_dB, -150, 0 ; do not adjust unless negative
ampMod = ampdbfs(ampMod_dB) ; convert back to normalized scale
acomp = a1*ampMod ; apply amplitude modification

all best
Oeyvind

2016-01-29 1:04 GMT+01:00 Peter Burgess :
> It does doesn't it! Thank you Hans Mikelson and Perry Cook :D
>
> 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


Date2016-01-29 11:34
FromPeter Burgess
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
Nice! That's not a bad idea. I'm gonna give compress a go first
though. I decided to go with dam first because it has less controls,
and I didn't need the sidechain function. However, I already have
compress on just my basses for the sidechain compression, and I
haven't noticed any distortion from that, so maybe compress will be a
better choice.

On Fri, Jan 29, 2016 at 7:52 AM, Oeyvind Brandtsegg
 wrote:
> Nice!.
> I agree about the distortion/artifacts on the bass. Not sure about
> dam, never used it much. Did you try the compress opcode?
> Also, if you want more detailed control and easier artifact-finding,
> you could easily implement a compressor yourself, something along
> these lines:
>
> iamp = ampdbfs(p4) ; Amp in -dB
> kthresh = p5 ; compression threshold
> kratio = p6 ; compression ratio
> kattack = p7 ; attack time
> krelease = p8 ; release time
>
> arms follow2 a1, kattack/1000, krelease ; envelope follower
> karms downsamp arms ; workaround for dbfsamp (should take a-rate input)
> arms_dB = dbfsamp(karms) ; convert to dB scale
> aovershoot = arms_dB - kthresh ; how much over the threshold are we?
> atarget = kthresh + (aovershoot*(1/kratio)) ; target output level
> (with current input level, threshold and ratio)
> ampMod_dB =  atarget - arms_dB ; difference from target = adjust amount
> ampMod_dB limit ampMod_dB, -150, 0 ; do not adjust unless negative
> ampMod = ampdbfs(ampMod_dB) ; convert back to normalized scale
> acomp = a1*ampMod ; apply amplitude modification
>
> all best
> Oeyvind
>
> 2016-01-29 1:04 GMT+01:00 Peter Burgess :
>> It does doesn't it! Thank you Hans Mikelson and Perry Cook :D
>>
>> 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
>
>
>
> --
>
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
>
> http://www.partikkelaudio.com/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
>
> 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

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

Date2016-01-29 12:20
Fromjpff
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
dam was originlly written as an example opcode on how toinclude a new 
opcode in the system -- way back.  I doubt that it has hd much use.
==John ff

On Fri, 29 Jan 2016, Peter Burgess wrote:

> Nice! That's not a bad idea. I'm gonna give compress a go first
> though. I decided to go with dam first because it has less controls,
> and I didn't need the sidechain function. However, I already have
> compress on just my basses for the sidechain compression, and I
> haven't noticed any distortion from that, so maybe compress will be a
> better choice.
>
> On Fri, Jan 29, 2016 at 7:52 AM, Oeyvind Brandtsegg
>  wrote:
>> Nice!.
>> I agree about the distortion/artifacts on the bass. Not sure about
>> dam, never used it much. Did you try the compress opcode?
>> Also, if you want more detailed control and easier artifact-finding,
>> you could easily implement a compressor yourself, something along
>> these lines:
>>
>> iamp = ampdbfs(p4) ; Amp in -dB
>> kthresh = p5 ; compression threshold
>> kratio = p6 ; compression ratio
>> kattack = p7 ; attack time
>> krelease = p8 ; release time
>>
>> arms follow2 a1, kattack/1000, krelease ; envelope follower
>> karms downsamp arms ; workaround for dbfsamp (should take a-rate input)
>> arms_dB = dbfsamp(karms) ; convert to dB scale
>> aovershoot = arms_dB - kthresh ; how much over the threshold are we?
>> atarget = kthresh + (aovershoot*(1/kratio)) ; target output level
>> (with current input level, threshold and ratio)
>> ampMod_dB =  atarget - arms_dB ; difference from target = adjust amount
>> ampMod_dB limit ampMod_dB, -150, 0 ; do not adjust unless negative
>> ampMod = ampdbfs(ampMod_dB) ; convert back to normalized scale
>> acomp = a1*ampMod ; apply amplitude modification
>>
>> all best
>> Oeyvind
>>
>> 2016-01-29 1:04 GMT+01:00 Peter Burgess :
>>> It does doesn't it! Thank you Hans Mikelson and Perry Cook :D
>>>
>>> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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
>
> 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
>

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

Date2016-01-29 12:22
FromOeyvind Brandtsegg
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
Oh. Should perhaps go into the deprecated list then?

2016-01-29 13:20 GMT+01:00 jpff :
> dam was originlly written as an example opcode on how toinclude a new opcode
> in the system -- way back.  I doubt that it has hd much use.
> ==John ff
>
>
> On Fri, 29 Jan 2016, Peter Burgess wrote:
>
>> Nice! That's not a bad idea. I'm gonna give compress a go first
>> though. I decided to go with dam first because it has less controls,
>> and I didn't need the sidechain function. However, I already have
>> compress on just my basses for the sidechain compression, and I
>> haven't noticed any distortion from that, so maybe compress will be a
>> better choice.
>>
>> On Fri, Jan 29, 2016 at 7:52 AM, Oeyvind Brandtsegg
>>  wrote:
>>>
>>> Nice!.
>>> I agree about the distortion/artifacts on the bass. Not sure about
>>> dam, never used it much. Did you try the compress opcode?
>>> Also, if you want more detailed control and easier artifact-finding,
>>> you could easily implement a compressor yourself, something along
>>> these lines:
>>>
>>> iamp = ampdbfs(p4) ; Amp in -dB
>>> kthresh = p5 ; compression threshold
>>> kratio = p6 ; compression ratio
>>> kattack = p7 ; attack time
>>> krelease = p8 ; release time
>>>
>>> arms follow2 a1, kattack/1000, krelease ; envelope follower
>>> karms downsamp arms ; workaround for dbfsamp (should take a-rate input)
>>> arms_dB = dbfsamp(karms) ; convert to dB scale
>>> aovershoot = arms_dB - kthresh ; how much over the threshold are we?
>>> atarget = kthresh + (aovershoot*(1/kratio)) ; target output level
>>> (with current input level, threshold and ratio)
>>> ampMod_dB =  atarget - arms_dB ; difference from target = adjust amount
>>> ampMod_dB limit ampMod_dB, -150, 0 ; do not adjust unless negative
>>> ampMod = ampdbfs(ampMod_dB) ; convert back to normalized scale
>>> acomp = a1*ampMod ; apply amplitude modification
>>>
>>> all best
>>> Oeyvind
>>>
>>> 2016-01-29 1:04 GMT+01:00 Peter Burgess :
>>>>
>>>> It does doesn't it! Thank you Hans Mikelson and Perry Cook :D
>>>>
>>>> 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
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> 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
>>
>>
>> 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
>>
>
> 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


Date2016-01-29 12:27
FromPeter Burgess
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
Or could be improved? ah? ah? Nudge nudge wink wink? :D

I like the controls of dam way more than compress, I hate working with
decibels. If it wasn't for the noise, I have dam set up perfectly for
my master bus, and I find compress a nightmare to get right.

On Fri, Jan 29, 2016 at 12:22 PM, Oeyvind Brandtsegg
 wrote:
> Oh. Should perhaps go into the deprecated list then?
>
> 2016-01-29 13:20 GMT+01:00 jpff :
>> dam was originlly written as an example opcode on how toinclude a new opcode
>> in the system -- way back.  I doubt that it has hd much use.
>> ==John ff
>>
>>
>> On Fri, 29 Jan 2016, Peter Burgess wrote:
>>
>>> Nice! That's not a bad idea. I'm gonna give compress a go first
>>> though. I decided to go with dam first because it has less controls,
>>> and I didn't need the sidechain function. However, I already have
>>> compress on just my basses for the sidechain compression, and I
>>> haven't noticed any distortion from that, so maybe compress will be a
>>> better choice.
>>>
>>> On Fri, Jan 29, 2016 at 7:52 AM, Oeyvind Brandtsegg
>>>  wrote:
>>>>
>>>> Nice!.
>>>> I agree about the distortion/artifacts on the bass. Not sure about
>>>> dam, never used it much. Did you try the compress opcode?
>>>> Also, if you want more detailed control and easier artifact-finding,
>>>> you could easily implement a compressor yourself, something along
>>>> these lines:
>>>>
>>>> iamp = ampdbfs(p4) ; Amp in -dB
>>>> kthresh = p5 ; compression threshold
>>>> kratio = p6 ; compression ratio
>>>> kattack = p7 ; attack time
>>>> krelease = p8 ; release time
>>>>
>>>> arms follow2 a1, kattack/1000, krelease ; envelope follower
>>>> karms downsamp arms ; workaround for dbfsamp (should take a-rate input)
>>>> arms_dB = dbfsamp(karms) ; convert to dB scale
>>>> aovershoot = arms_dB - kthresh ; how much over the threshold are we?
>>>> atarget = kthresh + (aovershoot*(1/kratio)) ; target output level
>>>> (with current input level, threshold and ratio)
>>>> ampMod_dB =  atarget - arms_dB ; difference from target = adjust amount
>>>> ampMod_dB limit ampMod_dB, -150, 0 ; do not adjust unless negative
>>>> ampMod = ampdbfs(ampMod_dB) ; convert back to normalized scale
>>>> acomp = a1*ampMod ; apply amplitude modification
>>>>
>>>> all best
>>>> Oeyvind
>>>>
>>>> 2016-01-29 1:04 GMT+01:00 Peter Burgess :
>>>>>
>>>>> It does doesn't it! Thank you Hans Mikelson and Perry Cook :D
>>>>>
>>>>> 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
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Oeyvind Brandtsegg
>>>> Professor of Music Technology
>>>> NTNU
>>>> 7491 Trondheim
>>>> Norway
>>>> Cell: +47 92 203 205
>>>>
>>>> http://www.partikkelaudio.com/
>>>> http://soundcloud.com/brandtsegg
>>>> http://flyndresang.no/
>>>> http://soundcloud.com/t-emp
>>>>
>>>> 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
>>>
>>>
>>> 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
>>>
>>
>> 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
>
>
>
> --
>
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
>
> http://www.partikkelaudio.com/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
>
> 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

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

Date2016-01-29 12:33
FromOeyvind Brandtsegg
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
Hm, opinions may differ, but decibels are generally pretty handy for
managing sound levels. That said, it looks as if the compress opcode
has a nonstandard/old way of handling decibels. It states that 90dB
corresponds to an amplitude of 32768.
If might be more intuitive if it related to 0dbfs and used negative dB scale.
Then, changing the behaviour of excisting opcodes is generally
discouraged due to backwards compatibility.


2016-01-29 13:27 GMT+01:00 Peter Burgess :
> Or could be improved? ah? ah? Nudge nudge wink wink? :D
>
> I like the controls of dam way more than compress, I hate working with
> decibels. If it wasn't for the noise, I have dam set up perfectly for
> my master bus, and I find compress a nightmare to get right.
>
> On Fri, Jan 29, 2016 at 12:22 PM, Oeyvind Brandtsegg
>  wrote:
>> Oh. Should perhaps go into the deprecated list then?
>>
>> 2016-01-29 13:20 GMT+01:00 jpff :
>>> dam was originlly written as an example opcode on how toinclude a new opcode
>>> in the system -- way back.  I doubt that it has hd much use.
>>> ==John ff
>>>
>>>
>>> On Fri, 29 Jan 2016, Peter Burgess wrote:
>>>
>>>> Nice! That's not a bad idea. I'm gonna give compress a go first
>>>> though. I decided to go with dam first because it has less controls,
>>>> and I didn't need the sidechain function. However, I already have
>>>> compress on just my basses for the sidechain compression, and I
>>>> haven't noticed any distortion from that, so maybe compress will be a
>>>> better choice.
>>>>
>>>> On Fri, Jan 29, 2016 at 7:52 AM, Oeyvind Brandtsegg
>>>>  wrote:
>>>>>
>>>>> Nice!.
>>>>> I agree about the distortion/artifacts on the bass. Not sure about
>>>>> dam, never used it much. Did you try the compress opcode?
>>>>> Also, if you want more detailed control and easier artifact-finding,
>>>>> you could easily implement a compressor yourself, something along
>>>>> these lines:
>>>>>
>>>>> iamp = ampdbfs(p4) ; Amp in -dB
>>>>> kthresh = p5 ; compression threshold
>>>>> kratio = p6 ; compression ratio
>>>>> kattack = p7 ; attack time
>>>>> krelease = p8 ; release time
>>>>>
>>>>> arms follow2 a1, kattack/1000, krelease ; envelope follower
>>>>> karms downsamp arms ; workaround for dbfsamp (should take a-rate input)
>>>>> arms_dB = dbfsamp(karms) ; convert to dB scale
>>>>> aovershoot = arms_dB - kthresh ; how much over the threshold are we?
>>>>> atarget = kthresh + (aovershoot*(1/kratio)) ; target output level
>>>>> (with current input level, threshold and ratio)
>>>>> ampMod_dB =  atarget - arms_dB ; difference from target = adjust amount
>>>>> ampMod_dB limit ampMod_dB, -150, 0 ; do not adjust unless negative
>>>>> ampMod = ampdbfs(ampMod_dB) ; convert back to normalized scale
>>>>> acomp = a1*ampMod ; apply amplitude modification
>>>>>
>>>>> all best
>>>>> Oeyvind
>>>>>
>>>>> 2016-01-29 1:04 GMT+01:00 Peter Burgess :
>>>>>>
>>>>>> It does doesn't it! Thank you Hans Mikelson and Perry Cook :D
>>>>>>
>>>>>> 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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Oeyvind Brandtsegg
>>>>> Professor of Music Technology
>>>>> NTNU
>>>>> 7491 Trondheim
>>>>> Norway
>>>>> Cell: +47 92 203 205
>>>>>
>>>>> http://www.partikkelaudio.com/
>>>>> http://soundcloud.com/brandtsegg
>>>>> http://flyndresang.no/
>>>>> http://soundcloud.com/t-emp
>>>>>
>>>>> 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
>>>>
>>>>
>>>> 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
>>>>
>>>
>>> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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
>
> 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


Date2016-01-29 12:51
FromAnders Genell
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
Maybe an additional irate parameter to compress that allow the much more intuitive behaviour with negative db from 0dbfs reference?
It could have a default behaviour like the current compress.

Regards,
Anders 

On Fri, Jan 29, 2016 at 1:33 PM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
Hm, opinions may differ, but decibels are generally pretty handy for
managing sound levels. That said, it looks as if the compress opcode
has a nonstandard/old way of handling decibels. It states that 90dB
corresponds to an amplitude of 32768.
If might be more intuitive if it related to 0dbfs and used negative dB scale.
Then, changing the behaviour of excisting opcodes is generally
discouraged due to backwards compatibility.


2016-01-29 13:27 GMT+01:00 Peter Burgess <pete.soundtechnician@gmail.com>:
> Or could be improved? ah? ah? Nudge nudge wink wink? :D
>
> I like the controls of dam way more than compress, I hate working with
> decibels. If it wasn't for the noise, I have dam set up perfectly for
> my master bus, and I find compress a nightmare to get right.
>
> On Fri, Jan 29, 2016 at 12:22 PM, Oeyvind Brandtsegg
> <oyvind.brandtsegg@ntnu.no> wrote:
>> Oh. Should perhaps go into the deprecated list then?
>>
>> 2016-01-29 13:20 GMT+01:00 jpff <jpff@codemist.co.uk>:
>>> dam was originlly written as an example opcode on how toinclude a new opcode
>>> in the system -- way back.  I doubt that it has hd much use.
>>> ==John ff
>>>
>>>
>>> On Fri, 29 Jan 2016, Peter Burgess wrote:
>>>
>>>> Nice! That's not a bad idea. I'm gonna give compress a go first
>>>> though. I decided to go with dam first because it has less controls,
>>>> and I didn't need the sidechain function. However, I already have
>>>> compress on just my basses for the sidechain compression, and I
>>>> haven't noticed any distortion from that, so maybe compress will be a
>>>> better choice.
>>>>
>>>> On Fri, Jan 29, 2016 at 7:52 AM, Oeyvind Brandtsegg
>>>> <oyvind.brandtsegg@ntnu.no> wrote:
>>>>>
>>>>> Nice!.
>>>>> I agree about the distortion/artifacts on the bass. Not sure about
>>>>> dam, never used it much. Did you try the compress opcode?
>>>>> Also, if you want more detailed control and easier artifact-finding,
>>>>> you could easily implement a compressor yourself, something along
>>>>> these lines:
>>>>>
>>>>> iamp = ampdbfs(p4) ; Amp in -dB
>>>>> kthresh = p5 ; compression threshold
>>>>> kratio = p6 ; compression ratio
>>>>> kattack = p7 ; attack time
>>>>> krelease = p8 ; release time
>>>>>
>>>>> arms follow2 a1, kattack/1000, krelease ; envelope follower
>>>>> karms downsamp arms ; workaround for dbfsamp (should take a-rate input)
>>>>> arms_dB = dbfsamp(karms) ; convert to dB scale
>>>>> aovershoot = arms_dB - kthresh ; how much over the threshold are we?
>>>>> atarget = kthresh + (aovershoot*(1/kratio)) ; target output level
>>>>> (with current input level, threshold and ratio)
>>>>> ampMod_dB =  atarget - arms_dB ; difference from target = adjust amount
>>>>> ampMod_dB limit ampMod_dB, -150, 0 ; do not adjust unless negative
>>>>> ampMod = ampdbfs(ampMod_dB) ; convert back to normalized scale
>>>>> acomp = a1*ampMod ; apply amplitude modification
>>>>>
>>>>> all best
>>>>> Oeyvind
>>>>>
>>>>> 2016-01-29 1:04 GMT+01:00 Peter Burgess <pete.soundtechnician@gmail.com>:
>>>>>>
>>>>>> It does doesn't it! Thank you Hans Mikelson and Perry Cook :D
>>>>>>
>>>>>> 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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Oeyvind Brandtsegg
>>>>> Professor of Music Technology
>>>>> NTNU
>>>>> 7491 Trondheim
>>>>> Norway
>>>>> Cell: +47 92 203 205
>>>>>
>>>>> http://www.partikkelaudio.com/
>>>>> http://soundcloud.com/brandtsegg
>>>>> http://flyndresang.no/
>>>>> http://soundcloud.com/t-emp
>>>>>
>>>>> 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
>>>>
>>>>
>>>> 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
>>>>
>>>
>>> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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
>
> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

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

Date2016-01-29 13:09
FromPeter Burgess
SubjectRe: Dam opcode phazy (also includes an example from my app that I promised ages ago!)
Or a compress2 that works with 0dbfs to maintain backwards
compatibility of compress? Admittedly the compress opcode is one of
the only times I've ever had to think about decibels, so might just be
the opcode I hate rather than decibels

On Fri, Jan 29, 2016 at 12:51 PM, Anders Genell  wrote:
> Maybe an additional irate parameter to compress that allow the much more
> intuitive behaviour with negative db from 0dbfs reference?
> It could have a default behaviour like the current compress.
>
> Regards,
> Anders
>
> On Fri, Jan 29, 2016 at 1:33 PM, Oeyvind Brandtsegg
>  wrote:
>>
>> Hm, opinions may differ, but decibels are generally pretty handy for
>> managing sound levels. That said, it looks as if the compress opcode
>> has a nonstandard/old way of handling decibels. It states that 90dB
>> corresponds to an amplitude of 32768.
>> If might be more intuitive if it related to 0dbfs and used negative dB
>> scale.
>> Then, changing the behaviour of excisting opcodes is generally
>> discouraged due to backwards compatibility.
>>
>>
>> 2016-01-29 13:27 GMT+01:00 Peter Burgess :
>> > Or could be improved? ah? ah? Nudge nudge wink wink? :D
>> >
>> > I like the controls of dam way more than compress, I hate working with
>> > decibels. If it wasn't for the noise, I have dam set up perfectly for
>> > my master bus, and I find compress a nightmare to get right.
>> >
>> > On Fri, Jan 29, 2016 at 12:22 PM, Oeyvind Brandtsegg
>> >  wrote:
>> >> Oh. Should perhaps go into the deprecated list then?
>> >>
>> >> 2016-01-29 13:20 GMT+01:00 jpff :
>> >>> dam was originlly written as an example opcode on how toinclude a new
>> >>> opcode
>> >>> in the system -- way back.  I doubt that it has hd much use.
>> >>> ==John ff
>> >>>
>> >>>
>> >>> On Fri, 29 Jan 2016, Peter Burgess wrote:
>> >>>
>> >>>> Nice! That's not a bad idea. I'm gonna give compress a go first
>> >>>> though. I decided to go with dam first because it has less controls,
>> >>>> and I didn't need the sidechain function. However, I already have
>> >>>> compress on just my basses for the sidechain compression, and I
>> >>>> haven't noticed any distortion from that, so maybe compress will be a
>> >>>> better choice.
>> >>>>
>> >>>> On Fri, Jan 29, 2016 at 7:52 AM, Oeyvind Brandtsegg
>> >>>>  wrote:
>> >>>>>
>> >>>>> Nice!.
>> >>>>> I agree about the distortion/artifacts on the bass. Not sure about
>> >>>>> dam, never used it much. Did you try the compress opcode?
>> >>>>> Also, if you want more detailed control and easier artifact-finding,
>> >>>>> you could easily implement a compressor yourself, something along
>> >>>>> these lines:
>> >>>>>
>> >>>>> iamp = ampdbfs(p4) ; Amp in -dB
>> >>>>> kthresh = p5 ; compression threshold
>> >>>>> kratio = p6 ; compression ratio
>> >>>>> kattack = p7 ; attack time
>> >>>>> krelease = p8 ; release time
>> >>>>>
>> >>>>> arms follow2 a1, kattack/1000, krelease ; envelope follower
>> >>>>> karms downsamp arms ; workaround for dbfsamp (should take a-rate
>> >>>>> input)
>> >>>>> arms_dB = dbfsamp(karms) ; convert to dB scale
>> >>>>> aovershoot = arms_dB - kthresh ; how much over the threshold are we?
>> >>>>> atarget = kthresh + (aovershoot*(1/kratio)) ; target output level
>> >>>>> (with current input level, threshold and ratio)
>> >>>>> ampMod_dB =  atarget - arms_dB ; difference from target = adjust
>> >>>>> amount
>> >>>>> ampMod_dB limit ampMod_dB, -150, 0 ; do not adjust unless negative
>> >>>>> ampMod = ampdbfs(ampMod_dB) ; convert back to normalized scale
>> >>>>> acomp = a1*ampMod ; apply amplitude modification
>> >>>>>
>> >>>>> all best
>> >>>>> Oeyvind
>> >>>>>
>> >>>>> 2016-01-29 1:04 GMT+01:00 Peter Burgess
>> >>>>> :
>> >>>>>>
>> >>>>>> It does doesn't it! Thank you Hans Mikelson and Perry Cook :D
>> >>>>>>
>> >>>>>> 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
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>>
>> >>>>> Oeyvind Brandtsegg
>> >>>>> Professor of Music Technology
>> >>>>> NTNU
>> >>>>> 7491 Trondheim
>> >>>>> Norway
>> >>>>> Cell: +47 92 203 205
>> >>>>>
>> >>>>> http://www.partikkelaudio.com/
>> >>>>> http://soundcloud.com/brandtsegg
>> >>>>> http://flyndresang.no/
>> >>>>> http://soundcloud.com/t-emp
>> >>>>>
>> >>>>> 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
>> >>>>
>> >>>>
>> >>>> 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
>> >>>>
>> >>>
>> >>> 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
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Oeyvind Brandtsegg
>> >> Professor of Music Technology
>> >> NTNU
>> >> 7491 Trondheim
>> >> Norway
>> >> Cell: +47 92 203 205
>> >>
>> >> http://www.partikkelaudio.com/
>> >> http://soundcloud.com/brandtsegg
>> >> http://flyndresang.no/
>> >> http://soundcloud.com/t-emp
>> >>
>> >> 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
>> >
>> > 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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
>
>
> 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

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