midica icon indicating copy to clipboard operation
midica copied to clipboard

add compact syntax

Open truj opened this issue 3 years ago • 2 comments

In MidicaPL, add a simplified syntax to play several different notes with different lengths in one single line. It could look something like this: 0: c:/4 d e - c+2:/8 d+ e+ -:/2+/8 what is equivalent to:

0  c   /4
0  d   /4
0  e   /4
0  -   /4
0  c+2 /8
0  d+  /8
0  e+  /8
0  -   /2+/8

If the note length is omitted, the last used length of the channel is assumed.

truj avatar May 13 '21 12:05 truj

Also adding support for inline options and patterns in compact syntax.

Options in the form (name=value) e.g.: 0: (v=127) (d=50%) c:/4 (l=text) d e - c+2:/8 d+ e+ -:/2+/8

More options can be combined like this: (name1=value1,name2=value2) E.g.: (v=127,d=50%)

Patterns can be used instead of length strings, e.g. 0: c:4 d e,f,g:pat a b cmaj:pat (If the pattern pat and the chord cmaj have been defined) Or with parameters: 0: c:4 d e,f,g:pat(a,b) a b cmaj:pat(c,d) With a, b, c, d as arbitrary parameters consumed by the pattern pat.

Consequently the next step would be to enable compact syntax in pattern definitions as well. E.g. like this:

PATTERN pat
    : (d=50%) 0:/8 1:/8 (d=20%) 2:/4
END

Which would be equivalent to:

PATTERN pat
    0  /8   d=50%
    1  /8
    2  /4   d=20%
END

truj avatar Apr 16 '22 19:04 truj

Two more things missing until this can be merged into master:

  • [ ] Allow empty commpact lines (for convenience), e.g. 0:
  • [ ] Add compact syntax to the documentation on midica.org

truj avatar Jul 21 '22 19:07 truj