![]() |
#1 |
Human being with feelings
Join Date: Mar 2019
Posts: 437
|
![]()
When using ext_noinit = 1.0, @init always seems to see srate to be 44100, regardless of the users samplerate, when the plugins are loaded. (Either inserted, or taken online)
Code:
@init ext_noinit = 1.0; a = srate; @sample b = srate; ![]() Hitting Full recompile/reset afterwards makes the plugin get the correct samplerate inside @init. |
![]() |
![]() |
![]() |
#2 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,223
|
![]()
If using ext_noinit, you should probably check for samplerate changes in @block or @slider (@slider will also get called in response to srate changes)
|
![]() |
![]() |
![]() |
#3 |
Human being with feelings
Join Date: Mar 2019
Posts: 437
|
![]()
To be clear, the first @init always gets the wrong samplerate when loading the plugin in this case, whether there was a samplerate change or not.
This means that every single JSFX plugin that uses ext_noinit and has some code for DSP initialization at @init based on srate, will sound different at any samplerate that is different than 44100 upon subsequent project loads. I think that is a bug? Edit: Ok, moving things to @block! Last edited by BirdBird; 01-07-2024 at 09:31 AM. |
![]() |
![]() |
![]() |
#4 | |
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,745
|
![]() Quote:
I guess it might a good idea to add this to the ext_noninit documentation. The documentation for srate already have some remark about not depending too much on @init, although IMO it's a bit cryptic, so it could be improved as well. |
|
![]() |
![]() |
![]() |
#5 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,223
|
![]()
Tale -- good point, docs updated.
BirdBird -- definitely better to check in @block or @slider, you'll catch samplerate changes initiated by the user or project, too. (@slider is guaranteed to be called after a samplerate change, so probably as safe as @block but a slightly more efficient place) Having said both of these things, we can make @init use the last-known samplerate rather than 44100... |
![]() |
![]() |
![]() |
#6 |
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,745
|
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
|
|