Skip to content

The official repository for "Piano score rearrangement into multiple difficulty levels via notation-to-notation approach" incl. ST+ tokenizer / detokenizer

Notifications You must be signed in to change notification settings

suzuqn/ScoreRearrangement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Piano Score Rearrangement

This is the official repository for "Piano score rearrangement" paper, providing the tools for ST+, an updated version of score token representaion.

Paper | Project page

Usage

Tokenization

from score_to_tokens import MusicXML_to_tokens

tokens = MusicXML_to_tokens('input_score.musicxml', bar_major=True, tokenize_chord_symbols=True)

Available options for MusicXML_to_tokens():

  • bar_major: tokenize scores in a bar-major style (True) or staff-major style (False)
  • note_name: tokenize pitches as note names (True) or note numbers (False)
    • i.e. note_C4 if True or note_60 if False
  • tokenize_chord_symbols: tokenize chord symbols (True) or not (False)
    • like chord_D7 bass_A (= D7/A)

Detokenization

from tokens_to_score import tokens_to_score

s = tokens_to_score(tokens) # returns a music21.stream.Score object
s.write('musicxml', 'output_score')

tokens_to_score() can take followings as input:

  • bar-major tokens or staff-major tokens
  • a list of tokens or a space-joined sequence of tokens (i.e. str)
# You can pass a list of tokens
s = tokens_to_score(['bar', 'key_sharp_1', 'time_2/4', ...])

# ... or a space-joined sequence of tokens
s = tokens_to_score('bar key_sharp_1 time_2/4 ...')

Dependencies

  • music21
  • BeautifulSoup4
  • pretty-midi

Citation

If you find this repository helpful, please consider citing our paper:

@inproceedings{suzuki2023,
 author = {Suzuki, Masahiro},
 title = {Piano score rearrangement into multiple difficulty levels via notation-to-notation approach},
 booktitle = {EURASIP Journal on Audio, Speech, and Music Processing},
 volume = {2023},
 number = {52},
 year = {2023},
 doi = {10.1186/s13636-023-00321-7}
}

About

The official repository for "Piano score rearrangement into multiple difficulty levels via notation-to-notation approach" incl. ST+ tokenizer / detokenizer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages