No sound when plugin is hidden....
-
OK, so I think I have a pretty serious problem - unless I've made some silly mistake(always possible..).
I have a complied plugin that loads and works fine in a number of DAWS (FL Studio, Studio One, Reaper), it has a panel based timer that generates notes...
whilst the plugin interface is displayed all is good - but as soon as I hide the UI it stops working ... any one else getting this?
-
@Lindon Panel timers run in the UI thread. Can you use the Synth timer instead?
-
@Lindon I think it's normal behaviour that panel-based timers are stopped when hidden. If you generate audio stuff a timer I think you should use a timer object instead.
-
-
Yeah that fixed it -- a bit disappointed that I cant use the panel timer -- I sort of like its very slightly out-of-time timer -- but Im sure i will get over it...
-
@Lindon Did you go with the timer object or the synth timer?
-
myTimer = Engine.createTimerObject();
-
I sort of like its very slightly out-of-time timer
There you go:
function onTimer() { Synth.startTimer(average + Math.random() * funkyness); }
-
@Christoph-Hart - yes but then it plays strictly at this new defined time, so its a different time each time you start - but the panel based timer seems to drift a bit within itself, sure I could stop and start the timer within the call back - maybe I should just look at that...
-
@Lindon said in No sound when plugin is hidden....:
sure I could stop and start the timer within the call back
Yes, that's the idea, it's perfectly safe to restart the timer in its callback.