< Back to IRCAM Forum

Pipo.scale log10 question


I’m relatively new to MuBu so this might be a pretty silly question: I’m trying to understand how the in/out min/max attributes work for pipo.scale, when using the the log10 function. As shown in the picture, I’m setting the min and max values to be the same for both input and output, but when I change them, so does the output of pipo. I understand the output won’t be linear because of the log10, but given that there is no difference between expected min and max from input to output, I thought the result would not change. What am I missing?



Hi Felipo, you’re lucky, I just documented the formulas:

linear scaling:

y = m_i x + a_i


in scale  m_i = (outmax - outmin) / (inmax - inmin)
in offset a_i = outmin - inmin * m_i

log scaling:

y = m_o log(m_i x + a_i) + a_o


in scale    m_i = (b - 1) / (inmax - inmin)
in offset   a_i = 1 - inmin * m_i
out scale   m_o = (outmax - outmin) / log(b)
out offset  a_o = outmin

exp scaling (base != 1):

y = m_o e ^ (m_i x + a_i) + a_o


in scale   m_i = log(b) / (inmax - inmin)
in offset  a_i = - inmin * m_i
out scale  m_o = (outmax - outmin) / (b - 1)
out offset a_o = outmin - m_o
1 Like

Thanks Diemo!

When you say you just documented them, are you referring to the GitHub repository or is this being included in the MuBu helpfile? If so, is there a way to get notifications for new releases of the MuBu package.