Skip to content

Commit

Permalink
fix: mouse_cap wasn't handing key presses properly without prior gfx_…
Browse files Browse the repository at this point in the history
…getchar()
  • Loading branch information
Justin-Johnson committed Nov 29, 2021
1 parent 0d87365 commit 8641a50
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 106 deletions.
21 changes: 21 additions & 0 deletions 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.
43 changes: 13 additions & 30 deletions 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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) :
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
);
Expand Down
33 changes: 5 additions & 28 deletions 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
Expand All @@ -44,7 +21,7 @@ options:no_meter

@init

#VERSION = "1.1.2";
#VERSION = "1.1.3";

gfx_ext_retina = 1;
ext_nodenorm = 1;
Expand Down
25 changes: 1 addition & 24 deletions 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
Expand Down
24 changes: 0 additions & 24 deletions svf_filter.jsfx-inc
Expand Up @@ -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
Expand Down

0 comments on commit 8641a50

Please sign in to comment.