/[svn]/doc/docbase/instrument_scripts/nksp/01_nksp.html
ViewVC logotype

Diff of /doc/docbase/instrument_scripts/nksp/01_nksp.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3063 by schoenebeck, Fri Dec 16 18:26:26 2016 UTC revision 3119 by schoenebeck, Fri Apr 21 16:02:47 2017 UTC
# Line 11  Line 11 
11        your own instrument scripts in short time. It concentrates on describing        your own instrument scripts in short time. It concentrates on describing
12        the script language. If you rather want to learn how to modify and        the script language. If you rather want to learn how to modify and
13        attach scripts to your sounds, then please refer to the gigedit manual for        attach scripts to your sounds, then please refer to the gigedit manual for
14        <a href="gigedit_scripts.html">how to manage instrument scripts with gigedit</a>.        <a href="gigedit_scripts.html">how to manage instrument scripts with gigedit</a>
15          for Gigasampler/GigaStudio format sounds, or refer to the SFZ opcode
16          <code lang="sfz">script</code> for attaching NKSP scripts with
17          SFZ format sounds.
18      </p>      </p>
19    
20      <h3>At a Glance</h3>      <h3>At a Glance</h3>
# Line 768  on note Line 771  on note
771        @postfix := "nd"        @postfix := "nd"
772      case 3      case 3
773        @postfix := "rd"        @postfix := "rd"
774    end if    end select
775    
776    message("This is the " & $numberOfNotes & @postfix & " note triggered so far.")    message("This is the " & $numberOfNotes & @postfix & " note triggered so far.")
777  end on  end on
# Line 809  on note Line 812  on note
812      case 3      case 3
813        message("Third note was triggered!") { Will never be printed ! }        message("Third note was triggered!") { Will never be printed ! }
814        exit        exit
815    end if    end select
816    
817    message("Wow, already the " & $numberOfNotes & "th note triggered.")    message("Wow, already the " & $numberOfNotes & "th note triggered.")
818  end on  end on
# Line 848  on note Line 851  on note
851      case 1 to 99      case 1 to 99
852        message("Less than 100 notes triggered so far")        message("Less than 100 notes triggered so far")
853        exit        exit
854    end if    end select
855    
856    message("Wow, already the " & $numberOfNotes & "th note triggered.")    message("Wow, already the " & $numberOfNotes & "th note triggered.")
857  end on  end on
# Line 970  end on Line 973  end on
973      </code>      </code>
974      <p>      <p>
975        This script will run an endless loop for each note being triggered.        This script will run an endless loop for each note being triggered.
976        Every <code lang="none">200ms</code>. It will turn the volume alternatingly down and        Every <code lang="none">200ms</code> it will turn the volume alternatingly down and
977        up to create the audible stuttering effect. After each <code lang="nksp">wait()</code>        up to create the audible stuttering effect. After each <code lang="nksp">wait()</code>
978        call it calls <code>event_status($EVENT_ID)</code> to check whether        call it calls <code>event_status($EVENT_ID)</code> to check whether
979        this note is still alive, and as soon as the note died, it will stop        this note is still alive, and as soon as the note died, it will stop
980        execution of the script instance by calling <code>exit()</code>. The latter        execution of the script instance by calling <code>exit()</code>. The latter
981        is important in this example, because otherwise the script instances would        is important in this example, because otherwise the script execution instances would
982        continue to run in this endless loop forever, even after the respectives        continue to run in this endless loop forever, even after the respectives
983        notes are gone. Which would let your CPU usage to increase with every new note.        notes are gone. Which would let your CPU usage to increase with every new note
984          and would never decrease again.
985        This behavior of the sampler is not a bug, it is intended, since there may        This behavior of the sampler is not a bug, it is intended, since there may
986        also be cases where you want to do certain things by script even after the        also be cases where you want to do certain things by script even after the
987        respective notes are dead and gone. However as you can see, that script is        respective notes are dead and gone. However as you can see, that script is

Legend:
Removed from v.3063  
changed lines
  Added in v.3119

  ViewVC Help
Powered by ViewVC