mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
- @strudel/codemirror@0.11.0 - @strudel/core@0.11.0 - @strudel/csound@0.11.0 - @strudel/embed@0.11.0 - @strudel/hydra@0.11.0 - @strudel/midi@0.11.0 - @strudel/mini@0.11.0 - @strudel/osc@0.11.0 - @strudel/repl@0.11.0 - @strudel/serial@0.11.0 - @strudel/soundfonts@0.11.0 - @strudel/tonal@0.11.0 - @strudel/transpiler@0.11.0 - @strudel/web@0.11.0 - @strudel/webaudio@0.11.0 - @strudel/xen@0.11.0
@strudel/transpiler
This package contains a JS code transpiler with the following features:
- add locations of mini notation strings (double quoted or backticked) for highlighting
- converts pseudo note variables to note strings
- adds return statement to the last expression
Install
npm i @strudel/transpiler
Use
import { transpiler } from '@strudel/core';
import { evaluate } from '@strudel/core';
transpiler('note("c3 [e3,g3]")', { wrapAsync: false, addReturn: false, simpleLocs: true });
/* mini('c3 [e3,g3]').withMiniLocation(7,17) */
evaluate(note('c3 [e3,g3]'), transpiler); // returns pattern of above code