What's new

SublimeKSP Updates

EvilDragon

KSP Wizard
Apr 20th 2021 - version 1.10.4

ADDED
New KSP commands and engine/control parameters from Kontakt 6.5
ADDED TCM exception handling can now be disabled by using SET_CONDITION(TCM_DISABLE_EXCEPTION_HANDLING)
IMPROVED Syntax coloring of the -> control parameter shorthand now also works if there are spaces around the arrow
FIXED Exception was not raised in case of an empty .nckp file being imported, which would prevent compilation from working properly

Previous versions:

Oct 23rd 2020 - version 1.10.3

SublimeKSP now properly recognizes $EVENT_PAR_CUSTOM.


Oct 19th 2020 - version 1.10.2

In the fix for the last issue with the logger, the bug of define evaluation happening in strings was re-introduced. The following fix is verified to have fixed both problems.


Oct 2nd 2020 - version 1.10.1

This is a quick release fix for 1.10.0 breaking the use of the debug log after shifting string compilation to a stage too late where the logger needed to read the filepath.


Sep 28th 2020 - version 1.10.0

With SublimeKSP 1.10.0 comes a few improvements to the compilation process, as well as full support for Kontakt 6.4 engine parameters.

  • Syntax now supports Kontakt 6.4 engine parameters and commands
  • There was an issue where strings were calling define macros inside of them if matching any names (for example, using the word "sum" would call a define macro sum() if it existed)
  • Compilation now correctly allows variables that start with a number when using persistence shorthands (pers and read)
  • When using literate_macro, #n# now supports replacing the index of the #l# constant in the LITERALS define.

June 9th 2020 - version 1.9.9

Fixed a bug where using any define macro names inside of strings would attempt to evaluate them instead of leaving them as string content.

For example:

Code:
define real(x) := int_to_real(x)
on init
message("Ready for real-time audio!")
end on

This code would attempt to evaluate real as a function and cause the compiler to error due to lack of arguments.


May 25th 2020 - versions 1.9.7 and 1.9.8

  • Fixes the issue where SublimeKSP simplified float ("real") constants with scientific notation (i.e. "1 / 1000000.0" would simplify to "1e-6").
  • Adds a new menu option to disable the compile date comment to the compiled code.
  • 1.9.8 fixes .nckp evaluation being broken!

Apr 15th 2020 - version 1.9.6

Three quickfix versions in succession.
  • SublimeKSP version 1.9.2 had broken namespaces. 1.9.3 rewrites the additions in 1.9.2 to match how the code worked prior, while still preserving the improvements.
  • In 1.9.3, the logger code was broken in attempt to make it comply with the data format required for adding code beyond the import file step. v1.9.4 repairs the issue and allows the logger to compile correctly.
  • 1.9.6 is a small hotfix which removes extraneous print() statements in the compiler, as well as fixes the open_nckp() function error message that occurs when you have a make_perfview command in your code.
And a syntax coloring addition in 1.9.4:
  • Single-quote strings are now using the same regular expression as double-quote strings did, since this code wasn't highlighted correctly: declare !str[] := ('foo\'s', 'bar\'s')

Apr 8th 2020 - version 1.9.2

New (and much-needed) improvements:
  • Sublime's autocomplete now supports variables starting with `$` prefixes. Requested by many!
  • The Log File Debugger, TCM module, and .nckp support (for Creator Tools GUI Designer) import steps are now all properly supported if used inside of imported files
    • Previously, they would only work if contained in the file the compilation was run on
  • When referencing controls in an .nckp where any control names contain double underscores, SublimeKSP can correctly use dots as a replacement token
    • For example, a control like Editor__Panel__Control1 can be referenced in code as Editor.Panel.Control1 and compile correctly.
  • Added a snippet for using START_INC() to help devs remember the END_INC
Bugfix:
  • When using declare const and assigning a KSP constant to it (for example: declare const BLUE := KEY_COLOR_BLUE) with code optimization enabled, SublimeKSP would not compile. The only fix for this was to disable optimization for these specific constants, and they will show up in the compiled code as they would in vanilla KSP

Mar 24th 2020 - version 1.9.1
  • When toggling any of SublimeKSP options in the Tools menu, a status message is printed out in Sublime Text's status bar, showing if the option is enabled or disabled. Particularly handy when using keyboard shortcuts to toggle certain options (i.e. Compact variable names)
  • If range for iterate_macro() is invalid (i.e. minimum value is larger than maximum value), the compiler will simply skip iterating the macro entirely instead of halting compilation. Updated the wiki to reflect this
  • Fixed missing return value types for certain new KSP commands

Jan 14th 2020 - version 1.9.0
  • Added support for Creator Tools GUI designer file format .nckp
    • use import_nckp(<path>) to load the .nckp file and parse it
    • <path> can be absolute or relative
    • you still need to load the performance view using load_performance_view("filename") command
    • error is raised if the path doesn't point to a valid .nckp file, or if make_perfview is found along with load_performance_view() in init callback
  • Simplified arrayed UI control initialization (uses a for loop to fill the array with UI IDs instead of inlining get_ui_id() after every UI control declaration)
  • Implemented issue #82 - added shorthand commands for setting UI control parameters for ui_text_edit and ui_value_edit
  • Expanded set_waveform_properties() shorthand with additional properties
  • Added two different shorthands for setting ui_wavetable properties, depending on them being used in 2D or 3D mode
  • Added two snippet variants for while loop
  • Fixed incorrect number of arguments for disable_logging() command
  • Added support for get_engine_par_str_arr() command (we had support for setter already, but not the getter)

Update from Sublime Text's Package Control or from GitHub repository.
 
Last edited:
OP
EvilDragon

EvilDragon

KSP Wizard
Thread starter
  • Thread Starter
  • Thread Starter
  • #3
It's just a slight improvement of already existing UI Arrays (see sKSP wiki). The difference is in how things look after compilation.

Previously, this line:
Code:
declare ui_switch Test[10]
would compile to:
Code:
declare %Test[10]
declare ui_switch $Test0
%Test[0] := get_ui_id($Test0)
declare ui_switch $Test1
%Test[1] := get_ui_id($Test1)
declare ui_switch $Test2
%Test[2] := get_ui_id($Test2)
declare ui_switch $Test3
%Test[3] := get_ui_id($Test3)
declare ui_switch $Test4
%Test[4] := get_ui_id($Test4)
declare ui_switch $Test5
%Test[5] := get_ui_id($Test5)
declare ui_switch $Test6
%Test[6] := get_ui_id($Test6)
declare ui_switch $Test7
%Test[7] := get_ui_id($Test7)
declare ui_switch $Test8
%Test[8] := get_ui_id($Test8)
declare ui_switch $Test9
%Test[9] := get_ui_id($Test9)
From 1.9.0 onward, it will look like this:
Code:
declare $preproc_i
declare %Test[10]
declare ui_switch $Test0
declare ui_switch $Test1
declare ui_switch $Test2
declare ui_switch $Test3
declare ui_switch $Test4
declare ui_switch $Test5
declare ui_switch $Test6
declare ui_switch $Test7
declare ui_switch $Test8
declare ui_switch $Test9
$preproc_i := 0
while ($preproc_i<=9)
%Test[$preproc_i] := get_ui_id($Test0)+$preproc_i
inc($preproc_i)
end while
...

This saves a ton of lines of compiled code when you get into larger UI arrays (or multidimensional ones).
 

FrancescoSabatini

New Member
Hi guys,

as Mario said now is possible to import the nckp format from Creator Tools and I wanted to add few more side notes on the integration I did:

- I'm the QA for the Kontakt Instruments team but I wanted to clarify that this is not an "official" NI participation but more an internally agreed initiative to hopefully push more of you to use our new tool.
- Mario have been beta testing my changes but you're very welcome to do the same, just whatever issue you may experience while using this new function please write to me directly or raise an issue on the github repo, and I'll try to sort it out asap.

Happy development to everybody ;)
 
Last edited:
OP
EvilDragon

EvilDragon

KSP Wizard
Thread starter
  • Thread Starter
  • Thread Starter
  • #6
SublimeKSP is updated to version 1.9.1! Minor (but some of them important if you use Optimize compiled code option!) fixes.
 
OP
EvilDragon

EvilDragon

KSP Wizard
Thread starter
  • Thread Starter
  • Thread Starter
  • #7
SublimeKSP is updated to version 1.9.2! Some slightly more important fixes this time around :)
 
OP
EvilDragon

EvilDragon

KSP Wizard
Thread starter
  • Thread Starter
  • Thread Starter
  • #9
Two very quick updates happened yesterday, so we are at version 1.9.4 now!
 
Can I downgrade the update to the previous version?
Since the automatic update , trying to compile a very important code that I'm working on (for more then a year now) causes sublime to crash.
The compiling process gets stuck at:
Comiling.png
And then, after a loooooooong wait - Sublime crashes :confused::shocked:o_O:alien:

- The same code was perfectly fine 4 days ago.
- I've also tried to compile older version of the same code to no avail (I back up each progress).
- Sublime crashes both on my laptop & desktop.
- Uninstalling and reinstalling Sublime didn't help....

Major SOS here...any tip about downgrading would be much appreciated!:emoji_rose:
 

neblix

Music, Math, Cats
Can I downgrade the update to the previous version?
Since the automatic update , trying to compile a very important code that I'm working on (for more then a year now) causes sublime to crash.
The compiling process gets stuck at:
View attachment 29224
And then, after a loooooooong wait - Sublime crashes :confused::shocked:o_O:alien:

- The same code was perfectly fine 4 days ago.
- I've also tried to compile older version of the same code to no avail (I back up each progress).
- Sublime crashes both on my laptop & desktop.
- Uninstalling and reinstalling Sublime didn't help....

Major SOS here...any tip about downgrading would be much appreciated!:emoji_rose:

The only way I can possibly debug this issue is to directly compile your code and read the output of python. I have compiled a variety of complex projects with a lot of imported files and extra features with no issues, so there isn't anything I can use to find the potential problem by myself. Since there is no error being given, and it's just crashing, it's even less likely that I can guess the issue since I don't even know the line of code it happens on.

Like Mario said, you can downgrade by uninstalling KSP in the Package Control and instead just manually installing the older version that he linked by placing it directly in the folder.
 

neblix

Music, Math, Cats
Update:

In the code that happens at that compilation step, I found an extraneous python print() statement, which is what I use to debug functions. It may be possible the repeated print()'s overloaded your system for some reason or another, and Sublime became unresponsive as a result.

I have scheduled a quick 1.9.6 release that removes the prints. Please check the latest automatic update before downgrading if this fixes your issue, and let me know if it doesn't.

Also, when you do, please verify you are on 1.9.6. You can do this by bringing up the Package Control "List Packages" command, and observing KSP in the list. It will say the version number.
 
Last edited:
Update:

In the code that happens at that compilation step, I found an extraneous python print() statement, which is what I use to debug functions. It may be possible the repeated print()'s overloaded your system for some reason or another, and Sublime became unresponsive as a result.

I have scheduled a quick 1.9.6 release that removes the prints. Please check the latest automatic update before downgrading if this fixes your issue, and let me know if it doesn't.

Also, when you do, please verify you are on 1.9.6. You can do this by bringing up the Package Control "List Packages" command, and observing KSP in the list. It will say the version number.
Thanks for helping out so quickly, much appreciated!
Is 1.9.6 out yet? I'm currently on 1.9.4.
 
OP
EvilDragon

EvilDragon

KSP Wizard
Thread starter
  • Thread Starter
  • Thread Starter
  • #17
Run the Upgrade Package command (search for it after you press Ctrl+Shift+P).
 
OP
EvilDragon

EvilDragon

KSP Wizard
Thread starter
  • Thread Starter
  • Thread Starter
  • #20
You could still download the latest state of the master branch directly from github...
 
Top Bottom