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

New Problem With Knob Values

Discussion in 'Scripting Workshop' started by B15fliptop, Jan 31, 2013.

  1. B15fliptop

    B15fliptop Forum Member

    Messages:
    21
    So I managed to cobble together a mixer for a drum instrument with several different kit pieces, and it works great. The only problem is that once you close the nki and reopen it, all of the knob values read the same as the first one. The knobs are in the correct positions, as saved, and they function correctly, i.e. the position of the knobs is relative to the volume of the piece it's controlling. BUT... all of the knob values read the same as whatever the first knob is set to. So if the first one is set to -6 db, they all say that regardless of what they're actually set to.

    Anyone have an idea what's going one here? It doesn't affect functionality, but I'd still love to get that corrected.
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Sounds like you're not setting the knob labels correctly in the init callback (set_knob_label()).
     
  3. B15fliptop

    B15fliptop Forum Member

    Messages:
    21
    Hmm. This is what I've got in the init callback:

    Code:
    set_knob_label($Example, get_engine_par_disp($ENGINE_PAR_VOLUME,$example,-1,-1))
     
  4. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Instead of $example there you have to have the number of group you want to pull the value from.
     
  5. B15fliptop

    B15fliptop Forum Member

    Messages:
    21
    Here's an actual example, instead of my lame attempt to make one:

    Code:
    
    declare const $STARTGRP1 := 0
    declare $count1
    declare $link_groups1 := 10
    declare ui_knob $Bottom(0,1000000,1)
    
    set_knob_unit($Bottom,$KNOB_UNIT_DB)
    set_knob_defval($Bottom,630000)
    set_knob_label($Bottom,get_engine_par_disp($ENGINE_PAR_VOLUME,$count1,-1,-1))
    move_control($Bottom,1,1)
    
    Maybe that makes more sense.
     
  6. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    This will always pick up the value from group 1 (because $count1 is not defined, which means it defaults to 0) and show it in the label of knob $Bottom. If you have $count1 assigned in get_engine_par_disp() for all other knobs you're using, there's your culprit.

    I suggest you don't use variables here, but point to the groups directly with a number in get_engine_par_disp(). So, maybe for the first knob it would be 0 (group 1), for knob 2 it would be 3 (group 4... depends on how many mic positions you have for each kitpiece), etc...
     
  7. B15fliptop

    B15fliptop Forum Member

    Messages:
    21
    I'll try that. Thanks for your help!
     
  8. B15fliptop

    B15fliptop Forum Member

    Messages:
    21
    For anyone reading this with a similar problem (however unlikely), I switched this:
    Code:
    ($ENGINE_PAR_VOLUME,$count1,-1,-1)
    To this:
    Code:
    ($ENGINE_PAR_VOLUME,$STARTGRP1,-1,-1)
    And it fixed it.

    Thanks again, EvilDragon!
     
  9. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Anyone else might not be using $STARTGRP1 at all. I suggested using just a number that would be the group ID number, that's all :)

    It's also quite weird, since from your example above, $count1 was 0 as well, unless you did something with it before set_knob_label().

    This kind of misunderstanding can happen when you don't post the whole script.
     
  10. B15fliptop

    B15fliptop Forum Member

    Messages:
    21
    I thought I had posted enough to figure out the problem, which just goes to show that I don't have a clue about what I'm doing.

    Anyway, problem solved. Sorry for the confusion.