t2techno / Faug

A Minimoog Model D emulation with the DSP portion written in Faust. Moog + Faust = Faug
26 stars 0 forks source link

Debugging the code #2

Closed sletz closed 1 year ago

sletz commented 2 years ago

I'm using Faust debugging tools and see potential issues in your code:

Using: faust -me faug.dsp:

WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential division by zero ([2.000000, 2.000000]/[0.000000, 8188.000000])
WARNING : potential division by zero ([1.000000, 1.000000]/[0.000000, 1610612735335.015381])
WARNING : potential division by zero ([2.000000, 2.000000]/[0.000000, 8188.000000])
WARNING : potential division by zero ([1.000000, 1.000000]/[0.000000, 1610612735335.015381])
WARNING : potential division by zero ([2.000000, 2.000000]/[0.000000, 8188.000000])
WARNING : potential division by zero ([1.000000, 1.000000]/[0.000000, 1610612735335.015381])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])
WARNING : potential out of domain in log([-inf, 340282346600000016151267322115014000640.000000])

And using: inter-tracer -trace 4 faug.dsp:

-------- Interpreter 'REAL div by zero' trace start --------
opcode 38 kDivReal int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 0,000000]
opcode 34 kSubReal int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 340282346638528859811704183484516925440,000000]
opcode 202 kLogf int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 340282346638528859811704183484516925440,000000]
opcode 241 kMinf int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 0,000000]
opcode 0 kRealValue int 0 real 3.40282e+38 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 0,000000]
opcode 199 kCoshf int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 0,000000]
opcode 2 kLoadReal int 0 real 0 offset1 340291 offset2 0 name fTemp89
Stack [Int: 1] [REAL: 340282346638528859811704183484516925440,000000]
opcode 202 kLogf int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 340282346638528859811704183484516925440,000000]
-------- Interpreter 'REAL div by zero' trace end ----------

-------- Interpreter 'Nan' trace start --------
opcode 38 kDivReal int 0 real 0 offset1 -1 offset2 -1
opcode 38 kDivReal int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 0,000000]
opcode 34 kSubReal int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 340282346638528859811704183484516925440,000000]
opcode 202 kLogf int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 340282346638528859811704183484516925440,000000]
opcode 241 kMinf int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 0,000000]
opcode 0 kRealValue int 0 real 3.40282e+38 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 0,000000]
opcode 199 kCoshf int 0 real 0 offset1 -1 offset2 -1
Stack [Int: 1] [REAL: 0,000000]
opcode 2 kLoadReal int 0 real 0 offset1 340291 offset2 0 name fTemp89
Stack [Int: 1] [REAL: 340282346638528859811704183484516925440,000000]
opcode 202 kLogf int 0 real 0 offset1 -1 offset2 -1
-------- Interpreter 'Nan' trace end --------
t2techno commented 2 years ago

Thanks for pointing this out to me! So far I've only been operating in the online FaustIde, so I haven't done any debugging or real optimizations yet. I'll finish setting up my Linux dev environment and these will give me a good concrete starting point for improvement before I move on to some of the other things I noticed in the link you gave me.