MIT License

项目介绍

billyblu2000/AccoMontage2 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 170 个 Star、25 次 Fork。

仓库全名
billyblu2000/AccoMontage2
开源许可证
MIT License
Star 数
170
Fork 数
25
未关闭 Issue
5

README 摘要

AccoMontage2 Introduction AccoMontage2 is a system capable of doing full-length song harmonization and accompaniment arrangement based on a lead melody. Based on AccoMontage, AccoMontage2 invents a harmonization module to generated chord progression, and provides a GUI to control the generating styles of chords and textures. Our paper AccoMontage2: A Complete Harmonization and Accompaniment Arrangement System is…

完整内容见 GitHub 原始 README 或本页 。

常见问题

AccoMontage2 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 170 个 Star。

AccoMontage2 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 AccoMontage2 的源码?

可以直接克隆仓库:git clone https://github.com/billyblu2000/AccoMontage2.git,默认分支为 master;安装与运行步骤见仓库 README。

AccoMontage2 最近还在维护吗?

仓库最近一次更新为 2023年5月3日,当前有 5 个未关闭 Issue;Star 数为 170,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Chord and accompaniment generator, pure python package that generate chord progression and accompaniment according to given melodies. Code for paper AccoMontage2: A Complete Harmonization and Accompaniment Arrangement System.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
226
价值分
109
活跃状态
活跃

语言占比

CSS
HTML
JavaScript
Jupyter Notebook
Python

README

AccoMontage2

Introduction

AccoMontage2 is a system capable of doing full-length song harmonization and accompaniment arrangement based on a lead melody. Based on AccoMontage, AccoMontage2 invents a harmonization module to generated chord progression, and provides a GUI to control the generating styles of chords and textures. Our paper AccoMontage2: A Complete Harmonization and Accompaniment Arrangement System is accepted by ISMIR 2022. This repository stores the code corresponding to the paper.

Binary Data Files Download

You might have to download some data files and store them in chorderator/static before running. You can find them here.

Dataset Download

If you want to explore our dataset or use it for your own project, you can find it here (For those who don’t have access to Google, you can use the mirror at Baidu Netdisk). Note that you don’t need to download them if you only want to run AccoMontage2.

The dataset is re-organized from the original Niko Dataset. It contains 5k+ chord progressions with style labels. We provide our dataset in two formats:

  1. MIDI: each chord progression piece stored as a single MIDI file.
  2. Quantized Note Matrix: a python dictionary with format like the following. nmatis an 2-d matrix, each row represent a quantized note: [start, end, pitch, velocity]. Each note is quantized at the eighth note level. eg., start=2 means the note begins at the third eighth note. root is also an 2-d matrix. It labels the roots of the chords using an eighth note sample rate. Each row of the root represents a bar. Each element is an integer ranged from 0 (C note) to 11 (B note).
{'piece name': 
 	{'nmat': [[0, 3, 60, 60], ...],    # 2-d matrix: note matrix
     'root': [[0,0,0,0,0,0,0,0], ...], # 2-d matrix: root label
     'style': 'some style',            # pop_standard, pop_complex, dark, r&b, unknown
     'mode': 'some mode',              # M, m
     'tonic': 'C'                      # C, Db, ..., B
    }, 
 ...
}

# load the dataset using pickle
import pickle
with open('dataset_path_and_name.pkl', 'rb') as file:
    dataset = pickle.load(file)

Interfaces and Demo

Run with terminal

A demo is provided. If you want to run demo, please check all the requirements in requirments.txt are satisfied, and run

python demo.py

This demo takes in the melody midi file hpps65 and output the result in folder hpps65_output_results.

# demo.py

import chorderator as cdt

if __name__ == '__main__':
    
    demo_name = 'hpps65'
    input_melody_path = 'MIDI demos/inputs/' + demo_name + '/melody.mid'

    cdt.set_melody(input_melody_path)
    cdt.set_meta(tonic=cdt.Key.G)
    cdt.set_segmentation('A8B8A8B8')
    cdt.set_texture_prefilter((0, 2))
    cdt.set_note_shift(0)
    cdt.set_output_style(cdt.Style.POP_STANDARD)
    cdt.generate_save(demo_name + '_output_results')

Interfaces are provided as follows:

Method Name Description Mandatory before generating Usage Example
set_melody The input melody path True set_melody('input.mid')
set_meta Assign tonic (mandatory), mode (default major), and meter (default 4/4, and currently only 4/4 is supported) to the melody True set_meta(tonic=cdt.Key.A, mode=cdt.Mode.MAJOR)
set_segmentation A string to represent the phrase information of the melody. Should be in form ‘phrase_name+phrase_length’*n. For example, A8A8B8B8. Phrase length only support 4-bars and 8-bars. True set_segmentation('A8A8B8B8')
set_texture_prefilter A tuple (a, b) controlling the style of the textures. a, b can be integers in [0, 4], each controlling horizontal rhythmic density and vertical voice number. The higher number, the denser rhythms. For more information, please refer to AccoMontage. False, texture might be in any style if not assigned set_texture_prefilter((2,2))
set_note_shift If there is a piece of blank at the beginning of the melody that you don’t want to start generating, please specify the length of the blank with the number of 16-th note. False, default 0 set_note_shift(16)
set_output_style A string to control the chord progression style. Currently, four styles are available: 'pop_standard', 'pop_complex', 'r&b', 'dark'. False, chord progression might be in any style if not assigned set_output_style(cdt.Style.POP_STANDARD)
generate_save Start generating with the specified parameters. A string must be passed in to specify the output folder. By default, the program will output three files: chord_gen.mid: a melody track and a chord progression track; chord_gen.json: generate log of the harmonization module; textured_chord_gen.mid: a melody track and a accompaniment track. Three more parameters are available for this method. task: what to output and from where to generate, for example, task='textured_chord' will make the program only output the textured_chord_gen.mid; log: whether to output the log file; wav: whether to generate a .wav file for the generating result. If you want to generate a .wav file, please make sure you have midi2audio and FulidSynth installed. - generate_save('generate_result', log=False, wav=False)

More detailed controllability is provided. Please refer to the Core Class in chorderator/core.py. A core object can be instantiated by calling cdt.get_chorderator().

In addition, if you have problems trying AccoMontage2 with a custom melody, please refer to issue #2. There is also an interactive tutorial available, credit to @asigalov61.

Run with GUI

gui

Please check all the requirements in back-end/requirments.txt are satisfied, and run

python back-end/app.py

You can interact with the GUI at http://127.0.0.1:5000.

Reference and Acknowledgement

Thanks to Prof. Gus Xia for his guidance. Thanks to Jingwei Zhao and the AccoMontage system that provides solid foundations for this research. His repository can be found at AccoMontage. Thanks to all members at New York University Shanghai Music-X-Lab for their generous support.

Cite Our Work

@inproceedings{yi_2022_accomontage2,
  author       = {Li Yi and Haochen Hu and Jingwei Zhao and Gus Xia},
  title        = {{AccoMontage2: A Complete Harmonization and Accompaniment Arrangement System}},
  booktitle    = {{Proceedings of the 23rd International Society for Music Information Retrieval Conference}},
  year         = 2022,
  pages        = {248-255},
  publisher    = {ISMIR},
  address      = {Bengaluru, India},
  month        = dec,
  venue        = {Bengaluru, India},
  doi          = {10.5281/zenodo.7316642},
  url          = {https://doi.org/10.5281/zenodo.7316642}
}

评论

暂无评论