strudel/packages/mini
2024-07-25 09:19:41 +02:00
..
bench Benchmarks (#1079) 2024-05-03 10:52:56 +01:00
test Fix tactus marking in mininotation (#1144) 2024-07-24 10:40:28 +01:00
index.mjs add barrel exports 2022-05-17 00:22:50 +02:00
krill-parser.js hotfix: rebuild parser to remove logs 2024-05-16 10:59:57 +02:00
krill.pegjs Improve performance of ! (replicate) (#1084) 2024-05-02 23:37:32 +01:00
mini.mjs hotfix: remove log 2024-07-25 09:19:41 +02:00
package.json Publish 2024-05-31 23:07:26 +02:00
README.md the big rename: @strudel.cycles/* -> @strudel/* 2024-01-18 09:54:37 +01:00
vite.config.js remove cjs builds 2024-02-08 12:19:11 +01:00

@strudel/mini

This package contains the mini notation parser and pattern generator.

Install

npm i @strudel/mini --save

Example

import { mini } from '@strudel/mini';

const pattern = mini('a [b c*2]');

const events = pattern.firstCycle().map((e) => e.show());
console.log(events);

yields:

(0/1 -> 1/2, 0/1 -> 1/2, a)
(1/2 -> 3/4, 1/2 -> 3/4, b)
(3/4 -> 7/8, 3/4 -> 7/8, c)
(7/8 -> 1/1, 7/8 -> 1/1, c)

Play with @strudel/mini codesandbox

Mini Notation API

See "Mini Notation" in the Strudel Tutorial

Building the Parser

The parser [krill-parser.js] is generated from krill.pegjs using peggy. To generate the parser, run

npm run build:parser