Bug #732

jmod.mapperContinuous logarithmic mode bug

Added by Adrian Gierakowski almost 7 years ago. Updated almost 5 years ago.

Status:RejectedStart date:2011-03-06
Priority:NormalDue date:
Assignee:Adrian Gierakowski% Done:

0%

Category:-Estimated time:0.20 hour
Target version:0.5.5Spent time:-
Branch:master OS:

Description

At certain settings of logarithmic mode, jcom.map in the jmod.mapperContinuous produces nan (not a number) which then fails to be clipped by the clip object which follows.

to reproduce:

1.open jmod.mapperContinuous.maxhelp
2.set 1st mapping parameter in mapper.1 to input~/audio/gain and the second to output~/audio/gain
3.set function to logarithmic and coefficient to -2
4.set input~/audio/gain range in the mapper to 0 50
5.now tweak the gain slider on the input~ module: when you cross above 50 the output~/audio/gain drops to 'zero'(or rather nan :)

I think that the clipping of the input parameter should be done before jcom.map to avoid the above. If no one has any objections I'll go ahead and change it.


Related issues

Related to DSP - Bug #1090: TTLogFunction: Add test to ensure that mBase > 0 to avoid... Closed 2012-02-19
Copied to Max - Bug #1485: jmod.mapperContinuous logarithmic mode bug Closed 2011-03-06

History

#1 Updated by Nils Peters almost 6 years ago

Hi Adrian,

I just tried to reproduce your bug in max6.
Here it works now as expected - no drop to zero or nan.
Could you double-check ?


----------begin_max5_patcher----------
771.3ocsV1rahCCDG+L7TX4y.INDHzdnRq1GiUqVYRlBFkXGY6PoaU2m80ej
PRnAJpEtDviGOy+4Wrm32FOBuVb.TXzinegFM5swiF4LYMLpd7HbA8PZNU4b
CW.JEcCfm3mSCGzN6AhJcPFSBoZTxrUgIIgKabJmwgTQE24YbsQdUgYI4f1E
WRs0mEbsh8WvYKZVXsYum5WKAuVwXzuqmhk4xuX8toQ3NQgSKbNi+gjQyalo
jpS2x3a9iUn9Xs3ASZPQqBs+rv8bo44wDXDJi2nyHqs2GO19XxUhrTQQAXJ9
SQFiyzOhGDGgWFGOK2r1KdmbaeP5n6Nfgj7kHShMinXRrKzdzDcVzP9BngCu
Xz2GHyNCxlo.dFx8OITHzvrBQVUNLSKv2usPjEeCRsHdkiTOPt8j5rm6Jnkk
fLfwC77IvJZjYbYk9eSPMyalDPSm9Tqk1Uv3JMkmBlscGm84JdplI3nbwFpj
o2V7w4BTuZ1Yqku1cg19.8ThwPeobb4kTowCMHiL6dGLBWRYsKmflFM75O5B
JfVkwDAanL9PH3SbLMmU5H3ZgdaqYHioQ1G8BYcWvtkjMQzC1tK8sw3evMud
x.IaOUy12qzamOmozLdFbvrsuegaRCIJ4TbbRhLEaY2.qxYYljJdgasN6D6U
km9B1WhOF.b55b.QFrSexc7XZ72og17XeS9EtSqgjaYy90tzBxFUPkap+9J1
yOb2bM.Wt..JkfoonlZ282opZa+uLz8SR3veFX0EPybGZHqlet3zuCViwFxu
yrublu.+o4MBiWIpTFCGLoBeawXc+j6IGm6qeR7Y.4hK.xnUQctOwfQpGJmO
HJqKx6CA8ea3b.b9YA3DDVw1vsGwN9uaGTm+4Pk7v0wzg2d5K6APpKHtdWmb
UXmRr16yYknRl1Pk5CVnVojA1dyNPzwGykSQji9rkkkA7tW0Kior8Rc7Hbv2
2WqZrMG+T4XunSGmtd83gk4j9dPppioSJlse6DR6vkSbCYb+PWDwRXOqw+3w
1n893+SRimyP
-----------end_max5_patcher-----------

#2 Updated by Nils Peters almost 6 years ago

  • Target version changed from 0.5.2 to 0.5.5

#3 Updated by Adrian Gierakowski almost 6 years ago

Hi Nil,

unfortunately this still happens on Max 5 with latest Jamoma installer (b5)

check the patch below:


----------begin_max5_patcher----------
596.3oc0VtsaiBCDF9ZxSgkulhvblU6E8on2rZ0JGvg3JvFANpY2p9tu1Cgz
bfnPNUQuwDFO17OeYlw98YV34x0rVL5GnegrrdelkEXxXvZy6V3J55rRZK3F
NSVUwDJrc2bJ1ZEX+mOg7cPbAR6MJzF8FCUvTHJRPE8NWxErL4JArBuMF44v
5kye8ofdGWzTLuSTtNt16LPbbQ+t2IoPInULX4uvZxoBJdm4Z4+CliXVYmYw
pJtnjofPg7oQ4JUu0dWqoprkbQweZXYpNsPbiAMj3AOBAE4CRxrlOlMyLXe6
fzyAoVxDZ.1vvGiI+oMlRA73krCjHo2eHQbP0Mr11SQIuIdxTBwngvf6Alpz
bfVvNBS5OAYnDnD7HB6t3P82ZVmhw38n04Hh2fDgbZhDB.wKEpp7AdDem4gV
pCCjfoHPH9P+lvHyXf6MQjEkR82cnxjvqJz06GUWVhvyohhKiCCWp3ctDCRL
zQ4FqTNMG7+lvgv36.FDr2zA8Q0G5Fp0LQNZNscnVpD2ufxDxUVlzcpbb5ij
K0zFcPqXMC.mjILaHjvtGOjrlW0mR6TQqQOuXkHSwkBTorf1vUKGpRK95.k8
HfUlrT1zeVeDIMxMY6A99QtwIAleEkl35mtcutKMmBflzjnnAAL7sfq+dvcs
gMzXeep2JW0j0G48UdnOusRNqUwETCp2woj87YIOOmI18VHU77ZIWn1nAilC
MIEaif92NQxwXEaxHzZ7ko0aTQll6SLIEOBEYNa9KTRlaAcVMcPl3CWSiIY5
f+duLMoe4iY+GHP+y4.
-----------end_max5_patcher-----------

#4 Updated by Nils Peters almost 6 years ago

OK, I understand the situation now.
take a look into TTLogFunction.cpp from the DSP extension FunctionLib.
with your input settings, the log10(x) function produces nan or -inf because x<=0.0 .

What should be the output if we calculate nan or -inf instead ?

#5 Updated by Adrian Gierakowski almost 6 years ago

Just made a quick investigation into how native max object deal with this stuff and:

the output of jcom.map should be -inf and +inf in the case of -+infinity, then the clip object will be able to handle it (see patch below). If the output value doesn't exist for a specific input (like x < 0 for log10) then we should not output anything at all (also in the patch)

best

a

#6 Updated by Trond Lossius almost 5 years ago

  • Status changed from New to Rejected

Also available in: Atom PDF