Skip to content

Commit

Permalink
Simplify cheating
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Aug 1, 2023
1 parent b758e9a commit a1bb918
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions content/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,25 +121,24 @@ def add_notch_filter(notch_filters, gap_filler):
notch_filters.children += (new_filter,)


def filter_cheat(global_values, cheat_sliders=True, cheat_notches=True):
def filter_cheat():
global_values = globals()
frequency_bin_upper_ends = global_values['frequency_bin_upper_ends']
sliders = global_values['equalizer_sliders']
notch_filters = global_values['notch_filter_list']
if cheat_sliders:
for f,s in zip(frequency_bin_upper_ends, sliders):
if f<63 or f>257:
s.value = -200.0
if cheat_notches:
notch_filters.children = tuple(
widgets.HBox(
[
widgets.FloatText(value=b, description="Begin", width="150px"),
widgets.FloatText(value=e, description="End", width="150px"),
widgets.Checkbox(description="Use this filter", value=True)
], layout={"justify_content": "space-around"}
)
for b,e in [(58.1, 60.5), (119.6, 120.1), (179.0, 181.2), (299., 304.), (331.4, 334.0)]
for f,s in zip(frequency_bin_upper_ends, sliders):
if f<63 or f>257:
s.value = -200.0
notch_filters.children = tuple(
widgets.HBox(
[
widgets.FloatText(value=b, description="Begin", width="150px"),
widgets.FloatText(value=e, description="End", width="150px"),
widgets.Checkbox(description="Use this filter", value=True)
], layout={"justify_content": "space-around"}
)
for b,e in [(58.1, 60.5), (119.6, 120.1), (179.0, 181.2), (299., 304.), (331.4, 334.0)]
)


def notch_data(h, sampling_rate, notch_locations_and_sizes):
Expand Down

0 comments on commit a1bb918

Please sign in to comment.