#21 usage of abs instead of fabs in Vibe.C

closed-fixed
Transmogrifox
None
5
2012-03-17
2012-03-15
Andreas Degert
No

rakarrack version 6.1 (did't look in current git version but I assume its unchanged):
at the end of Vibe::changepar():

fcross = 1.0f - abs(flrcross);

abs is the integer form, so fcross will nearly always be 0.0 (1.0 at the ends of the range).
I think it was meant to be fabs (or std::abs), though its not a dramatic difference in sound.

Btw. I have included the vibe code in guitarix - thanks a lot :-)

Discussion

  • Andreas Degert
    Andreas Degert
    2012-03-15

    sorry, got it the wrong way around, fcross is nearly always 1.0 (else one would hear a much bigger difference)

     
  • Transmogrifox
    Transmogrifox
    2012-03-16

    Thanks for pointing that out. I have confirmed it is also unchanged in git, so I will fix it there. It will make a more notable difference if you offset the LR LFO (St. Df).

    Do you provide stereo output in Guitarix? If you want to save a little CPU, I can refactor this for you in a manner optimized for mono processing. I'm glad you're making good use of the code ;). Processing this in mono will actually reduce CPU Utilization by nearly a factor of 2. It would probably be good if I also put a switch in Rakarrack so the user can process mono only.

    A Vibe is a good addition to the Guitarix toolbox. Take Care, and thanks for reporting the bug.

     
  • Transmogrifox
    Transmogrifox
    2012-03-16

    • assigned_to: nobody --> transmogrifox
     
  • Andreas Degert
    Andreas Degert
    2012-03-16

    "Do you provide stereo output in Guitarix?"
    Yes, Guitarix is a little bit schizophrenic ("I'm two jack clients") :-)
    We have some effects that have 2 versions, for the mono effect chain and for the stereo effect chain. So, if you refactor it, we could use that too. Btw, it acts like a real device, if you overload the input, at some point the sound will deteriorate (i'll have to change some guitarix presets that have too high levels at the end of the chain).

    But this is certainly not the right place to discuss such things, I only posted the bug/issue here because I didn't find a developers mailing list (I don't have any more points at the moment, but would the users mailing list be the right place?)

     
  • Transmogrifox
    Transmogrifox
    2012-03-16

    We have a rakarrack-devel list, but currently is only available to project developers. I think the bug tracker is a good place for the original issue, RE abs() function. Probably the best place to post questions, comments about these things is either the general discussion forum, or rakarrack-users list. We get notification on any of these, so any is fine by me.

    As for it behaving as a real device -- yes this is quite intentional. The behavior is built into the BJT emitter follower amplifier stage design. I believe it would have minimal impact on the overall sound if this were removed from the code. It has the most notable effect when you drive it at higher levels. IIRC everything is scaled to 1.0 floating point, so any input at 1.0 and less will merely be colored, whereas anything greater will get hard clipped by the nature of the devices modeled. I literally digitized the circuit from a schematic (although my optocoupler model is a little off). I'll let you know when I have had time to refactor it with a Stereo Switch and also an ability to selectively disable the bjt transistor models. I will probably re-implement it the way it was orignally written, where I pass a struct to a function. We inlined everything as an experiment to see if it saved much CPU by eliminating program jumps...it makes a really small difference.

     
  • Transmogrifox
    Transmogrifox
    2012-03-17

    • status: open --> closed-fixed
     
  • Transmogrifox
    Transmogrifox
    2012-03-17

    changed to fabs()