[Csnd] Question about ctcsound and .performKsmps()
Date | 2021-01-23 20:06 |
From | Jason Hallen |
Subject | [Csnd] Question about ctcsound and .performKsmps() |
Hi everyone, I asked this on the Csound forum but didn't get any takers, so I thought I'd ask the question to the mailing list. I’m reading through Yi/Kaufman’s ctcsoundAPIExamples cookbook to try to wrap my head around the different ways to control Csound in Python. While I’ve had some success at using ctcsound, I’m still struggling to get a mental model of how elements like the Csound class, CsoundPerformanceThread class, .perform(), .performKsmps(), and the various methods of compilation and score insertion work together. while (c.performKsmps() == 0): Does this mean that Python is telling Csound to perform the next k-frame each time Python passes through the while loop? If so, how is the timing synchronized between Python’s while loop and the k-frames in Csound? I assume Python's while loop isn't running at exactly the same rate as the k-rate. Clearly, I don't have a good mental model of what's going on with .performKsmps(). Thanks for your help clarifying this! Jason |
Date | 2021-01-24 12:44 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] Question about ctcsound and .performKsmps() |
Hi Jason, As you suspected, calling performKsmps() asks Csound to perform one k-pass: setting k-rate variables and generating one audio vector of length ksmps. It is synchronized with Python, so that whenever you call performKsmps(), Python will wait until the k-pass has completed, and Csound then give control back to Python. All best Øyvind lør. 23. jan. 2021 kl. 21:17 skrev Jason Hallen <hallenj@gmail.com>:
|
Date | 2021-01-24 22:44 |
From | Jason Hallen |
Subject | Re: [Csnd] Question about ctcsound and .performKsmps() |
Thanks for the response, Øyvind! I'll keep this in mind as I continue working with ctcsound. Best, Jason On Sun, Jan 24, 2021 at 6:44 AM Oeyvind Brandtsegg <obrandts@gmail.com> wrote:
|