Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sample rate at initialization #83

Closed
pierreguillot opened this issue Jan 31, 2018 · 4 comments
Closed

sample rate at initialization #83

pierreguillot opened this issue Jan 31, 2018 · 4 comments

Comments

@pierreguillot
Copy link
Owner

The question was asked by @jdreske from #82.

By the way there are more objects that need a delay to wait for the plugin to initialize.
For example to get the samplerate i had to do this: [loadbang]->[delay 1000]->[samplerate~]->... (I didn't try how many milliseconds are necessary)

@pierreguillot
Copy link
Owner Author

The 1000ms ([delay 1000]) corresponds approximately to the time between the creation of the plugin and the starting of the DSP chain by the DAW. The sample rate is not defined at the startup because the DSP is not started in the DAW. But the most important is that the sample rate can change after the initialization so you should prefer to retrieve the sample rate when the DSP chain is compiled. What I use to do is to use a default sample rate at initialization (for example 44100hz) and to change the processing if the sample rate changes when the DSP chain is compiled. You can receive a notification that the DSP chain is compiled in Pd with

[receive pd]
|
[route dsp]
|
[sel 1]
|
[samplerate~]

If it's needed I can however compile the DSP chain of Pd with default values before the DAW start the DSP but I can't see the benefit as it will be re-compiled just after when the DAW starts the DSP.

@pierreguillot
Copy link
Owner Author

I guess it would be necessary to explain that in the documentation. And what are the other objects? Can you create other issues for them? Also if the explanation is good enough you can close this issue.

@jensdreske
Copy link

I don't know any other objects that ask the plugin for something.
Thanks for the great hint.

@pierreguillot
Copy link
Owner Author

FYI, now the DSP is initialized before loading the patch (v1.0.2). But it doesn't really change the problem neither.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants