1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Read_persistent_var on the first initialization?

Discussion in 'KONTAKT: Sampling, Programming & Scripting' started by olmerk, Oct 9, 2017.

  1. EvilDragon

    EvilDragon KSP Wizard

    3,189
    1,393
    May 25, 2010
    Croatia
    That example would work with snapshot mode 1 as well. In fact, it is preferred to use mode 1, really, because it will make loading snapshots faster, since ICB doesn't need to be executed on loading each and every snap.

    Also, placement of make_persistent() is of course important - you cannot place it before you actually define the control that is supposed to be persistent ;)
     
    P.N. likes this.
  2. P.N.

    P.N. Senior Member

    168
    63
    Aug 14, 2015
    I was trying to keep it simple... but maybe i should have not mentioned snapshots at all...

    Come on! Now you're just messing with me... you know what i meant... :laugh:

    Again i was just trying to help, with the limited knowledge i possess, and i encourage all users to follow Evil Dragon's advices over whatever (convulated advice) i post. :)
     
  3. EvilDragon

    EvilDragon KSP Wizard

    3,189
    1,393
    May 25, 2010
    Croatia
    Wasn't intending to mess with you, but just make things absolutely clear :)
     
    P.N. likes this.
  4. Lindon

    Lindon KSP Developer

    481
    77
    Jul 27, 2010
    Republic of Yorkshire
    Yeah like Mario, for persistent vars - declare them and then set them as persistent in the ICB but read and act on them in the OPC - which gives you the ability to create function calls for activities.
     
  5. Tod

    Tod Old Fart

    Okay, since we're on it here, I've got another question about "snapshots". I understand "set_snapshot_type" and the difference between 0 and 1, what I don't understand, and can't find in the manual is how to manipulate snapshots. I can't find any way to perform a snapshot.

    I suppose that's a silly question...:cautious:
     
  6. EvilDragon

    EvilDragon KSP Wizard

    3,189
    1,393
    May 25, 2010
    Croatia
    You cannot "perform" them. What do you mean by "performing them"?

    They're like mini-NKIs that don't contain mapping and MIDI CC/host automation information, so stuff that is stored in them are persistent variable values, internal layout of effects and modulators, and stuff like that. They were introduced in order to reduce the loading time of "presets" that use exactly the same NKI layout (as far as sample mapping goes), since samples are only loaded the first time (when you load the NKI), instead of every time.
     
  7. Tod

    Tod Old Fart

    Okay thanks again Mario, so where does NI have the info concerning snapshots? I'm assuming this has to do with the "Snapshot" thingy in the instrument header, or not? I noticed that a long time ago but never really paid any attention to it.

    So if I use "set_snapshot_type" in a script, that just tells how I want the snapshots to be read, is that right?

    I also looked in the manual and addendum, but couldn't find anything.
     
  8. EvilDragon

    EvilDragon KSP Wizard

    3,189
    1,393
    May 25, 2010
    Croatia
    set_snapshot_type() is explained in KSP reference (no, you're not right in your assumption) :) And snapshots are explained in the manual - you should have the latest version of it (5.7, 09/2017), there's a whole chapter called "Using Snapshots".
     
  9. polypx

    polypx Senior Member

    771
    15
    Jan 7, 2007
    You create and load Snapshots using the "Snapshot thingy" in the header.

    Snapshot type just decides how that NKI responds to Snapshot loading.... basically it will either read the init when you load a Snapshot or not. Using Mode 1 you can exclude some parameters from being changed by Snapshot loading.
     
  10. Tod

    Tod Old Fart

    Okay, thanks Mario, I haven't looked in the 5.7 manual, I just assumed it would be in the 5.5 manual since 5.5 has snapshots. However, I do have the 5.7 upgrade, I'm just not using it yet.

    Thanks polypx, that's what I was getting at in my post above, I kind of got the gist of that in the KSP manual, so thanks for clearing that up. :)
     

Share This Page