Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions grammars/extempore.cson
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ patterns: [
name: "keyword.getset.extempore"
}
{
match: "(=|<>|<=|>=|>|<|\\+|\\*|\\-|\\/)"
match: "(= |<> |<= |>= |> |< |\\+ |\\* |\\- |\\/ )"
name: "support.equality.extempore"
}
{
match: "\\b(null|nil)\\b"
name: "constant.language.extempore"
}
{
match: "\\b(cons|car|cdr|cadr|caddr|cadddr|cond|lambda|quote|eval|append|list|vector|member|load|begin|map|apply|for-each|println|printf|print|rmatch|rsplit|rreplace|cosd|tand|sind|coshd|tanhd|sinhd|acosd|asind|atand|atan2d|ceild|floord|expd|fmodd|powd|logd|log2d|log10d|sqrtd|fabsd|clearerr|ctermid|fclose|fdopen|feof|ferror|fflush|fgetc|fgets|fileno|flockfile|fopen|fputc|fputs|fread|freopen|fseek|ftell|ftrylockfile|funlockfile|fwrite|getc|getchar|getc_unlocked|getchar_unlocked|gets|getw|pclose|perror|popen|putc|putchar|putc_unlocked|putchar_unlocked|puts|putw|remove|rename|rewind|setbuf|setvbuf|tempnam|tmpfile|tmpnam|ungetc|atof|atoi|atol|memccpy|memchr|memcmp|memcpy|memmove|memset|strcat|strchr|strcmp|strcoll|strcpy|strcspn|strdup|strerror|strlen|strncat|strncmp|strncpy|strpbrk|strrchr|strspn|strstr|strtok|strtok_r|strxfrm|base64_encode|base64_decode|cname_encode|cname_decode|swap64f|unswap64f|swap32f|unswap32f|swap64i|unswap64i|swap32i|unswap32i|thread_fork|thread_fork|thread_join|thread_kill|thread_self|thread_sleep|mutex_create|mutex_destroy|mutex_lock|mutex_unlock|mutex_trylock|callback|modulo|random|play-midi-note|mplay|inexact->exact|pm_send|min|max)\\b"
match: "\\b(cons|car|cdr|cadr|caddr|cadddr|cond|lambda|quote|eval|append|list|vector|member|load|begin|map|apply|for-each|println|printf|print|rmatch|rsplit|rreplace|cosd|tand|sind|coshd|tanhd|sinhd|acosd|asind|atand|atan2d|ceild|floord|expd|fmodd|powd|logd|log2d|log10d|sqrtd|fabsd|clearerr|ctermid|fclose|fdopen|feof|ferror|fflush|fgetc|fgets|fileno|flockfile|fopen|fputc|fputs|fread|freopen|fseek|ftell|ftrylockfile|funlockfile|fwrite|getc|getchar|getc_unlocked|getchar_unlocked|gets|getw|pclose|perror|popen|putc|putchar|putc_unlocked|putchar_unlocked|puts|putw|remove|rename|rewind|setbuf|setvbuf|tempnam|tmpfile|tmpnam|ungetc|atof|atoi|atol|memccpy|memchr|memcmp|memcpy|memmove|memset|strcat|strchr|strcmp|strcoll|strcpy|strcspn|strdup|strerror|strlen|strncat|strncmp|strncpy|strpbrk|strrchr|strspn|strstr|strtok|strtok_r|strxfrm|base64_encode|base64_decode|cname_encode|cname_decode|swap64f|unswap64f|swap32f|unswap32f|swap64i|unswap64i|swap32i|unswap32i|thread_fork|thread_fork|thread_join|thread_kill|thread_self|thread_sleep|mutex_create|mutex_destroy|mutex_lock|mutex_unlock|mutex_trylock|callback|modulo|random |play-midi-note|mplay|inexact->exact|pm_send|min |max |cosr)\\b"
name: "support.function.extempore"
}
{
Expand Down
49 changes: 44 additions & 5 deletions snippets/xtlang-atom.cson
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@
body: "(if (${1:=} (modulo (/ time SR) ${2:1.0}) ${3:0.0}) $0)"
"if-mod":
prefix: "im "
body: "(if (${1:=} (modulo beat ${2:1}) ${3:0}) $0)"
body: "(if (${1:=} (modulo ${2:beat} ${3:1}) ${4:0}) $0)"
"if-mod-duration":
prefix: "imd "
body: "(if (${1:=} (modulo (+ ${2:beat} dur) ${3:1}) ${4:0}) ${5:whenTrue} ${6:whenFalse})"
"if-not-null":
prefix: "inn "
body: "(if (not (null? $1))$0)"
Expand Down Expand Up @@ -282,13 +285,16 @@
body: "(map (lambda ($0)))"
"metro-get-beat":
prefix: "mgb "
body: "(*metro* 'get-beat ${1:4})"
body: "(${1:*metro*} 'get-beat ${2:4})"
"metro-set-tempo":
prefix: "mst "
body: "(*metro* 'set-tempo ${1:120})"
body: "(${1:*metro*}'set-tempo ${2:120})"
"metplay":
prefix: "metplay "
body: "(metplay ${1:metro} ${2:device} ${3:pitch} ${4:vel} ${5:dur} ${6:ch})"
"mplay":
prefix: "mplay "
body: "(mplay ${1:device} ${2:pitch} ${3:vel} ${4:dur} ${5:channel})"
body: "(mplay ${1:device} ${2:pitch} ${3:vel} ${4:dur} ${5:0})"
"midi-play-chord":
prefix: "mpchord "
body: '''
Expand Down Expand Up @@ -413,6 +419,9 @@
"random-list":
prefix: "rlist "
body: "(random '($0))"
"random-walk":
prefix: "rw "
body: "(random-walk ${1:seed} ${2:dev} ${3:min} ${4:max})"
"range-test":
prefix: "rtest "
body: "(if (and (>= ${1:x} ${2:lower}) (<= $1 ${3:upper})) $0)"
Expand Down Expand Up @@ -469,12 +478,42 @@
(define ${1:fun-name}
(lambda (beat dur lst inc)
$0
(mplay iac-out (car lst) 100 dur 0)
(mplay ${6:device} (car lst) 100 dur 0)
(callback (*metro* (+ beat (* .5 dur))) '$1 (+ beat dur) dur
(rotate lst inc) inc)))

($1 (*metro* 'get-beat ${2:4}) ${3:1/4} ${4:'(60)} ${5:1})
'''

"temporal-recursion-metro-with-note-attributes":
prefix: "trmn "
body: '''
(define ${1:fun-name}
(lambda (metro beat pitch vel dur ch)
$0
(callback (metro (+ beat (* .5 dur))) '$1 metro (+ beat dur)
pitch
vel
dur
ch)))

($1 ${2:metro} (${2:metro} 'get-beat ${3:4}) ${4:60} ${5:80} ${6:1/4} ${7:0})
'''

"temporal-recursion-note-attributes":
prefix: "trn "
body: '''
(define ${1:fun-name}
(lambda (beat pitch vel dur ch)
$0
(callback (*metro* (+ beat (* .5 dur))) '$1 (+ beat dur)
pitch
vel
dur
ch)))

($1 (*metro* 'get-beat ${2:4}) ${3:60} ${4:80} ${5:1/4} ${6:0})
'''
"temporal-recursion-timed":
prefix: "trt "
body: '''
Expand Down