gen~ : clang error no viable conversion


    Feb 15 2015 | 11:55 pm
    Hi,
    while trying the (undocumented) rate object in gen, I got an error with a really simple patch (see below), and I just can't figure out what's wrong... Got the same error in Max6 and latest (7.0.1) version.
    Console says : clang: error line 2093 column 46: no viable conversion from 'Rate' to 'double' gen~: failed to compile patcher
    Does anyone know what that means ? Are there float/double type that I am not aware of ?

    • Feb 18 2015 | 1:55 pm
      Your Param name has the name of an object, which causes the problem. If you rename it, it works properly:
    • Feb 18 2015 | 2:20 pm
      doh! :) thanks Emmanuel
      Does this behaviour somehow imply that it is possible to use an object name on gen~ to make some kind of scripting control ? or is it just plain namespace collision ?
    • Feb 18 2015 | 7:01 pm
      Operator names are reserved words in the GenExpr language, which all gen patchers get translated into. In most cases a name clash is hidden from you, but in the case of your patcher a conflict has arisen because of the presence of a [rate] operator in the same space as [param rate]. This is a bug. It's theoretically possible to work around this, but it would add to the overhead of parsing/code generation; keeping that low has been a priority for the cases where gen patchers get large & complex (which is also where they show the greatest efficiency gains).
      This is worth revisiting, given how easy it is to want to use the same name for a parameter as an operator! Logged as ticket #8794 and looking into it.
    • Feb 18 2015 | 10:30 pm
      Update: a fix for this should be in the next update.