Csound Csound-dev Csound-tekno Search About

[Csnd] Clicking slider with Tkinter

Date2019-01-15 19:05
FromBeinan Li
Subject[Csnd] Clicking slider with Tkinter
Attachmentstonegen.csd  bug-slider-glitch.py  
Hello Csound,

Running Homebrew Csound version 6.10 (double samples) Dec 21 2017 on macOS Mojave.

I'm testing to control a Csound oscillator gain via an external Tkinter (Python 3.7)  slider.
I hear clicking when moving the slider however I tweak my ksmp and the slider resolution.
Given such a simple case, I don't believe it's a CPU issue.

I didn't use the bundled FLTK in order to decouple the frontend from the synth backend. In the past I didn't have glitches with those.

See the attached minimal code, please.

Repro:
  1. Run: python3 bug-slider-glitch.py
  2. Click the button "Go".
  3. Drag the slider back and forth around the rightmost end.
You should hear the clicking.
I'd appreciate tips. I hope I don't need to do things like interpolating slider output by hand ...



Thanks,
Beinan
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

Date2019-01-15 19:13
FromBeinan Li
SubjectRe: [Csnd] Clicking slider with Tkinter
The code uses OSC and has a dependency:

pip install python-osc


Thanks,
Beinan



On Tue, Jan 15, 2019 at 2:05 PM Beinan Li <li.beinan@gmail.com> wrote:
Hello Csound,

Running Homebrew Csound version 6.10 (double samples) Dec 21 2017 on macOS Mojave.

I'm testing to control a Csound oscillator gain via an external Tkinter (Python 3.7)  slider.
I hear clicking when moving the slider however I tweak my ksmp and the slider resolution.
Given such a simple case, I don't believe it's a CPU issue.

I didn't use the bundled FLTK in order to decouple the frontend from the synth backend. In the past I didn't have glitches with those.

See the attached minimal code, please.

Repro:
  1. Run: python3 bug-slider-glitch.py
  2. Click the button "Go".
  3. Drag the slider back and forth around the rightmost end.
You should hear the clicking.
I'd appreciate tips. I hope I don't need to do things like interpolating slider output by hand ...



Thanks,
Beinan
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

Date2019-01-16 09:21
FromRory Walsh
SubjectRe: [Csnd] Clicking slider with Tkinter
Have you tried smoothing the signal of the slider with a low-pass filter? 

a1 poscil ampdb(tonek(gkgaindb, 10)), gkfreq, 1

On Tue, 15 Jan 2019 at 19:14, Beinan Li <li.beinan@gmail.com> wrote:
The code uses OSC and has a dependency:

pip install python-osc


Thanks,
Beinan



On Tue, Jan 15, 2019 at 2:05 PM Beinan Li <li.beinan@gmail.com> wrote:
Hello Csound,

Running Homebrew Csound version 6.10 (double samples) Dec 21 2017 on macOS Mojave.

I'm testing to control a Csound oscillator gain via an external Tkinter (Python 3.7)  slider.
I hear clicking when moving the slider however I tweak my ksmp and the slider resolution.
Given such a simple case, I don't believe it's a CPU issue.

I didn't use the bundled FLTK in order to decouple the frontend from the synth backend. In the past I didn't have glitches with those.

See the attached minimal code, please.

Repro:
  1. Run: python3 bug-slider-glitch.py
  2. Click the button "Go".
  3. Drag the slider back and forth around the rightmost end.
You should hear the clicking.
I'd appreciate tips. I hope I don't need to do things like interpolating slider output by hand ...



Thanks,
Beinan
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

Date2019-01-16 09:46
FromRichard van Bemmelen
SubjectRe: [Csnd] Clicking slider with Tkinter
I have used sliders with succes with PySimpleGUI. This is based on tkinter, but much easier to use.
But I used ctcsound to start the csd and normal channels, not via OSC. It might be that the use of OSC is causing the glitches.
Have you tried it with direct channels?

Richard

Op di 15 jan. 2019 om 20:06 schreef Beinan Li <li.beinan@gmail.com>:
Hello Csound,

Running Homebrew Csound version 6.10 (double samples) Dec 21 2017 on macOS Mojave.

I'm testing to control a Csound oscillator gain via an external Tkinter (Python 3.7)  slider.
I hear clicking when moving the slider however I tweak my ksmp and the slider resolution.
Given such a simple case, I don't believe it's a CPU issue.

I didn't use the bundled FLTK in order to decouple the frontend from the synth backend. In the past I didn't have glitches with those.

See the attached minimal code, please.

Repro:
  1. Run: python3 bug-slider-glitch.py
  2. Click the button "Go".
  3. Drag the slider back and forth around the rightmost end.
You should hear the clicking.
I'd appreciate tips. I hope I don't need to do things like interpolating slider output by hand ...



Thanks,
Beinan
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

Date2019-01-16 16:25
FromBeinan Li
SubjectRe: [Csnd] Clicking slider with Tkinter
Thanks, Rory!

That works. Now I'll pay more attention to the k-rate opcodes for massaging non-audio input signals.

Cheers,
Beinan



On Wed, Jan 16, 2019 at 4:21 AM Rory Walsh <rorywalsh@ear.ie> wrote:
Have you tried smoothing the signal of the slider with a low-pass filter? 

a1 poscil ampdb(tonek(gkgaindb, 10)), gkfreq, 1

On Tue, 15 Jan 2019 at 19:14, Beinan Li <li.beinan@gmail.com> wrote:
The code uses OSC and has a dependency:

pip install python-osc


Thanks,
Beinan



On Tue, Jan 15, 2019 at 2:05 PM Beinan Li <li.beinan@gmail.com> wrote:
Hello Csound,

Running Homebrew Csound version 6.10 (double samples) Dec 21 2017 on macOS Mojave.

I'm testing to control a Csound oscillator gain via an external Tkinter (Python 3.7)  slider.
I hear clicking when moving the slider however I tweak my ksmp and the slider resolution.
Given such a simple case, I don't believe it's a CPU issue.

I didn't use the bundled FLTK in order to decouple the frontend from the synth backend. In the past I didn't have glitches with those.

See the attached minimal code, please.

Repro:
  1. Run: python3 bug-slider-glitch.py
  2. Click the button "Go".
  3. Drag the slider back and forth around the rightmost end.
You should hear the clicking.
I'd appreciate tips. I hope I don't need to do things like interpolating slider output by hand ...



Thanks,
Beinan
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

Date2019-01-16 16:32
FromBeinan Li
SubjectRe: [Csnd] Clicking slider with Tkinter
hmm, I doubt that it was OSC, because a for-loop ramping of the gain through OSC didn't click.
In fact, I tried to drag the slider more slowly, the clicking was reduced, too, so most probably a smoothing issue. 
Rory's LPF solution is short and sweet for this sake.

I loved PySimpleGUI btw, it has great potential, especially how much work the author puts into the doc, 
yet after a while I decided to wait and watch it grow for now.

Thanks,
Beinan



On Wed, Jan 16, 2019 at 4:52 AM Richard van Bemmelen <zappfinger@gmail.com> wrote:
I have used sliders with succes with PySimpleGUI. This is based on tkinter, but much easier to use.
But I used ctcsound to start the csd and normal channels, not via OSC. It might be that the use of OSC is causing the glitches.
Have you tried it with direct channels?

Richard

Op di 15 jan. 2019 om 20:06 schreef Beinan Li <li.beinan@gmail.com>:
Hello Csound,

Running Homebrew Csound version 6.10 (double samples) Dec 21 2017 on macOS Mojave.

I'm testing to control a Csound oscillator gain via an external Tkinter (Python 3.7)  slider.
I hear clicking when moving the slider however I tweak my ksmp and the slider resolution.
Given such a simple case, I don't believe it's a CPU issue.

I didn't use the bundled FLTK in order to decouple the frontend from the synth backend. In the past I didn't have glitches with those.

See the attached minimal code, please.

Repro:
  1. Run: python3 bug-slider-glitch.py
  2. Click the button "Go".
  3. Drag the slider back and forth around the rightmost end.
You should hear the clicking.
I'd appreciate tips. I hope I don't need to do things like interpolating slider output by hand ...



Thanks,
Beinan
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