https://github.com/fantasyui-com/musical-notation
Simple and lightweight musical notation based on beat sequencers and inspired by good ideas.
https://github.com/fantasyui-com/musical-notation
Last synced: about 1 year ago
JSON representation
Simple and lightweight musical notation based on beat sequencers and inspired by good ideas.
- Host: GitHub
- URL: https://github.com/fantasyui-com/musical-notation
- Owner: fantasyui-com
- License: gpl-3.0
- Created: 2018-10-03T12:25:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-07-13T16:31:28.000Z (almost 5 years ago)
- Last Synced: 2025-05-14T16:59:56.331Z (about 1 year ago)
- Language: JavaScript
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# musical-notation
Simple and lightweight musical notation based on beat sequencers and inspired by good ideas.
This is it:
```
[----][-x--][----][-x--]
[----][-x--][----][-x--]
[-x--][-x--][-x--][-x--]
[-x--][----][-x--][----]
[-x--][----][-x--][----]
```
Hyphen means empty space
brackets help you see divisions
and x marks the spot.
## About
This is a javascript library that converts the above notation to a multidimensional array, a matrix.
```JavaScript
input = `
[----][-x--][----][-x--]
[----][-x--][----][-x--]
[-x--][-x--][-x--][-x--]
[-x--][----][-x--][----]
[-x--][----][-x--][----]
`;
```
```JavaScript
output = [
[ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
[ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
[ 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0 ],
[ 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 ],
[ 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 ]
]
```