Skip to content

Package for Music Analysis using the Spiral Representation as model for tonality

License

Notifications You must be signed in to change notification settings

spiralizing/MusicSpiralRepresentation.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MusicSpiralRepresentation

Stable Dev Build Status Coverage

Julia Package with functions to compute the Center of Effect with the Spiral Representation as model for tonality developed by Elaine Chew in her book Mathematical and Computational Modeling of Tonality.

Install

pkg> add https://github.com/spiralizing/MusicSpiralRepresentation.jl

Usage

For a bit of explanation of what this package is about and how to use some of its functions please see THIS EXAMPLE

To load MusicXML files

You need to have PyCall installed in your Julia environment

import MusicSpiralRepresentation
const msr = MusicSpiralRepresentation

using PyCall
m21 = pyimport("music21")

mxl_piece = m21.converter.parse("name_of_file.mxl")

To load MIDI (CSV) files

You can also load MIDI files indirectly by converting them to CSV files first with midicsv in a terminal:

$ midicsv name_of_file.mid > name_of_file.csv 

and to load it in Julia

using DelimitedFiles

csv_piece = readdlm("name_of_file.csv",',')

Creating a DataFrame from MusicXML and CSV files

You can create a DataFrame containing the information of the music score/piece with get_xml_df or get_csv_df, where the resulting data frame returns the format:

| measure| Time signature|start | end | duration | pitch|

for xml files:

import MusicSpiralRepresentation
const msr = MusicSpiralRepresentation
using PyCall
m21 = pyimport("music21")

mxl_piece = m21.converter.parse("name_of_file.mxl")
piece_df = msr.get_xml_df(mxl_piece)

for csv files:

import MusicSpiralRepresentation
const msr = MusicSpiralRepresentation
using DelimitedFiles

csv_piece = readdlm("name_of_file.csv",',')
piece_df = msr.get_csv_df(csv_piece)

About

Package for Music Analysis using the Spiral Representation as model for tonality

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages