Skip to content

Commit

Permalink
try disabling denormal numbers for plugins with input (#158)
Browse files Browse the repository at this point in the history
* try disabling denormal numbers for plugins with input

* flag to disable scoped denormals
  • Loading branch information
dromer authored Sep 19, 2024
1 parent ce0b87e commit eaebd0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Features:
* Only disable DSP with new `--nodsp` flag
* Use pydantic types to define metadata objects
* DPF: CV flag in portgroups
* DPF: flag to disable scoped denormals

Bugfixes

Expand Down
6 changes: 6 additions & 0 deletions hvcc/generators/c2dpf/templates/HeavyDPF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include "Heavy_{{name}}.h"
#include "{{class_name}}.hpp"
#include <set>
{% if meta.denormals is sameas false %}
#include "extra/ScopedDenormalDisable.hpp"
{% endif %}


#define HV_DPF_NUM_PARAMETER {{receivers|length + senders|length}}
Expand Down Expand Up @@ -203,6 +206,9 @@ void {{class_name}}::run(const float** inputs, float** outputs, uint32_t frames,
void {{class_name}}::run(const float** inputs, float** outputs, uint32_t frames)
{
#endif
{% if meta.denormals is sameas false %}
const ScopedDenormalDisable sdd;
{% endif %}
const TimePosition& timePos(getTimePosition());
if (timePos.playing && timePos.bbt.valid)
_context->sendMessageToReceiverV(HV_HASH_DPF_BPM, 0, "f", timePos.bbt.beatsPerMinute);
Expand Down
1 change: 1 addition & 0 deletions hvcc/generators/types/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class DPF(BaseModel):
midi_output: bool = False
port_groups: Optional[DPFPortGroups] = None
enumerators: Optional[Dict[str, List[str]]] = None
denormals: bool = True
version: Optional[str] = None
license: Optional[str] = None
maker: Optional[str] = None
Expand Down

0 comments on commit eaebd0a

Please sign in to comment.