Posted by & filed under KSP Scripting (NI Kontakt) - Tutorials, KSP: Custom UI (design).

this tutorial is based on the Wallpaper and the Dynamic Wallpaper (via label element) tutorial. Actually once the initial wallpaper is set we can’t change it anymore but we can move the wallpaper image vertically via set_skin_offset(). So if we use an image which is as double as high as our ui_size (in this case 2 x 608px) we can put 2 wallpapers into this one image file like shown on the left. The visible area is only from 0 pixel to 608 pixel.

We can now set a button for example which moves the background skin 608 pixel vertically to put the second wallpaper into the visible area. This short demo video shows how it works:

For this demonstration we did a slow animation but of course usually you may wanna switch the wallpaper instantly. So simply set wait() to zero or remove the whole while loop (but don’t forget to add the set_skin_offset(608) again)


on init
  declare $count
  declare ui_button $switch_wp
end on

on ui_control($switch_wp)
  if ($switch_wp=1)
    $count := 0
    while ($count<609)
      wait(1000) {set to zero to switch instantly or remove the whole while loop}
    end while
  end if
end on

You can also set a background wallpaper via label element. It’s up to you which method you like the most. Both have advantages. With the label element it is much easier to design your backgrounds instead of making a long image “tube” especially when altering your background graphic a lot. The set_skin_offset method however is somewhat easier to handle when it comes to coding and also less error prone. Also you can only “change” the first 68px (where the Kontakt panel resides) with set_skin_offset()



2 Responses to “KSP Scripting (Kontakt) :: Custom UI: Switchable, Dynamic Wallpaper via set_skin_offset()”

  1. Mike

    if I want to make displaying notes on the virtual fretboard the notes pressed on the MIDI keyboard .how it works?

    • YummyBeats

      uh sorry that’s a little too complex for the comments here. Extemporaneously, I would work with an array matrix (holding the x & y positions for each note)


Leave a Reply

Your email address will not be published. Required fields are marked *