I have started porting the official scripting API documentation to TypeScript type declarations, hoping it can assist others with plugin development. https://github.com/iluminar-yi/svstudio-scripts-typing
I was wondering if it would be possible to add this initiative to the Dreamtonics GitHub repos? I think that way, the quality of documentation can also improve because now you can define interfaces. Or I can simply request to add it to DefinitelyTyped.
Also, while going through the documentation, I have found some errors that needs attention:
-
NoteGroup#getParameter
contains a typo (it appears asNoteGroup#getParamter
) - The argument to
NoteGroup#getParameter
capitalizes the first letter, which is different from "the table shown inAutomation#getDefinition
", which starts with lower case letters. Which one is correct? -
TrackMixer
seems missing (referenced bySV#create
)? -
SV#getPlayback
refers toPlayBackControl
but in the class documentation it’s calledPlaybackControl
(lowercase “b”) - Some “x2y” methods do not have consistent capitalization (e.g.
pitch2freq
vsquarter2Blick
). Is that a typo or the API is really so? - Some methods, such as
NoteGroup#getNote
, takes in an index and return a non-null object. What would happen if the index is out of bound?
Besides the problems I see, I also have a question:
- The attributes object referenced by
Note#setAttributes
andNote#getAttributes
hasdur
andalt
properties. Why are they arrays of numbers? What do they mean?