From 902d3a343280f74e81860151a71a4fab129e02cb Mon Sep 17 00:00:00 2001 From: micsthepick <11528421+micsthepick@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:13:54 +1100 Subject: [PATCH] fix eel compilation and improve blurry --- vocalrediso.eel | 26 ++++++++++------------ vocalrediso.jsfx | 26 ++++++++++------------ vocalrediso.jsfx-template | 26 ++++++++++------------ vocalredisoBlurry.eel | 39 +++++++++++++++++++-------------- vocalredisoBlurry.jsfx | 39 +++++++++++++++++++-------------- vocalredisoBlurry.jsfx-template | 39 +++++++++++++++++++-------------- 6 files changed, 99 insertions(+), 96 deletions(-) diff --git a/vocalrediso.eel b/vocalrediso.eel index ccd3ffd..69556b4 100644 --- a/vocalrediso.eel +++ b/vocalrediso.eel @@ -4,7 +4,7 @@ // which was used as a starting point for this script // which now uses the STFT template code by geraintluff: https://forum.cockos.com/showthread.php?t=225955 -//IFTEST /* //this section not used by testing code +///IFTEST* //this section not used by testing code desc: vocal removal/isolation //tags: processing vocals stereo //author: Michael Pannekoek @@ -22,7 +22,7 @@ slider9:0<-5,5,0.001>Phase width at High Cut slider10:1<0,1,0.05>Attenuate if different volume slider11:1<0,1,1{No,Yes}>undo input corrections slider12:0<-180,180,0.05>Phase2 (Degrees) -//IFTEST */ //this section not used by testing code +//IFTEST*/ //this section not used by testing code /*IFJSFX{ in_pin:left input @@ -33,10 +33,10 @@ out_pin:right output -//IFTEST /* +///IFTEST* @init -//IFTEST */ -//IFJSFX /* +//IFTEST*/ +///IFJSFX* slider1=0; slider2=0; slider3=0; @@ -49,7 +49,7 @@ slider9=0; slider10=1; slider11=1; slider12=0; -//IFJSFX */ +//IFJSFX*/ //IFTEST srate = 24000; @@ -265,9 +265,9 @@ loop(fft_size/2+1, ); //IFTEST ); // slider_code() ( -//IFTEST /* +///IFTEST* @sample -//IFTEST */ +//IFTEST*/ //IFTEST function sample_code() ( input_buffer[buffer_index*2] = spl0; input_buffer[buffer_index*2 + 1] = spl1; @@ -333,15 +333,11 @@ buffer_index = (buffer_index + 1)%buffer_length; /*IFJSFX{ @serialize }IFJSFX*/ - /* -//IFJSFX /* -function file_var(file, val) ( - printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val) -); -//IFJSFX */ +//IFTEST function file_var(file, val) (printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val)); +/* serial_version = 1.00; file_var(0, serial_version); - */ +*/ // nothing serialized yet, but keep track of the serial_version // for the preset state of the original plugin, serial_version would now be euqal to 0. diff --git a/vocalrediso.jsfx b/vocalrediso.jsfx index ab619a6..eaef9ee 100644 --- a/vocalrediso.jsfx +++ b/vocalrediso.jsfx @@ -4,7 +4,7 @@ // which was used as a starting point for this script // which now uses the STFT template code by geraintluff: https://forum.cockos.com/showthread.php?t=225955 -//IFTEST /* //this section not used by testing code +///IFTEST* //this section not used by testing code desc: vocal removal/isolation //tags: processing vocals stereo //author: Michael Pannekoek @@ -22,7 +22,7 @@ slider9:0<-5,5,0.001>Phase width at High Cut slider10:1<0,1,0.05>Attenuate if different volume slider11:1<0,1,1{No,Yes}>undo input corrections slider12:0<-180,180,0.05>Phase2 (Degrees) -//IFTEST */ //this section not used by testing code +//IFTEST*/ //this section not used by testing code in_pin:left input @@ -33,10 +33,10 @@ out_pin:right output -//IFTEST /* +///IFTEST* @init -//IFTEST */ - /* +//IFTEST*/ +/* slider1=0; slider2=0; slider3=0; @@ -49,7 +49,7 @@ slider9=0; slider10=1; slider11=1; slider12=0; - */ +*/ //IFTEST srate = 24000; @@ -265,9 +265,9 @@ loop(fft_size/2+1, ); //IFTEST ); // slider_code() ( -//IFTEST /* +///IFTEST* @sample -//IFTEST */ +//IFTEST*/ //IFTEST function sample_code() ( input_buffer[buffer_index*2] = spl0; input_buffer[buffer_index*2 + 1] = spl1; @@ -333,15 +333,11 @@ buffer_index = (buffer_index + 1)%buffer_length; @serialize -//IFEEL /* - /* -function file_var(file, val) ( - printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val) -); - */ +//IFTEST function file_var(file, val) (printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val)); +///IFEEL* serial_version = 1.00; file_var(0, serial_version); -//IFEEL */ +//IFEEL*/ // nothing serialized yet, but keep track of the serial_version // for the preset state of the original plugin, serial_version would now be euqal to 0. diff --git a/vocalrediso.jsfx-template b/vocalrediso.jsfx-template index 5d32519..f305dd8 100644 --- a/vocalrediso.jsfx-template +++ b/vocalrediso.jsfx-template @@ -4,7 +4,7 @@ // which was used as a starting point for this script // which now uses the STFT template code by geraintluff: https://forum.cockos.com/showthread.php?t=225955 -//IFTEST /* //this section not used by testing code +///IFTEST* //this section not used by testing code desc: vocal removal/isolation //tags: processing vocals stereo //author: Michael Pannekoek @@ -22,7 +22,7 @@ slider9:0<-5,5,0.001>Phase width at High Cut slider10:1<0,1,0.05>Attenuate if different volume slider11:1<0,1,1{No,Yes}>undo input corrections slider12:0<-180,180,0.05>Phase2 (Degrees) -//IFTEST */ //this section not used by testing code +//IFTEST*/ //this section not used by testing code /*IFJSFX{ in_pin:left input @@ -33,10 +33,10 @@ out_pin:right output -//IFTEST /* +///IFTEST* @init -//IFTEST */ -//IFJSFX /* +//IFTEST*/ +///IFJSFX* slider1=0; slider2=0; slider3=0; @@ -49,7 +49,7 @@ slider9=0; slider10=1; slider11=1; slider12=0; -//IFJSFX */ +//IFJSFX*/ //IFTEST srate = 24000; @@ -265,9 +265,9 @@ loop(fft_size/2+1, ); //IFTEST ); // slider_code() ( -//IFTEST /* +///IFTEST* @sample -//IFTEST */ +//IFTEST*/ //IFTEST function sample_code() ( input_buffer[buffer_index*2] = spl0; input_buffer[buffer_index*2 + 1] = spl1; @@ -333,15 +333,11 @@ buffer_index = (buffer_index + 1)%buffer_length; /*IFJSFX{ @serialize }IFJSFX*/ -//IFEEL /* -//IFJSFX /* -function file_var(file, val) ( - printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val) -); -//IFJSFX */ +//IFTEST function file_var(file, val) (printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val)); +///IFEEL* serial_version = 1.00; file_var(0, serial_version); -//IFEEL */ +//IFEEL*/ // nothing serialized yet, but keep track of the serial_version // for the preset state of the original plugin, serial_version would now be euqal to 0. diff --git a/vocalredisoBlurry.eel b/vocalredisoBlurry.eel index 8be84e1..2547156 100644 --- a/vocalredisoBlurry.eel +++ b/vocalredisoBlurry.eel @@ -4,7 +4,7 @@ // which was used as a starting point for this script // which now uses the STFT template code by geraintluff: https://forum.cockos.com/showthread.php?t=225955 -//IFTEST /* //this section not used by testing code +///IFTEST* //this section not used by testing code desc: vocal removal/isolation //tags: processing vocals stereo //author: Michael Pannekoek @@ -23,7 +23,8 @@ slider10:1<0,1,0.05>Attenuate if different volume slider11:1<0,1,1{No,Yes}>undo input corrections slider12:0<-180,180,0.05>Phase2 (Degrees) slider13:0<0,10,0.1>Blurring factor -//IFTEST */ //this section not used by testing code +slider14:0<0,2,1{Max,Min,Avg}>Blurring aggregate +//IFTEST*/ //this section not used by testing code /*IFJSFX{ in_pin:left input @@ -34,10 +35,10 @@ out_pin:right output -//IFTEST /* +///IFTEST* @init -//IFTEST */ -//IFJSFX /* +//IFTEST*/ +///IFJSFX* slider1=0; slider2=0; slider3=0; @@ -51,7 +52,8 @@ slider10=1; slider11=1; slider12=0; slider13=0; -//IFJSFX */ +slider14=0; +//IFJSFX*/ //IFTEST srate = 24000; @@ -156,15 +158,22 @@ function process_stft_segment(fft_buffer, fft_size) local(fft_bin, left_real, le // find out how much to blur by in this blur_amount = (slider13*log(1+fft_bin))~0; attenuation_factor = 0; + slider14 == 1 ? attenuation_factor = 1; index = max(0, fft_bin-blur_amount); max+index = min(fft_size/2-1, fft_bin+blur_amount); elems = max+index - index + 1; loop(elems, - attenuation_factor += blurring_buffer[index]; + slider14 == 0 ? + attenuation_factor = max(attenuation_factor, blurring_buffer[index]) + : slider14 == 1 ? + attenuation_factor = min(attenuation_factor, blurring_buffer[index]) + : slider14 == 2 ? + attenuation_factor += blurring_buffer[index]; ); - weight = attenuation_factor / elems; + weight = attenuation_factor; + slider14 == 2 ? weight /= elems; // apply weight to c channel c_real *= weight; @@ -304,9 +313,9 @@ loop(fft_size/2+1, ); //IFTEST ); // slider_code() ( -//IFTEST /* +///IFTEST* @sample -//IFTEST */ +//IFTEST*/ //IFTEST function sample_code() ( input_buffer[buffer_index*2] = spl0; input_buffer[buffer_index*2 + 1] = spl1; @@ -372,15 +381,11 @@ buffer_index = (buffer_index + 1)%buffer_length; /*IFJSFX{ @serialize }IFJSFX*/ - /* -//IFJSFX /* -function file_var(file, val) ( - printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val) -); -//IFJSFX */ +//IFTEST function file_var(file, val) (printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val)); +/* serial_version = 1.00; file_var(0, serial_version); - */ +*/ // nothing serialized yet, but keep track of the serial_version // for the preset state of the original plugin, serial_version would now be euqal to 0. diff --git a/vocalredisoBlurry.jsfx b/vocalredisoBlurry.jsfx index 33a31b4..9a62a45 100644 --- a/vocalredisoBlurry.jsfx +++ b/vocalredisoBlurry.jsfx @@ -4,7 +4,7 @@ // which was used as a starting point for this script // which now uses the STFT template code by geraintluff: https://forum.cockos.com/showthread.php?t=225955 -//IFTEST /* //this section not used by testing code +///IFTEST* //this section not used by testing code desc: vocal removal/isolation //tags: processing vocals stereo //author: Michael Pannekoek @@ -23,7 +23,8 @@ slider10:1<0,1,0.05>Attenuate if different volume slider11:1<0,1,1{No,Yes}>undo input corrections slider12:0<-180,180,0.05>Phase2 (Degrees) slider13:0<0,10,0.1>Blurring factor -//IFTEST */ //this section not used by testing code +slider14:0<0,2,1{Max,Min,Avg}>Blurring aggregate +//IFTEST*/ //this section not used by testing code in_pin:left input @@ -34,10 +35,10 @@ out_pin:right output -//IFTEST /* +///IFTEST* @init -//IFTEST */ - /* +//IFTEST*/ +/* slider1=0; slider2=0; slider3=0; @@ -51,7 +52,8 @@ slider10=1; slider11=1; slider12=0; slider13=0; - */ +slider14=0; +*/ //IFTEST srate = 24000; @@ -156,15 +158,22 @@ function process_stft_segment(fft_buffer, fft_size) local(fft_bin, left_real, le // find out how much to blur by in this blur_amount = (slider13*log(1+fft_bin))~0; attenuation_factor = 0; + slider14 == 1 ? attenuation_factor = 1; index = max(0, fft_bin-blur_amount); max+index = min(fft_size/2-1, fft_bin+blur_amount); elems = max+index - index + 1; loop(elems, - attenuation_factor += blurring_buffer[index]; + slider14 == 0 ? + attenuation_factor = max(attenuation_factor, blurring_buffer[index]) + : slider14 == 1 ? + attenuation_factor = min(attenuation_factor, blurring_buffer[index]) + : slider14 == 2 ? + attenuation_factor += blurring_buffer[index]; ); - weight = attenuation_factor / elems; + weight = attenuation_factor; + slider14 == 2 ? weight /= elems; // apply weight to c channel c_real *= weight; @@ -304,9 +313,9 @@ loop(fft_size/2+1, ); //IFTEST ); // slider_code() ( -//IFTEST /* +///IFTEST* @sample -//IFTEST */ +//IFTEST*/ //IFTEST function sample_code() ( input_buffer[buffer_index*2] = spl0; input_buffer[buffer_index*2 + 1] = spl1; @@ -372,15 +381,11 @@ buffer_index = (buffer_index + 1)%buffer_length; @serialize -//IFEEL /* - /* -function file_var(file, val) ( - printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val) -); - */ +//IFTEST function file_var(file, val) (printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val)); +///IFEEL* serial_version = 1.00; file_var(0, serial_version); -//IFEEL */ +//IFEEL*/ // nothing serialized yet, but keep track of the serial_version // for the preset state of the original plugin, serial_version would now be euqal to 0. diff --git a/vocalredisoBlurry.jsfx-template b/vocalredisoBlurry.jsfx-template index 35aded3..c325f2b 100644 --- a/vocalredisoBlurry.jsfx-template +++ b/vocalredisoBlurry.jsfx-template @@ -4,7 +4,7 @@ // which was used as a starting point for this script // which now uses the STFT template code by geraintluff: https://forum.cockos.com/showthread.php?t=225955 -//IFTEST /* //this section not used by testing code +///IFTEST* //this section not used by testing code desc: vocal removal/isolation //tags: processing vocals stereo //author: Michael Pannekoek @@ -23,7 +23,8 @@ slider10:1<0,1,0.05>Attenuate if different volume slider11:1<0,1,1{No,Yes}>undo input corrections slider12:0<-180,180,0.05>Phase2 (Degrees) slider13:0<0,10,0.1>Blurring factor -//IFTEST */ //this section not used by testing code +slider14:0<0,2,1{Max,Min,Avg}>Blurring aggregate +//IFTEST*/ //this section not used by testing code /*IFJSFX{ in_pin:left input @@ -34,10 +35,10 @@ out_pin:right output -//IFTEST /* +///IFTEST* @init -//IFTEST */ -//IFJSFX /* +//IFTEST*/ +///IFJSFX* slider1=0; slider2=0; slider3=0; @@ -51,7 +52,8 @@ slider10=1; slider11=1; slider12=0; slider13=0; -//IFJSFX */ +slider14=0; +//IFJSFX*/ //IFTEST srate = 24000; @@ -156,15 +158,22 @@ function process_stft_segment(fft_buffer, fft_size) local(fft_bin, left_real, le // find out how much to blur by in this blur_amount = (slider13*log(1+fft_bin))~0; attenuation_factor = 0; + slider14 == 1 ? attenuation_factor = 1; index = max(0, fft_bin-blur_amount); max+index = min(fft_size/2-1, fft_bin+blur_amount); elems = max+index - index + 1; loop(elems, - attenuation_factor += blurring_buffer[index]; + slider14 == 0 ? + attenuation_factor = max(attenuation_factor, blurring_buffer[index]) + : slider14 == 1 ? + attenuation_factor = min(attenuation_factor, blurring_buffer[index]) + : slider14 == 2 ? + attenuation_factor += blurring_buffer[index]; ); - weight = attenuation_factor / elems; + weight = attenuation_factor; + slider14 == 2 ? weight /= elems; // apply weight to c channel c_real *= weight; @@ -304,9 +313,9 @@ loop(fft_size/2+1, ); //IFTEST ); // slider_code() ( -//IFTEST /* +///IFTEST* @sample -//IFTEST */ +//IFTEST*/ //IFTEST function sample_code() ( input_buffer[buffer_index*2] = spl0; input_buffer[buffer_index*2 + 1] = spl1; @@ -372,15 +381,11 @@ buffer_index = (buffer_index + 1)%buffer_length; /*IFJSFX{ @serialize }IFJSFX*/ -//IFEEL /* -//IFJSFX /* -function file_var(file, val) ( - printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val) -); -//IFJSFX */ +//IFTEST function file_var(file, val) (printf("FILE_VAR, FILE: %d, VAL: %g\n", file, val)); +///IFEEL* serial_version = 1.00; file_var(0, serial_version); -//IFEEL */ +//IFEEL*/ // nothing serialized yet, but keep track of the serial_version // for the preset state of the original plugin, serial_version would now be euqal to 0.