Open Apisov opened 5 years ago
Here is the code of dsp that crashes
declare options "[midi:on][nvoices:12]"; declare interface "SmartKeyboard{ 'Number of Keyboards':'2', 'Max Keyboard Polyphony':'12', 'Keyboard 0 - Number of Keys':'4', 'Keyboard 1 - Number of Keys':'4', 'Keyboard 0 - Lowest Key':'60', 'Keyboard 1 - Lowest Key':'67', 'Keyboard 0 - Scale':'2', 'Keyboard 1 - Scale':'2', 'Rounding Mode':'0' }"; import("stdfaust.lib"); freq = hslider("freq",440,50,1000,0.01); gain = an.amp_follower_ar(0.02,0.02); gate = button("gate") : en.adsr(0.01,0.01,0.9,0.1); timbre(f) = os.lf_saw(f/3)*0.5 + os.triangle(f+2)*0.25 + os.square(f+6)*0.125; process = gain*gate*timbre(freq)*0.5 <: _,_; effect = dm.zita_light;
If you change gain = an.amp_follower_ar(0.02,0.02); to hslider("gain",0.5,0,1,0.01); it work okay.
gain = an.amp_follower_ar(0.02,0.02);
hslider("gain",0.5,0,1,0.01);
Sometimes it crashes after granting permission to the microphone here: https://github.com/grame-cncm/faust/blob/8ae953a7630b362f059e6ae9223cc6c682f9e4f8/architecture/smartKeyboard/android/app/src/main/java/com/ccrma/faust/MainActivity.java#L109
But the main issue I have is over here: https://github.com/grame-cncm/faust/blob/8ae953a7630b362f059e6ae9223cc6c682f9e4f8/architecture/smartKeyboard/android/app/src/main/java/com/ccrma/faust/MultiKeyboard.java#L629
I don't know why but because of the an.amp_follower_ar it doesn't see dsp as polyphonic so it returns 0 here:
an.amp_follower_ar
0
/* * newVoice() * Instantiate a new voice and returns the corresponding mapUI. */ MapUI* newVoice() { if (fPolyDSP) { return fPolyDSP->newVoice(); } else { return 0; } }
I couldn't find any easy reason so I'm leaving for you all my notes and things that I've found.
Can you check if replacing declare options "[midi:on][nvoices:12]"; by declare voices "12" helps?
declare options "[midi:on][nvoices:12]";
declare voices "12"
Here is the code of dsp that crashes
If you change
gain = an.amp_follower_ar(0.02,0.02);
tohslider("gain",0.5,0,1,0.01);
it work okay.Sometimes it crashes after granting permission to the microphone here: https://github.com/grame-cncm/faust/blob/8ae953a7630b362f059e6ae9223cc6c682f9e4f8/architecture/smartKeyboard/android/app/src/main/java/com/ccrma/faust/MainActivity.java#L109
But the main issue I have is over here: https://github.com/grame-cncm/faust/blob/8ae953a7630b362f059e6ae9223cc6c682f9e4f8/architecture/smartKeyboard/android/app/src/main/java/com/ccrma/faust/MultiKeyboard.java#L629
I don't know why but because of the
an.amp_follower_ar
it doesn't see dsp as polyphonic so it returns0
here:I couldn't find any easy reason so I'm leaving for you all my notes and things that I've found.