From 8641a50071d4b7904243a3b0a948b7fb0c4967a7 Mon Sep 17 00:00:00 2001 From: Justin Johnson Date: Mon, 29 Nov 2021 15:10:36 +0000 Subject: [PATCH] fix: mouse_cap wasn't handing key presses properly without prior gfx_getchar() --- LICENSE | 21 +++++++++++++++++++++ ReEQ.jsfx | 43 +++++++++++++------------------------------ ReSpectrum.jsfx | 33 +++++---------------------------- spectrum.jsfx-inc | 25 +------------------------ svf_filter.jsfx-inc | 24 ------------------------ 5 files changed, 40 insertions(+), 106 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..48dbb25 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Justin Johnson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/ReEQ.jsfx b/ReEQ.jsfx index c0e5494..950585e 100644 --- a/ReEQ.jsfx +++ b/ReEQ.jsfx @@ -1,31 +1,8 @@ -desc: ReEQ -/* -ReEQ - A parametric graphic equalizer -Version: v1.1.2 <--- Make sure you change VERSION below if this changes!! - -The MIT License (MIT) - -Copyright (c) 2021 Justin Johnson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -*/ +desc: ReEQ - Parametric Graphic Equalizer +tags filters +version: 1.1.3 //<--- Make sure you change VERSION below if this changes!! +author: Justin Johnson +license: MIT slider1:Stereo_Mode=<0,1,1{Mid/Side,Left/Right}>-Stereo Mode slider2:Quality=1<0,1,1{Eco,HQ}>-Quality @@ -108,7 +85,7 @@ options:no_meter @init // This should be the same as in the comment header -#VERSION = "1.1.2"; +#VERSION = "1.1.3"; gfx_ext_retina = 1; ext_nodenorm = 1; @@ -420,6 +397,7 @@ function band_set_filter(t, f, g, qval, slope) type == 2 ? filter.svf_hpb(frequency, slope) : type == 3 ? filter.svf_ls(frequency, q, db_to_gain(gain)) : type == 4 ? filter.svf_hs(frequency, q, db_to_gain(gain)) : + //type == 5 ? filter.svf_lp(frequency, pow(2, gain/6), slope) : type == 5 ? filter.svf_lp(frequency, q, slope) : type == 6 ? filter.svf_lpb(frequency, slope) : type == 7 ? filter.svf_bs(frequency, q) : @@ -1614,6 +1592,11 @@ gfx_x = 100; gfx_y = 100; actual_width = gfx_w / gfx_ext_retina; actual_height = gfx_h / gfx_ext_retina; +// This is necessary! +// Without this, the mouse_caps don't register key presses until the +// mouse button is clicked. +gfx_getchar(); + // Calculage compact view flags // These are used to disable certain elements for graceful visual shrinking compact_width = actual_width < 600; @@ -4781,7 +4764,7 @@ do_general_mouse ? ( ); // Enable or disable listen mode - mouse_cap & 8 ? ( + mouse_cap & 8 && !box_region_drag_mode ? ( do_listen == 0 ? ( do_listen = 1; ); diff --git a/ReSpectrum.jsfx b/ReSpectrum.jsfx index 0b3e2cf..b927eaa 100644 --- a/ReSpectrum.jsfx +++ b/ReSpectrum.jsfx @@ -1,31 +1,8 @@ desc: ReSpectrum -/* -ReSpectrum - A spectrum analyzer -Version: v1.1.2 - -The MIT License (MIT) - -Copyright (c) 2021 Justin Johnson - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -*/ +tags filters +version: 1.1.3 //<--- Make sure you change VERSION below if this changes!! +author: Justin Johnson +license: MIT slider1:Spectrum_Mode=3<0,5,1{Full,Mid,Side,Mid / Side,Left,Right,Left / Right}>-Spectrum slider2:Display_Mode=0<0,2,1{Fill,Line,None}>-Display @@ -44,7 +21,7 @@ options:no_meter @init -#VERSION = "1.1.2"; +#VERSION = "1.1.3"; gfx_ext_retina = 1; ext_nodenorm = 1; diff --git a/spectrum.jsfx-inc b/spectrum.jsfx-inc index 9e5e5c8..4a416d5 100644 --- a/spectrum.jsfx-inc +++ b/spectrum.jsfx-inc @@ -1,30 +1,7 @@ desc: FFT Spectrum Analyzer /* Spectrum Analyzer Library - The MIT License (MIT) - - Copyright (c) 2021 Justin Johnson - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - - --- - + Reference: http://www.zytrax.com/tech/audio/calculator.html https://lists.gnu.org/archive/html/help-octave/2015-07/msg00016.html diff --git a/svf_filter.jsfx-inc b/svf_filter.jsfx-inc index b44c033..e3a0c1d 100644 --- a/svf_filter.jsfx-inc +++ b/svf_filter.jsfx-inc @@ -2,30 +2,6 @@ desc: State Variable Filter /* SVF - State Variable Filter - The MIT License (MIT) - - Copyright (c) 2021 Justin Johnson - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - - -------- - SVF filter math taken from Andy Simper's (Cytomic) SVF paper. https://cytomic.com/files/dsp/SvfLinearTrapOptimised2.pdf