|
Post by KlangManipulation on Nov 18, 2018 1:39:08 GMT 1
Hi, i hope someone can help me. i need a properly working "64bit - monostable with retrigger" like the "sc-monostable" i think i got it now but i dont understand how to do the sleep mode. i tried a lot variations but i cant get it. i uploaded the sdk3 sourcecode so someone can take a look. www.mediafire.com/file/1oax55o2x05er7k/KM_Monostable.zip/file
|
|
|
Post by Rob on Dec 7, 2018 13:42:58 GMT 1
Have you tried this:
// If either input is active, output will be active. ( "||" means "or" ). bool OutputIsActive = pinInput.isStreaming();
// Exception... // If input zero, output is silent. Think not needed for Monostable? // if (!pinInput.isStreaming() && pinInput == 0.0f) OutputIsActive = false;
// Transmit new output state to modules 'downstream'. pinOutput.setStreaming(OutputIsActive);
// Set processing method. SET_PROCESS(&Km_monostable::subProcess);
// control sleep mode manually. setSleep(!OutputIsActive);
|
|
Andrew
Developer
Posts: 110
Posts: 110
|
Post by Andrew on Dec 7, 2018 16:28:39 GMT 1
I don't know if it is the most effecient way to do it but sleep it like a filter - check the "FilterOnePoleLp" example in the SDK. Not gonna write it all here, but basically once input.isStreaming == false, start monitoring the *output*, in the example it is called WaitUntilSettled, once your countdown is done i.e. output == 0.0f, fill the rest of the buffer and go to sleep. P.S. be careful calling clock() without CLOCKS_PER_SEC, the resolution of clock is undefined. www.cplusplus.com/reference/ctime/clock/Also, if you intend to use it polyphonically you might need to use hostConnect="Voice/Active" to reset the module, in case SE suspends a voice while the trigger is high.
|
|
|
Post by KlangManipulation on Dec 10, 2018 18:42:12 GMT 1
thx, i will give it a new try 
|
|