Kontakt controller editor12/29/2023 Once you enter a close‑curly‑brace symbol, the Script Editor will adjust this syntax colouring so that only the comment is displayed in cyan. As soon as you enter the open‑curly‑brace symbol, notice that the Script Editor will display this character (along with all subsequent characters) in cyan. Try writing this comment into the Script anywhere you like. Comments are areas of text in the Script that are ignored by KSP and are written between a pair of curly‑brace symbols like this: We could do this by simply deleting it from the Script, of course but a better approach is to turn the instruction into a comment. In order to truly make our transpose knob behave like a transpose knob, we need to make it adjust both the pitch of the harmony note and the pitch of the original note that triggered the on note callback in the first place.įor the moment, let's disable the play_note() command. And you'd be right: at this point, the two knobs essentially do the same thing. ![]() This is all very well, but you might be thinking that our new transposition function behaves in a suspiciously similar fashion to our original interval knob. So if $interval is set to ‑1 and $transpose is set to 4, the actual interval of the harmony note will be ‑1 + 4 = 3. If you click Apply, you'll hear that the interval of the harmony note is now the sum of $interval and $transpose. Note that, because we're just adding values together, the order in which the three variables are added doesn't matter. Play_note($EVENT_NOTE + $interval + $transpose, $EVENT_VELOCITY + $velocity, 0, ‑1) After doing this, the play_note command should look something like this: To make the transpose knob work, as you might already be anticipating, we need to add the value of $transpose to the pitch of the note that's played in the on note callback. First, let's create another knob in the Performance View for a variable called $transpose, by adding the following instructions after the declaration and configuration of the $velocity knob.ĭeclare ui_knob $transpose(‑12, 12, 1)set_knob_defval($transpose, 0)$transpose := 0make_persistent($transpose)Ĭlick Apply, and you'll notice a third knob appears in the Performance View. Taking our existing script, which is shown in the screen below This is how we left our script in last month's tutorial., let's consider how we would add a transpose feature to our harmoniser. ![]() Now it's time to extend our harmoniser with some new functionality. Last month, we gave our harmoniser a basic user interface, and also added persistence, so that the state of certain values are remembered when an Instrument containing the script is saved. ![]() In the first two parts of this workshop, we've been creating a script to implement a simple harmoniser. Learning how to extract MIDI data from Kontakt will allow our scripts to respond to different user actions in different ways, and even to control entire Kontakt Multis at once.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |