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

refering basepath to the resource folder by deafult

Discussion in 'Scripting Workshop' started by tomer chen, Dec 28, 2014.

  1. tomer chen

    tomer chen New Member

    Messages:
    21
    I Followed this tutorial by ADSR Tuturials
    (for: how to create midi file selector and load it to the midi object)

    the midi file selector working fine
    and now i want to know how to set the @basepath (4:55 - youtube time)
    to the resource folder by deafult.
    cause i want to share the nki i created with my friends.

    the problem is
    if i set it to "e:/midifiles" for example...
    not all my friend have the e:/ drive and the midi files folder
    and they can't open it
     
    • Like Like x 1
  2. Alex!

    Alex! NI Product Owner

    Messages:
    29
    Hi man.. I'm not an expert.. but I think u must make a folder in a (C:) one (maybe better in "document") .. so everyone have it and u only need to specify that put the midi folder in that route is needed..
     
  3. tomer chen

    tomer chen New Member

    Messages:
    21
    when you install\use kontakt sound library you dont want to put the midi files in specific path to get it to work....
    i belive thare is a way to do it automaticly by deafult....
     
    • Like Like x 1
  4. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    You can only do it properly for Kontakt Player libraries, since only then you can use $GET_FOLDER_LIBRARY_DIR properly, and from there point to "MIDI Files" subfolder in the library folder.

    For non-Kontakt Player libraries you can use $GET_FOLDER_PATCH_DIR and point to "MIDI Files" folder relatively to the current NKI, but this is quite fragile if the user reorganizes the NKIs to his own folder scheme...
     
    • Like Like x 1
  5. tomer chen

    tomer chen New Member

    Messages:
    21
    im using kontakt 5.4.2 and this nki is an instrument from this library
    so how do i know if its the kind of libraries that fits Kontakt Player or not?

    and what do i have to write?
    @basepath := "$GET_FOLDER_LIBRARY_DIR"
    ?

    or

    @basepath := "$GET_FOLDER_LIBRARY_DIR/midifiles" o_O

    or

    @basepath := "$GET_FOLDER_PATCH_DIR"

    or

    @basepath := "$GET_FOLDER_PATCH_DIR/midifiles" o_O
     
    • Like Like x 1
  6. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    No... you need to use get_folder() function. See KSP Reference manual. And get to know it better. :)
     
    • Like Like x 1
  7. tomer chen

    tomer chen New Member

    Messages:
    21
    Thank u very much EvilDragon!!!! you are my guru!!!
    the answer is basepath := get_folder($GET_FOLDER_PATCH_DIR)
    and ill save the pach in some place with the midi files!
     
    • Informative Informative x 1
  8. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    It would be better if NKIs are in their own folder and MIDI files are in their own folder, so things don't mix up.

    For example, you have a library structure like this:

    Documentation\
    Instruments\
    MIDI Files\
    Samples\

    You would then use basepath := get_folder($GET_FOLDER_PATCH_DIR) & "../MIDI Files/"
     
    • Informative Informative x 1
  9. Alex!

    Alex! NI Product Owner

    Messages:
    29
    perfect! happy to learn other thing.. thank to both guys!
     
  10. tomer chen

    tomer chen New Member

    Messages:
    21
    thank u evildragon!