[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] disabling mouse tracking



I have done something simular in the past using Latch (sample and
hold), here's a modified example by Dan:

(
{
    var freq;
    freq = Latch.kr(MouseX.kr(100, 1000, 1), KeyState.kr(17));
    Pulse.ar(freq, 0.5, 0.02).dup;
}.play;
)

But also check the lag parameter for KeyState ugen (the default value
prevents typing too quickly)

2008/12/1 Dan Stowell <danstowell@xxxxxxxxx>:
> Try this:
>
> (
> x={
> var mx, toggle, freq;
> mx = MouseX.kr(100, 1000, 1);
> toggle = ToggleFF.kr(Trig1.kr(KeyState.kr(17), 0.001));
> freq = if(toggle <= 0, mx, 100);
> Pulse.ar(freq, 0.5, 0.02).dup;
> }.play
> )
>
>
> 2008/12/1 Uri Sala <urisala@xxxxxxxxx>:
>> Hi everybody,
>> I would like to be able to enable and disable mouse tracking just pressing
>> one key. For example: I have a synth with a SinOsc whose frequency is
>> controlled by MouseX.kr. I would like to be able to press 't' and that the
>> frequency stays wherever it is even if I move the mouse, then pressing 't'
>>  to enabling tracking again. Any ideas?
>> thx
>> Uri
>>
>> _______________________________________________
>> sc-users mailing list
>>
>> info (subscription, etc.):
>> http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
>> archive: https://listarc.bham.ac.uk/marchives/sc-users/
>> search: https://listarc.bham.ac.uk/lists/sc-users/search/
>>
>
>
>
> --
> http://www.mcld.co.uk
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-users/
> search: https://listarc.bham.ac.uk/lists/sc-users/search/
>

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/