KSP .txt File doesn't work

Options
Zippzeripp
Zippzeripp Member Posts: 4 Newcomer
edited November 2023 in Scripting Workshop

Hey guys,

I try to implement an external Tuning script into the NI KSP.

For some reasons the file I want to load in always gives me the following error:

"ERROR (line 278): change_tune / change_volume / change_pan is not allowed in this callback type!"


And here is the tuning script in the key of A:

{**************************************

Precise Temperament A

MIDI note 69 (A5) = 432.081216 Hz

Made for 432 Hz by Robert E Grant and released on 2020

Implemented by Toni Mazzotti using Scale Workshop on 2022


****************************************}


on init

declare %keynum[128]

declare %tune[128]

declare $bend

declare $key


%keynum[0] := 0

%tune[0] := -29271

%keynum[1] := 1

%tune[1] := -31334

%keynum[2] := 2

%tune[2] := -33397

%keynum[3] := 3

%tune[3] := -31766

%keynum[4] := 4

%tune[4] := -29162

%keynum[5] := 5

%tune[5] := -31224

%keynum[6] := 6

%tune[6] := -33612

%keynum[7] := 7

%tune[7] := -27315

%keynum[8] := 8

%tune[8] := -29379

%keynum[9] := 9

%tune[9] := -31441

%keynum[10] := 10

%tune[10] := -33508

%keynum[11] := 11

%tune[11] := -27531

%keynum[12] := 12

%tune[12] := -29271

%keynum[13] := 13

%tune[13] := -31334

%keynum[14] := 14

%tune[14] := -33397

%keynum[15] := 15

%tune[15] := -31766

%keynum[16] := 16

%tune[16] := -29162

%keynum[17] := 17

%tune[17] := -31224

%keynum[18] := 18

%tune[18] := -33612

%keynum[19] := 19

%tune[19] := -27315

%keynum[20] := 20

%tune[20] := -29379

%keynum[21] := 21

%tune[21] := -31441

%keynum[22] := 22

%tune[22] := -33508

%keynum[23] := 23

%tune[23] := -27531

%keynum[24] := 24

%tune[24] := -29271

%keynum[25] := 25

%tune[25] := -31334

%keynum[26] := 26

%tune[26] := -33397

%keynum[27] := 27

%tune[27] := -31766

%keynum[28] := 28

%tune[28] := -29162

%keynum[29] := 29

%tune[29] := -31224

%keynum[30] := 30

%tune[30] := -33612

%keynum[31] := 31

%tune[31] := -27315

%keynum[32] := 32

%tune[32] := -29379

%keynum[33] := 33

%tune[33] := -31441

%keynum[34] := 34

%tune[34] := -33508

%keynum[35] := 35

%tune[35] := -27531

%keynum[36] := 36

%tune[36] := -29271

%keynum[37] := 37

%tune[37] := -31334

%keynum[38] := 38

%tune[38] := -33397

%keynum[39] := 39

%tune[39] := -31766

%keynum[40] := 40

%tune[40] := -29162

%keynum[41] := 41

%tune[41] := -31224

%keynum[42] := 42

%tune[42] := -33612

%keynum[43] := 43

%tune[43] := -27315

%keynum[44] := 44

%tune[44] := -29379

%keynum[45] := 45

%tune[45] := -31441

%keynum[46] := 46

%tune[46] := -33508

%keynum[47] := 47

%tune[47] := -27531

%keynum[48] := 48

%tune[48] := -29271

%keynum[49] := 49

%tune[49] := -31334

%keynum[50] := 50

%tune[50] := -33397

%keynum[51] := 51

%tune[51] := -31766

%keynum[52] := 52

%tune[52] := -29162

%keynum[53] := 53

%tune[53] := -31224

%keynum[54] := 54

%tune[54] := -33612

%keynum[55] := 55

%tune[55] := -27315

%keynum[56] := 56

%tune[56] := -29379

%keynum[57] := 57

%tune[57] := -31441

%keynum[58] := 58

%tune[58] := -33508

%keynum[59] := 59

%tune[59] := -27531

%keynum[60] := 60

%tune[60] := -29271

%keynum[61] := 61

%tune[61] := -31334

%keynum[62] := 62

%tune[62] := -33397

%keynum[63] := 63

%tune[63] := -31766

%keynum[64] := 64

%tune[64] := -29162

%keynum[65] := 65

%tune[65] := -31224

%keynum[66] := 66

%tune[66] := -33612

%keynum[67] := 67

%tune[67] := -27315

%keynum[68] := 68

%tune[68] := -29379

%keynum[69] := 69

%tune[69] := -31441

%keynum[70] := 70

%tune[70] := -33508

%keynum[71] := 71

%tune[71] := -27531

%keynum[72] := 72

%tune[72] := -29271

%keynum[73] := 73

%tune[73] := -31334

%keynum[74] := 74

%tune[74] := -33397

%keynum[75] := 75

%tune[75] := -31766

%keynum[76] := 76

%tune[76] := -29162

%keynum[77] := 77

%tune[77] := -31224

%keynum[78] := 78

%tune[78] := -33612

%keynum[79] := 79

%tune[79] := -27315

%keynum[80] := 80

%tune[80] := -29379

%keynum[81] := 81

%tune[81] := -31441

%keynum[82] := 82

%tune[82] := -33508

%keynum[83] := 83

%tune[83] := -27531

%keynum[84] := 84

%tune[84] := -29271

%keynum[85] := 85

%tune[85] := -31334

%keynum[86] := 86

%tune[86] := -33397

%keynum[87] := 87

%tune[87] := -31766

%keynum[88] := 88

%tune[88] := -29162

%keynum[89] := 89

%tune[89] := -31224

%keynum[90] := 90

%tune[90] := -33612

%keynum[91] := 91

%tune[91] := -27315

%keynum[92] := 92

%tune[92] := -29379

%keynum[93] := 93

%tune[93] := -31441

%keynum[94] := 94

%tune[94] := -33508

%keynum[95] := 95

%tune[95] := -27531

%keynum[96] := 96

%tune[96] := -29271

%keynum[97] := 97

%tune[97] := -31334

%keynum[98] := 98

%tune[98] := -33397

%keynum[99] := 99

%tune[99] := -31766

%keynum[100] := 100

%tune[100] := -29162

%keynum[101] := 101

%tune[101] := -31224

%keynum[102] := 102

%tune[102] := -33612

%keynum[103] := 103

%tune[103] := -27315

%keynum[104] := 104

%tune[104] := -29379

%keynum[105] := 105

%tune[105] := -31441

%keynum[106] := 106

%tune[106] := -33508

%keynum[107] := 107

%tune[107] := -27531

%keynum[108] := 108

%tune[108] := -29271

%keynum[109] := 109

%tune[109] := -31334

%keynum[110] := 110

%tune[110] := -33397

%keynum[111] := 111

%tune[111] := -31766

%keynum[112] := 112

%tune[112] := -29162

%keynum[113] := 113

%tune[113] := -31224

%keynum[114] := 114

%tune[114] := -33612

%keynum[115] := 115

%tune[115] := -27315

%keynum[116] := 116

%tune[116] := -29379

%keynum[117] := 117

%tune[117] := -31441

%keynum[118] := 118

%tune[118] := -33508

%keynum[119] := 119

%tune[119] := -27531

%keynum[120] := 120

%tune[120] := -29271

%keynum[121] := 121

%tune[121] := -31334

%keynum[122] := 122

%tune[122] := -33397

%keynum[123] := 123

%tune[123] := -31766

%keynum[124] := 124

%tune[124] := -29162

%keynum[125] := 125

%tune[125] := -31224

%keynum[126] := 126

%tune[126] := -33612

%keynum[127] := 127

%tune[127] := -27315

end on


on note

$key := %keynum[$EVENT_NOTE]

$bend := %tune[$EVENT_NOTE]

change_note ($EVENT_ID, $key)

change_tune ($EVENT_ID, $bend, 0)

end on

... I hope somebody who is a bit more educated in this field could give me a hint what the issue is here.

Thank you very much

Comments

  • Gablux
    Gablux Member Posts: 82 Member
    Options

    I copied and pasted the code above and it compile with no errors.


    I'm not sure how this is related to "KSP .txt File doesn't work"


    Also you see an error on line 278 .. in which slot ?Do you have other scripts in other slots? This one above runs fine.

  • Zippzeripp
    Zippzeripp Member Posts: 4 Newcomer
    Options

    Thank you for your support Gablux.

    Maybe I have scripts in other slots from later attemps.

    I will delete everything and try it again.

    Do you know if I have to save the KSP script together with the instrument or is it possible to save it as a template and use it in Komplete Kontrol as a preset with any instrument?

    Thank you very much!

  • Gablux
    Gablux Member Posts: 82 Member
    Options

    KSP scripts are elements of Kontakt, whether in the internal for - the script directly in the script editor inside the edit view in Kontakt - or in external form - a text file in the resources/scripts folder, linked via the script editor.

    You can make a template to be pasted or linked to any instrument, but not to be applied as an option or parameter in Komplete Kontrol.

    Also keep in mind that not all if not most commercial instruments, specially the encoded ones may not allow or work with a pasted script on an empty slot.

    Even if an empty slot is available, the preceding scripts may have intricate engineering of EVENTS which could potentially prevent your applied script to work.

    In other words, it is a case by case situation.

  • Zippzeripp
    Zippzeripp Member Posts: 4 Newcomer
    Options

    Thanks you very much I see your point.

    I tried it again and made sure all slots are empty but I get the same results.

    Where do you save the script or the content? Because I open the KSP inside of Kontakt and Press Edit, Paste all the content in and just hit apply. This is when I get the ERROR Status. I there an other way of saving it?

    It also said" ERROR (Line 279): change_tune() cannot be used in the multi script!"

    Did you take the hole script and can you cut this part off?:


    on note

    $key := %keynum[$EVENT_NOTE]

    $bend := %tune[$EVENT_NOTE]

    change_note ($EVENT_ID, $key)

    change_tune ($EVENT_ID, $bend, 0)

    end on


    thank you very much.!

  • medusa
    medusa Member Posts: 85 Helper
    Options

    It seems you're posting the script into the wrong script editor, there are two and they are different.

    The Multi Script editor is outside the instrument, in the main window of Kontakt, and will create the errors you've posted above because it works directly with MIDI.

    To change tuning and so on you need to use the Instrument script editor, INSIDE the instrument. Open an instrument with the wrench icon and you'll see it as one of the options.



  • Zippzeripp
    Zippzeripp Member Posts: 4 Newcomer
    Options

    Hello guys,

    thanks for your help, I could successfully implement the scripts and open it in Kontakt.

    But now after the latest update there is no way for me to access the tuning scripts in Kontakt, Kontakt 7 or Komplete Kontrol. The drawn tool on the top left got replaced by a gear icon but doesn't load the script editor. Do you guys have similar experiences? I asked the NI support and got the answer that is has to do with instruments that are "open" or "closed" by the developers, but I cannot open the script editor in any of my instruments.

  • medusa
    medusa Member Posts: 85 Helper
    Options

    If you mean this gear icon, that means the instrument is locked and you can't edit it.



Back To Top