Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compiler errors that result from defining DSP_SAMPLE_FLOAT #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tr3m
Copy link

@Tr3m Tr3m commented Aug 9, 2024

This pull request addresses the compiler errors that result from using the DSP_SAMPLE_FLOAT definition.
Some of the dsp modules explicitly use the double keyword on template parameters, function argument, return types etc.

This becomes a problem when the DSP_SAMPLE_FLOAT macro is defined as some compilers complain about not being able to convert floats to doubles (which makes sense in some cases since float variables and pointers are being passed to function calls that are expecting doubles).

More specifically these errors occur for:

  • The IpulseResponse class Process function expects and returns double pointers.

  • The mGainReductionDB vector declaration in line 127 of NoiseGate.h in the Trigger class, has a template parameter of double while the GetGainReduction() function in line 93 is returning a vector of type DSP_SAMPLE which would be float in the case of the DSP_SAMPLE_FLOAT definition.

I'm not sure if there was a specific reason for the ImpulseResponse class to be explicitly using double precision when the other classes including the base DSP are using the macro, but this change shouldn't be too invasive since everything is defaulting to double.

I hope it's ok that I didn't open an issue first, I didn't think it was needed since the changes are pretty small...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant