Skip to content

(Experimental) Predicting hand assignments in piano MIDI using neural networks

License

Notifications You must be signed in to change notification settings

JuliaMusic/PianoHands.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PianoHands.jl

Predicting hand assignments in piano MIDI using neural networks

Use pre-trained model

using PianoHands
generate_midi("./your_midi.mid";)

You will get a midi file your_midi_out.mid, track 1 is left hand notes, track 2 is right hand notes.

Train Your own model.

Dataset preparation

Download PIG v1.2 Dataset to PianoFingeringDataset and remove duplicate fingering file, approximately 150 fingering files are required.

function train_piano(DATASET_PATH,
    TESTSET_PATH;
    BATCH_SIZE = 12,
    SEQ_LENGTH = 75,
    HIDDEN_SIZE = 14,
    LEARNING_RATE = 0.0005f0,
    MAX_EPOCH = 200,
    EVALUATE_PER_N_TRAIN = 50)

The network structure is bi-directional GRU + Dense, and the hidden layer size can be adjusted by parameters. There is no stopping condition for training, you need stop manually.

Use trained weight:

generate_midi(input_file::String;
    output_file="",
    weight_file=pkgdir(PianoHands,"model","model-0.91502.jld2"),
    HIDDEN_SIZE=14)

If you need to change the input featears, or the network structure, you must download this package for local debugging.

About

(Experimental) Predicting hand assignments in piano MIDI using neural networks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages