CONSTANTS in framelib

Issue #39 closed
st kr created an issue

one of my many bug bears in max and other languages is the lack of constants typing. the year being 2017 i personally believe that noone should be typing 3.14whatever into a 64bit doubles processing object box etc. it would be amazing if, in framelib objects, they understood a wide range of static constants, like gen does. so we could type pi, twopi, halfpi, oneoverpi, e, log10, sqrt2, sqrt1over2 etc etc into all the maths objects and other places. i realise you may not be interested in this as it would likely be a max specific implementation rather than frame lib specific, although i am not sure.

Comments (5)

  1. Alex Harker repo owner

    What you want is part of the max wrapper and I have considered it, but it's a nicety for later.

    In the meantime, please remember that fl.constant~ exists, and because of the arbitrary-rate processing it is efficient to use fl.once~ to synthesise constants at start time of whatever value you need.

    <pre><code> ----------begin_max5_patcher---------- 602.3ocyVssiaCBD8Y6uBjepsJMxfiuj9VU+LpVUQbHorBCVXbZ1tZy2dMC1 axlx15z0QouDKNYXNbNLCvigAQqT6YMQnOg9JJH3wvf..xBDzONHphtuTPaf vhJUUULoIZl6+Lr8F.+KTQYqfZXHgZKN9c072inMHJpTIaLziyfuFhWs59Oh SF.ksUbofY.NvGAUslAz3dzFyCBFjhgIWSMkemK29MMqz3zRBAOOdFJAma+f KRseHwyiQ2YmySgg1elMRM2sPVwzG7o.7.XCeKrJmG6SRjdvJ0Z1oieoDGPc PlGpYN0XStjJhlgh1HTzNMdWejaTRyFZI6hMHRbl0RVjXWvnBB3ODq+bRla3 +DRDl7rprvRZkK+eVy6VU+KFJ6Gct2uUCsQL2n6TiWmN9BpUv+Ei7YUdIdUR ATLkt3nWMo0RKOqTBOtRI7stTBmsz4HEf8j8+RoDWZX5cTwADNN1ieWLEETW ZojyjvoPoTwx2VozqJ8FUq1eaTtWQmbcEsq+gjCmBmkbkDMbuiOMmcK1ncGV PxWddSwjp4O3SuoQ+oyMtp6wIKf83tFtqjfGdMwATM2izI2Bo2uUu.Zs6epw zqbk7UtX7FVciAwl5uiFRYjfKO+AlPBs3uzGbGZ0ufFtxGc7Zj0rFCWRMbk7 zfvtf750ikozwPT7DPzxQPT9DvSwH4A+F4IeD7jNA5AOBdHS.OjQvS1DvS1H 8MrmNJZc8NltoOXfhtyPtWosCymAC4R2P3h8HMaGeH9T.gp6ZoMc8ysZWy99 B2sjvyJ0xVNbbQnk4mB+EbJ46XB -----------end_max5_patcher----------- </code></pre>

  2. Alex Harker repo owner

    One issue is that it is impossible to know exactly what constants someone might need ahead of time. If you want (for instance) log10(pi/4) then the only ways to allow that in an object box are:

    A - imagine all possible combinations (impossible/stupid)

    B - allow math expressions as static values (which I object to on principle)

    You also remove these symbols from being used as labels for anything, as the wrapper will then interpret them distinctly differently to other symbols.

  3. st kr reporter

    your text about "the arbitrary-rate processing it is efficient to use fl.once~ to synthesise constants" is gold dust and should go into the eventual documentation some time.

    anyone who uses one of these symbols as a label is surely totally crazy.

    i appreciate this being somewhere on your backburner 'would be nice' thinking.

  4. Alex Harker repo owner

    Also note that fl.constant~ supports multiples of the constants via a suitably named parameter.

  5. Alex Harker repo owner

    I've thought about this a bit more and I think this isn't going to happen, at least at this stage, because of the reasons above, and because this is what the fl.constant~ object is for. Putting time into this won't increase functionality, just convenience, and given that fl.once~ and fl.constant~ exist even the convenience I consider to be negligible.

  6. Log in to comment