1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Value Display stacked macros in Blocks Template: How were they constructed?

Discussion in 'Building With Reaktor' started by rdfox, Jan 6, 2016.

  1. rdfox

    rdfox NI Product Owner

    Messages:
    30
    I'm currently attempting to learn construction of Reaktor Blocks, and am encountering an issue for which I am not able to find documentation. In many of the Blocks Template.ens examples (for instance, Panel > New > Dark on Light > Value Displays > Label & Value (Time) > Label & Value > Value, we see the stacked macro "Value Display". Inside this stacked macro we see the Panel Index object and 5 different macros, each one containing a different Multi Text object. Aside from the Multi Text object in the topmost macro which contains an entry labeled "0.00 ms", there doesn't appear to be any text visible in these Multi Text fields. I can understand that there are 5 different layouts, 1 for each time the decimal point is required to shift from ranges of milliseconds to tens of milliseconds, hundreds of milliseconds, seconds, and finally tens of seconds. But how were these Multi Text objects made to do this? Is there some scripting being utilized that I am unaware of?
     
  2. herw

    herw NI Product Owner

    Messages:
    6,421
    First set the knob to default (0). Then increase it by arrow-up. You see the value 0.00195312 which is 1/512:
    knob_template_1.png
    Now back to zero. Use shift arrow up (fine tuning) and you get 0.000195313 which is nearly 1/5120. So the knob sends 5121 values.
    The knob's values are „interpreted” as log-time values and translated by the macro log2ms (macro scale) and multiplied by 100 to transform into an index (of the multitext-modules). So you have 5121 indices.
    Depending on this index the macro value split chooses one multitext-module by stacked macro. As the accuracy of the shown values decreases with factor 10 (multiplier 0.1) the higher multitext modules start with index ≥100 (the lower are blanks), because the first multitext-module shows the first 100 values. That's all.
    The concept of the shown knob is only an example to get an idea. So it is only a dirty solution as the index is calculated by log2ms and rounded. If you want really „exact” values you have to invest a little bit more logic and mathematics into value-split-macro.
    I found for myself another solution: i am using always only integer values for the knob and activate or deactivate the multitext modules by limits (of value knob). It is better to understand. After choosing a multitext i am calculating the value. This will be part of riddle 5 next days.

    ciao herw
     
    Last edited: Jan 6, 2016
  3. rdfox

    rdfox NI Product Owner

    Messages:
    30
    Yes. Thanks for your response, herw; I am clear on the usage of the Scale macro inside the Value Split core cell to generate the value sent to the display, and how the Value Split macro generates the index value that tells the Value Display stacked macro which of the macros to send to the screen. What is unclear is once a macro is selected using Panel Index, where the information regarding the textual formatting of the numeric output comes from. I see nowhere in the Multi Text fields that indicates how many decimal points to use after the value, or whether a "ms" or "s" is appended to the text, although this may be hinted at by the fact that the text "0.00 ms" is found in the Entries section in the Function tab of the first macro's Multi Text properties. Furthermore, suppose for the fourth and fifth macros in the stacked macro you wanted to output the value in thousands and tens of thousands of milliseconds with "ms" appended at the end, rather than in seconds and tens of seconds with "s" appended at the end? How is this done?
     
  4. Big Gnome

    Big Gnome NI Product Owner

    Messages:
    574
    It seems seems like you're under the misapprehension that Reaktor is diddling with text strings (excuse me if I'm mistaken). This is not the case--each value (decimals, units and all) are written literally into the multitext objects--page through them and see. The outputs of the value split macro are just feeding each of the multitexts indices for which bit of static text to display.
     
    Last edited: Jan 6, 2016
  5. herw

    herw NI Product Owner

    Messages:
    6,421
    A multitext-module outputs only text which you have inserted in properties. So if you want output values with f.i. ms you have always to add ms in text entry at every index (a boring job in properties (function)): change index and correct text)). Multitext-modules doesn't create text like numeric readouts automatically.
    Big Gnome was one second earlier ;)

    PS: NI uses different multitext-module to get a nice panel (centered output)
     
    Last edited: Jan 6, 2016
  6. tenandtracer

    tenandtracer NI Product Owner

    Messages:
    163
    In the particular case rdfox is referring to, the subsequent multi-text objects are not empty - BUT - the first ~100 entries are indeed blank. I was really puzzled by this as well and finally realized they had only populated the later entries of each subsequent multi-text.
     
  7. rdfox

    rdfox NI Product Owner

    Messages:
    30
    I see; thanks to all for pointing this out. Subsequent related question: is there any way of automating the text entry for each of the fields, i.e., can one copy and paste from a large text file generated by a scripting language somehow, or was an intern literally employed to create 1000 text entries by hand for each of the individual multi text objects?
     
  8. herw

    herw NI Product Owner

    Messages:
    6,421
    Before you create 1000 entries you should think about some logic and mathematics with only few entries.
    F.i. i have created a knob with range -48 to +48 with 2 decimals, so would mean 9601 entries. A multitext with such many entries and more costs much file space.
    A solution is to use a multitext for 2 decimals + unit and another for integer. If you want centered display you need a little bit more for nice display and a similar logic like NI's solution.
     
  9. tenandtracer

    tenandtracer NI Product Owner

    Messages:
    163