Skip to content

Commit

Permalink
fix eel compilation and improve blurry
Browse files Browse the repository at this point in the history
  • Loading branch information
micsthepick committed Feb 29, 2024
1 parent 6e0c4f9 commit 902d3a3
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 96 deletions.
26 changes: 11 additions & 15 deletions vocalrediso.eel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -33,10 +33,10 @@ out_pin:right output



//IFTEST /*
///IFTEST*
@init
//IFTEST */
//IFJSFX /*
//IFTEST*/
///IFJSFX*
slider1=0;
slider2=0;
slider3=0;
Expand All @@ -49,7 +49,7 @@ slider9=0;
slider10=1;
slider11=1;
slider12=0;
//IFJSFX */
//IFJSFX*/

//IFTEST srate = 24000;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.

Expand Down
26 changes: 11 additions & 15 deletions vocalrediso.jsfx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -33,10 +33,10 @@ out_pin:right output



//IFTEST /*
///IFTEST*
@init
//IFTEST */
/*
//IFTEST*/
/*
slider1=0;
slider2=0;
slider3=0;
Expand All @@ -49,7 +49,7 @@ slider9=0;
slider10=1;
slider11=1;
slider12=0;
*/
*/

//IFTEST srate = 24000;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.

Expand Down
26 changes: 11 additions & 15 deletions vocalrediso.jsfx-template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -33,10 +33,10 @@ out_pin:right output



//IFTEST /*
///IFTEST*
@init
//IFTEST */
//IFJSFX /*
//IFTEST*/
///IFJSFX*
slider1=0;
slider2=0;
slider3=0;
Expand All @@ -49,7 +49,7 @@ slider9=0;
slider10=1;
slider11=1;
slider12=0;
//IFJSFX */
//IFJSFX*/

//IFTEST srate = 24000;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.

Expand Down
39 changes: 22 additions & 17 deletions vocalredisoBlurry.eel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -34,10 +35,10 @@ out_pin:right output



//IFTEST /*
///IFTEST*
@init
//IFTEST */
//IFJSFX /*
//IFTEST*/
///IFJSFX*
slider1=0;
slider2=0;
slider3=0;
Expand All @@ -51,7 +52,8 @@ slider10=1;
slider11=1;
slider12=0;
slider13=0;
//IFJSFX */
slider14=0;
//IFJSFX*/

//IFTEST srate = 24000;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.

Expand Down
Loading

0 comments on commit 902d3a3

Please # to comment.