Csound Csound-dev Csound-tekno Search About

[Csnd] control-signal change based on other control-signal (no switch/trigger)

Date2018-10-04 18:42
From"Jeanette C."
Subject[Csnd] control-signal change based on other control-signal (no switch/trigger)
Hey hey,
I have the following challenge, to which I haven't found an elegant solution 
yet. Perhaps you know one?

I have a moving signal (ksrc) and when the signal reaches a certain value a 
momentary dip or permanent change needs to be applied to another signal kdest. 
Since I discovered that control signals might just pass through an exact value 
that I like a proximity would better do. :) So:
if ksrc approx changevalue
   apply change to kdest
endif

A dip can be created with line/expon, I guess, so I'd rather start the change 
in time before the event. So:
if (ksrc + delta) approx changevalue

Is there something clever/simple to be done about it?

Best wishes,

jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * GitHub: https://github.com/jeanette-c
  * Twitter: https://twitter.com/jeanette_c_s

Don't, don't let me be the last to know
Don't hold back, just let it go <3
(Britney Spears)

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

Date2018-10-05 00:41
Fromthorin kerr
SubjectRe: [Csnd] control-signal change based on other control-signal (no switch/trigger)
Not sure I completely understand the scenario...

Is this the idea?

if ((ksrc < (khello + ktolerate)) && (ksrc > (khello - ktolerate))) then
    kdest = kdest - 1/kr ; or whatever dipping code you need

Thorin

On Fri, 5 Oct. 2018, 3:42 am Jeanette C., <julien@mail.upb.de> wrote:
Hey hey,
I have the following challenge, to which I haven't found an elegant solution
yet. Perhaps you know one?

I have a moving signal (ksrc) and when the signal reaches a certain value a
momentary dip or permanent change needs to be applied to another signal kdest.
Since I discovered that control signals might just pass through an exact value
that I like a proximity would better do. :) So:
if ksrc approx changevalue
   apply change to kdest
endif

A dip can be created with line/expon, I guess, so I'd rather start the change
in time before the event. So:
if (ksrc + delta) approx changevalue

Is there something clever/simple to be done about it?

Best wishes,

jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * GitHub: https://github.com/jeanette-c
  * Twitter: https://twitter.com/jeanette_c_s

Don't, don't let me be the last to know
Don't hold back, just let it go <3
(Britney Spears)

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

Date2018-10-05 08:49
Fromjoachim heintz
SubjectRe: [Csnd] control-signal change based on other control-signal (no switch/trigger)
the problem might be that in this +/- ktolerate range you probably get 
more than one k-cycle where it becomes true.

if the ksrc signal is not jumping, and it is not about "reaching" but 
"crossing" a line (or threshold), i would compare the ksrc in this 
k-cycle with the previous one, for instance:

instr SignalSensor
  kSig poscil 1, 1
  kPrevSig init 0
  if kSig >= 0.9 && kPrevSig < 0.9 then
   event "i", "Pling", 0, 1
  endif
  kPrevSig = kSig
endin
schedule "SignalSensor", 0, 5

instr Pling
aOut poscil transeg:a(.2,p3,-6,0), random:i(400,800)
out aOut, aOut
endin

	joachim



On 05/10/18 01:41, thorin kerr wrote:
> Not sure I completely understand the scenario...
>
> Is this the idea?
>
> if ((ksrc < (khello + ktolerate)) && (ksrc > (khello - ktolerate))) then
>     kdest = kdest - 1/kr ; or whatever dipping code you need
>
> Thorin
>
> On Fri, 5 Oct. 2018, 3:42 am Jeanette C.,  > wrote:
>
>     Hey hey,
>     I have the following challenge, to which I haven't found an elegant
>     solution
>     yet. Perhaps you know one?
>
>     I have a moving signal (ksrc) and when the signal reaches a certain
>     value a
>     momentary dip or permanent change needs to be applied to another
>     signal kdest.
>     Since I discovered that control signals might just pass through an
>     exact value
>     that I like a proximity would better do. :) So:
>     if ksrc approx changevalue
>        apply change to kdest
>     endif
>
>     A dip can be created with line/expon, I guess, so I'd rather start
>     the change
>     in time before the event. So:
>     if (ksrc + delta) approx changevalue
>
>     Is there something clever/simple to be done about it?
>
>     Best wishes,
>
>     jeanette
>
>     --
>       * Website: http://juliencoder.de - for summer is a state of sound
>       * SoundCloud: https://soundcloud.com/jeanette_c
>       * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>       * GitHub: https://github.com/jeanette-c
>       * Twitter: https://twitter.com/jeanette_c_s
>
>     Don't, don't let me be the last to know
>     Don't hold back, just let it go <3
>     (Britney Spears)
>
>     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

Date2018-10-05 09:01
From"Jeanette C."
SubjectRe: [Csnd] control-signal change based on other control-signal (no switch/trigger)
Hi Joachim and Thorin,
Oct 5 2018, joachim heintz has written:

> the problem might be that in this +/- ktolerate range you probably get more 
> than one k-cycle where it becomes true.
Alas yes.
>
> if the ksrc signal is not jumping, and it is not about "reaching" but 
> "crossing" a line (or threshold), i would compare the ksrc in this k-cycle 
> with the previous one, for instance:
...
That's what I've been doing, but it didn't look elegant. I thought I was
missing a clever point. It seems I'm stuck with it, if I want to do it
that way.

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * GitHub: https://github.com/jeanette-c
  * Twitter: https://twitter.com/jeanette_c_s

You should never try to change me
I can be nobody else
And I like the way I am <3
(Britney Spears)

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

Date2018-10-05 09:09
From"Jeanette C."
SubjectRe: [Csnd] control-signal change based on other control-signal (no switch/trigger)
Oct 5 2018, thorin kerr has written:
...
> if ((ksrc < (khello + ktolerate)) && (ksrc > (khello - ktolerate))) then
>    kdest = kdest - 1/kr ; or whatever dipping code you need
That isn't a good formula for triggering, but as one generally can't
easly estimate the signal points of ksrc, this brought up another idea:
kdelta = abs(khello - ksrc)
if kdelta < threshold
   kdest = kdelta * scale
That could also be:
   kdest = kdelta * (threshold - scale)
Still, a lot to do, but certainly two working starting points.

Thanks both of you again,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * GitHub: https://github.com/jeanette-c
  * Twitter: https://twitter.com/jeanette_c_s

You should never try to change me
I can be nobody else
And I like the way I am <3
(Britney Spears)

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

Date2018-10-05 09:17
FromVincent Michalke
SubjectRe: [Csnd] control-signal change based on other control-signal (no switch/trigger)
For this kind of mechanism:

kPrevSig init 0
  if kSig >= 0.9 && kPrevSig < 0.9 then
   event "i", "Pling", 0, 1
  endif
  kPrevSig = kSig

you can also use the opcode trigger  with kmode = 1

On Fri, Oct 5, 2018 at 9:49 AM joachim heintz <jh@joachimheintz.de> wrote:
the problem might be that in this +/- ktolerate range you probably get
more than one k-cycle where it becomes true.

if the ksrc signal is not jumping, and it is not about "reaching" but
"crossing" a line (or threshold), i would compare the ksrc in this
k-cycle with the previous one, for instance:

instr SignalSensor
  kSig poscil 1, 1
  kPrevSig init 0
  if kSig >= 0.9 && kPrevSig < 0.9 then
   event "i", "Pling", 0, 1
  endif
  kPrevSig = kSig
endin
schedule "SignalSensor", 0, 5

instr Pling
aOut poscil transeg:a(.2,p3,-6,0), random:i(400,800)
out aOut, aOut
endin

        joachim



On 05/10/18 01:41, thorin kerr wrote:
> Not sure I completely understand the scenario...
>
> Is this the idea?
>
> if ((ksrc < (khello + ktolerate)) && (ksrc > (khello - ktolerate))) then
>     kdest = kdest - 1/kr ; or whatever dipping code you need
>
> Thorin
>
> On Fri, 5 Oct. 2018, 3:42 am Jeanette C., <julien@mail.upb.de
> <mailto:julien@mail.upb.de>> wrote:
>
>     Hey hey,
>     I have the following challenge, to which I haven't found an elegant
>     solution
>     yet. Perhaps you know one?
>
>     I have a moving signal (ksrc) and when the signal reaches a certain
>     value a
>     momentary dip or permanent change needs to be applied to another
>     signal kdest.
>     Since I discovered that control signals might just pass through an
>     exact value
>     that I like a proximity would better do. :) So:
>     if ksrc approx changevalue
>        apply change to kdest
>     endif
>
>     A dip can be created with line/expon, I guess, so I'd rather start
>     the change
>     in time before the event. So:
>     if (ksrc + delta) approx changevalue
>
>     Is there something clever/simple to be done about it?
>
>     Best wishes,
>
>     jeanette
>
>     --
>       * Website: http://juliencoder.de - for summer is a state of sound
>       * SoundCloud: https://soundcloud.com/jeanette_c
>       * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>       * GitHub: https://github.com/jeanette-c
>       * Twitter: https://twitter.com/jeanette_c_s
>
>     Don't, don't let me be the last to know
>     Don't hold back, just let it go <3
>     (Britney Spears)
>
>     Csound mailing list
>     Csound@listserv.heanet.ie <mailto: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
> <mailto: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

Date2018-10-05 09:33
Fromjoachim heintz
SubjectRe: [Csnd] control-signal change based on other control-signal (no switch/trigger)
very nice, thanks!  actually i didn't know about trigger opcode ...

i think in this case it is kmode=0, but this doesn't matter.

so the code would be:
  kSig poscil 1, 1
  if trigger(kSig,.9,0)==1 then
   event "i", "Pling", 0, 1
  endif

cheers -
	joachim


On 05/10/18 10:17, Vincent Michalke wrote:
> For this kind of mechanism:
>
>     kPrevSig init 0
>       if kSig >= 0.9 && kPrevSig < 0.9 then
>        event "i", "Pling", 0, 1
>       endif
>       kPrevSig = kSig
>
>
> you can also use the opcode /trigger/  with kmode = 1
>
> On Fri, Oct 5, 2018 at 9:49 AM joachim heintz  > wrote:
>
>     the problem might be that in this +/- ktolerate range you probably get
>     more than one k-cycle where it becomes true.
>
>     if the ksrc signal is not jumping, and it is not about "reaching" but
>     "crossing" a line (or threshold), i would compare the ksrc in this
>     k-cycle with the previous one, for instance:
>
>     instr SignalSensor
>       kSig poscil 1, 1
>       kPrevSig init 0
>       if kSig >= 0.9 && kPrevSig < 0.9 then
>        event "i", "Pling", 0, 1
>       endif
>       kPrevSig = kSig
>     endin
>     schedule "SignalSensor", 0, 5
>
>     instr Pling
>     aOut poscil transeg:a(.2,p3,-6,0), random:i(400,800)
>     out aOut, aOut
>     endin
>
>             joachim
>
>
>
>     On 05/10/18 01:41, thorin kerr wrote:
>     > Not sure I completely understand the scenario...
>     >
>     > Is this the idea?
>     >
>     > if ((ksrc < (khello + ktolerate)) && (ksrc > (khello -
>     ktolerate))) then
>     >     kdest = kdest - 1/kr ; or whatever dipping code you need
>     >
>     > Thorin
>     >
>     > On Fri, 5 Oct. 2018, 3:42 am Jeanette C.,      
>     > >> wrote:
>     >
>     >     Hey hey,
>     >     I have the following challenge, to which I haven't found an
>     elegant
>     >     solution
>     >     yet. Perhaps you know one?
>     >
>     >     I have a moving signal (ksrc) and when the signal reaches a
>     certain
>     >     value a
>     >     momentary dip or permanent change needs to be applied to another
>     >     signal kdest.
>     >     Since I discovered that control signals might just pass through an
>     >     exact value
>     >     that I like a proximity would better do. :) So:
>     >     if ksrc approx changevalue
>     >        apply change to kdest
>     >     endif
>     >
>     >     A dip can be created with line/expon, I guess, so I'd rather start
>     >     the change
>     >     in time before the event. So:
>     >     if (ksrc + delta) approx changevalue
>     >
>     >     Is there something clever/simple to be done about it?
>     >
>     >     Best wishes,
>     >
>     >     jeanette
>     >
>     >     --
>     >       * Website: http://juliencoder.de - for summer is a state of
>     sound
>     >       * SoundCloud: https://soundcloud.com/jeanette_c
>     >       * Youtube:
>     https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>     >       * GitHub: https://github.com/jeanette-c
>     >       * Twitter: https://twitter.com/jeanette_c_s
>     >
>     >     Don't, don't let me be the last to know
>     >     Don't hold back, just let it go <3
>     >     (Britney Spears)
>     >
>     >     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
>
> 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

Date2018-10-05 09:35
Fromjoachim heintz
SubjectRe: [Csnd] control-signal change based on other control-signal (no switch/trigger)
hi jeanette -

i have to disagree here.  this code is *very* elegant =)

best -
	joachim



On 05/10/18 10:01, Jeanette C. wrote:
> Hi Joachim and Thorin,
> Oct 5 2018, joachim heintz has written:
>
>> the problem might be that in this +/- ktolerate range you probably get
>> more than one k-cycle where it becomes true.
> Alas yes.
>>
>> if the ksrc signal is not jumping, and it is not about "reaching" but
>> "crossing" a line (or threshold), i would compare the ksrc in this
>> k-cycle with the previous one, for instance:
> ...
> That's what I've been doing, but it didn't look elegant. I thought I was
> missing a clever point. It seems I'm stuck with it, if I want to do it
> that way.
>
> Best wishes,
>
> Jeanette
>

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

Date2018-10-05 09:39
From"Jeanette C."
SubjectRe: [Csnd] control-signal change based on other control-signal (no switch/trigger)
Oct 5 2018, joachim heintz has written:

> hi jeanette -
>
> i have to disagree here.  this code is *very* elegant =)
Seeing that it's you, there's nothing but to bow to the master. You've written 
some very nice code.
>
> best -
> 	joachim
>
>
>
> On 05/10/18 10:01, Jeanette C. wrote:
>> Hi Joachim and Thorin,
>> Oct 5 2018, joachim heintz has written:
>> 
>>> the problem might be that in this +/- ktolerate range you probably get
>>> more than one k-cycle where it becomes true.
>> Alas yes.
>>> 
>>> if the ksrc signal is not jumping, and it is not about "reaching" but
>>> "crossing" a line (or threshold), i would compare the ksrc in this
>>> k-cycle with the previous one, for instance:
>> ...
>> That's what I've been doing, but it didn't look elegant. I thought I was
>> missing a clever point. It seems I'm stuck with it, if I want to do it
>> that way.
>> 
>> Best wishes,
>> 
>> Jeanette
>> 
>
> 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
>

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * GitHub: https://github.com/jeanette-c
  * Twitter: https://twitter.com/jeanette_c_s

You should never try to change me
I can be nobody else
And I like the way I am <3
(Britney Spears)

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

Date2018-10-05 09:45
Fromjoachim heintz
SubjectRe: [Csnd] control-signal change based on other control-signal (no switch/trigger)
thanks very much for your honest compliments =)



On 05/10/18 10:39, Jeanette C. wrote:
> Oct 5 2018, joachim heintz has written:
>
>> hi jeanette -
>>
>> i have to disagree here.  this code is *very* elegant =)
> Seeing that it's you, there's nothing but to bow to the master. You've
> written some very nice code.
>>
>> best -
>>     joachim
>>
>>
>>
>> On 05/10/18 10:01, Jeanette C. wrote:
>>> Hi Joachim and Thorin,
>>> Oct 5 2018, joachim heintz has written:
>>>
>>>> the problem might be that in this +/- ktolerate range you probably get
>>>> more than one k-cycle where it becomes true.
>>> Alas yes.
>>>>
>>>> if the ksrc signal is not jumping, and it is not about "reaching" but
>>>> "crossing" a line (or threshold), i would compare the ksrc in this
>>>> k-cycle with the previous one, for instance:
>>> ...
>>> That's what I've been doing, but it didn't look elegant. I thought I was
>>> missing a clever point. It seems I'm stuck with it, if I want to do it
>>> that way.
>>>
>>> Best wishes,
>>>
>>> Jeanette
>>>
>>
>> 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