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

fvdelay: haddock mentions balance, but there is no such parameter? #67

Open
jwaldmann opened this issue Nov 29, 2021 · 3 comments
Open

Comments

@jwaldmann
Copy link

Prelude Csound.Base> :doc fvdelay
 Delay with feedback.

 > fdelay maxDelayLength delayLength feedback balance

the last parameter balance does not exist, as the type shows:

Prelude Csound.Base> :i fvdelay
fvdelay :: MaxDelayTime -> DelayTime -> Feedback -> Sig -> Sig
@anton-k
Copy link
Contributor

anton-k commented Jan 12, 2022

Thanks to mention that, sorry for late reply. I look at the sources and can see a blunder:

-- | The simplest delay with feedback. Arguments are: delay length and decay ratio.
--
-- > echo delayLength ratio
echo :: MaxDelayTime -> Feedback -> Sig -> Sig
echo len fb x = x + flanger x (sig len) fb `withD` (len + 0.005)

-- | Delay with feedback.
--
-- > fdelay maxDelayLength delayLength feedback balance
fvdelay :: MaxDelayTime -> DelayTime -> Feedback -> Sig -> Sig
fvdelay len dt fb a = a + flanger a dt fb `withD` len

So the balance is fixed to 0.5 which is a bad idea. I wonder how to deal with that?
Idiomatic change is to use all wet signal in both cases and apply balance with mixAt function.

But of course it will break the code for those who already used that

@anton-k
Copy link
Contributor

anton-k commented Jan 12, 2022

Great tip with using doc in the ghci. I was not aware of that
Do you provide your own compilation routine that sets -haddock flag?

@jwaldmann
Copy link
Author

Hi. I have this in $HOME/.cabal/config:

...
program-default-options
  ...
  ghc-options: -haddock

then it is applied for any cabal install --lib ... command.

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

No branches or pull requests

2 participants