Skip to content

Instantly share code, notes, and snippets.

@npisanti
Created December 28, 2019 12:24
Show Gist options
  • Save npisanti/aa93cb30704c9d295def7a7256a8f640 to your computer and use it in GitHub Desktop.
Save npisanti/aa93cb30704c9d295def7a7256a8f640 to your computer and use it in GitHub Desktop.
BEGIN_OPERATOR(delay)
LOWERCASE_REQUIRES_BANG;
PORT(0, -1, IN | PARAM);
PORT(0, 1, IN);
Usz rate = index_of(PEEK(0, -1));
Usz mod_num = index_of(PEEK(0, 1));
if (rate == 0)
rate = 1;
if (mod_num == 0)
mod_num = 8;
if( Tick_number % (rate * mod_num) == 0 ){
PORT(1, 0, OUT);
POKE(1, 0, '*');
}
END_OPERATOR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment