The Brand New Midi Tokenizer based on Music21
Project description
HarmonyMIDIToken
The brand-new MIDI tokenizer based on music21 — designed around Future Bounce workflows and harmonic structure.
HarmonyMIDIToken은 MIDI 토크나이저로, pitch에 따른 악기(Instrument) 구분이 완료된 Future Bounce MIDI를 화성학적으로 표현 가능한 JSON과 LSTM을 위한 타임스텝 시퀀스로 직렬화/역직렬화하는 것을 목표로 합니다.
패키지는 PyPI에 harmony-midi-token 이름으로 공개되어 있으며, Python 3.11 이상을 요구합니다. (PyPI)
✨ Key Features
- music21 기반 파이프라인: MIDI → 토큰 / 토큰 → MIDI 왕복을 클래식한 음악 정보 구조 위에서 수행
- 모델 친화적 형식: 생성 모델 학습에 바로 투입 가능한 정수 시퀀스/사전 포맷 제공
- 양방향 변환 보장: 토큰에서 MIDI로 되돌릴 수 있도록 가역성(reversibility)을 중시한 규칙 설계
📦 Installation
pip install harmony-midi-token
# Requires Python 3.11+
참고: 프로젝트의 라이선스는 MIT이며, 리포지토리는 GitHub에서 공개되어 있습니다.
🚀 Quick Start
- 아래 예시 코드를 참고하여 사용해 주세요.
from HarmonyMIDIToken import HarmonyMIDIToken
MIDI = HarmonyMIDIToken()
MIDI.set_midi("examples/future_bounce.mid")
MIDI.to_midi() # Music21 Score 객체를 리턴
MIDI.to_json() # JSON 형식의 문자열 리턴
MIDI.token_id # 정수 Timestep 시퀀스 토큰
MIDI.set_id([[90, 1, 60, 3, 1, 50, 1]]) # 토큰을 객체로 변환
🤝 Contributing
이슈/PR 환영합니다!
버그 리포트 시 OS, Python 버전(3.11+), 패키지 버전(예: 1.0.3), 최소 재현 코드를 포함해 주세요.
PR 작성 시 어떤 부분을 수정하였는지, 수정 목적(예: 몇번 이슈의 버그 수정)를 포함해 주세요
ISLAND 멤버라면, PR 할 필요없이 커밋해도 상관 없으나, 버그나 추가해야 할 사항이 있다면 꼭 이슈를 작성해주세요
🙏 Acknowledgements
- music21
- pychord
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file harmony_midi_token-1.1.0.tar.gz.
File metadata
- Download URL: harmony_midi_token-1.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b4f3b5cc7a918c76d4f2b93f51c393edbbae0c3299f1b753db20fefd72424e7
|
|
| MD5 |
6b395bb9d82e87044c50cb9e6159f297
|
|
| BLAKE2b-256 |
4827b7eac35792e72521473bcb874517d98148b8f20a8b87f7d78a3f06d69a57
|
File details
Details for the file harmony_midi_token-1.1.0-py3-none-any.whl.
File metadata
- Download URL: harmony_midi_token-1.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae77795d4bcece1aec30ad8d9282effadc28c9e3c3de2dad2720950afeb220c6
|
|
| MD5 |
be333d4473914c010946b561cbaac7d2
|
|
| BLAKE2b-256 |
c1c58600b64dae418d22f22cdc5dd38870e9ab52242942c2f0b8f0e36661aad0
|