amiika / ziffers

Numbered musical notation for composing algorithmic and generative melodies
MIT License
81 stars 5 forks source link

Custom character mapping #16

Closed amiika closed 2 years ago

amiika commented 5 years ago

It could be possible to rewrite the ziffers parser to support custom character mapping to control symbols, like:

setMapping({"S": :sustain, "A": :attack})

and

setNoteLengths({"p": 0.25236, "l": 0.3242})

amiika commented 5 years ago

Ruby and Sonic Pi also seems to support YAML format so the character mapping could be loaded from a file like:

---
:q:
  :type: :rest
  :value: 0.25
  :comment: Quarter note
:h:
  :type: :rest
  :value: 0.5
  :comment: Half note
:Z:
  :type: :control
  :comment: Custom rest control eg. Z0.4
...
amiika commented 4 years ago

I think this is already done (not the yaml part) but should be documented further how to use it.