/[svn]/linuxsampler/trunk/src/scriptvm/examples/delay_effect.txt
ViewVC logotype

Contents of /linuxsampler/trunk/src/scriptvm/examples/delay_effect.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2885 - (show annotations) (download)
Fri Apr 22 15:37:45 2016 UTC (8 years ago) by schoenebeck
File MIME type: text/plain
File size: 1111 byte(s)
* Instrument script classes now exported with the liblinuxsampler C++ API.
* Added new API method ScriptVM::syntaxHighlighting() which provides
  a convenient syntax highlighting backend for external instrument
  script editor applications.
* Bumped version (2.0.0.svn5).

1 on init
2 { The amount of notes to play }
3 declare const $delayNotes := 4
4 { Tempo with which the new notes will follow the orignal note }
5 declare const $bpm := 90
6 { Convert BPM to microseconds (duration between the notes) }
7 declare const $delayMicroSeconds := 60 * 1000000 / $bpm
8 { Just a working variable for being used with the while loop below }
9 declare $i
10 { For each successive note we trigger, we will reduce the velocity a bit}
11 declare $velocity
12 end on
13
14 on note
15 { First initialize the variable $i with 4 each time we enter this event
16 handler, because each time we executed this handler, the variable will be 0 }
17 $i := $delayNotes
18 { Loop which will be executed 4 times in a row }
19 while ($i)
20 { Calculate the velocity for the next note being triggered }
21 $velocity := 127 * $i / ($delayNotes + 1)
22 { Suspend this script for a short moment ... }
23 wait($delayMicroSeconds)
24 { ... and after that short break, trigger a new note. }
25 play_note($EVENT_NOTE, $velocity)
26 { Decrement loop counter $i by one }
27 $i := $i - 1
28 end while
29 end on

  ViewVC Help
Powered by ViewVC