Skip to content

Instantly share code, notes, and snippets.

@littletsu
Created October 9, 2021 04:35
Show Gist options
  • Save littletsu/1f0c8d6c963ce5b994147fc06c8ca532 to your computer and use it in GitHub Desktop.
Save littletsu/1f0c8d6c963ce5b994147fc06c8ca532 to your computer and use it in GitHub Desktop.
Pure Data Toggle DSP Hotkey
# add this before global hotkeys are defined
# then replace or add the desired toggle dsp hotkey with ::pd_bindings::toggle_dsp
# example: "bind_capslock all $::modifier-Key w {::pd_bindings::toggle_dsp}"
# (replacing CTRL-W Exit hotkey with toggle dsp)
set ::pd_bindings::dsp_on false
proc ::pd_bindings::toggle_dsp {} {
if {$::pd_bindings::dsp_on} {
pdsend "pd dsp 0"
set ::pd_bindings::dsp_on false
} else {
pdsend "pd dsp 1"
set ::pd_bindings::dsp_on true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment