All Projects → DCMLab → pitchplots

DCMLab / pitchplots

Licence: MIT license
Plotting library for note distributions in different representations of tonal space

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pitchplots

CRAWLAB-Code-Snippets
Small pieces of code for use in CRAWLAB research
Stars: ✭ 12 (-29.41%)
Mutual labels:  plotting
svg plot
Plot data in SVG format using C++ (header only) library .
Stars: ✭ 20 (+17.65%)
Mutual labels:  plotting
SciPlot-PyQt
A Matplotlib-wrapped user-interface for creating and editing publication-ready images and plots
Stars: ✭ 32 (+88.24%)
Mutual labels:  plotting
fretonator
The ultimate interactive free guitar theory tool.
Stars: ✭ 42 (+147.06%)
Mutual labels:  music-theory
planetMagFields
Routines to plot magnetic fields of planets in our solar system
Stars: ✭ 27 (+58.82%)
Mutual labels:  plotting
trame
Trame let you weave various components and technologies into a Web Application solely written in Python.
Stars: ✭ 50 (+194.12%)
Mutual labels:  plotting
GRUtils.jl
Tools for using the GR framework in Julia
Stars: ✭ 29 (+70.59%)
Mutual labels:  plotting
LabMidi
Midi IN and OUT. Standard midi file parser and player. Midi Softsynth implementation.
Stars: ✭ 38 (+123.53%)
Mutual labels:  music-theory
trase
📊 A lightweight plotting library
Stars: ✭ 75 (+341.18%)
Mutual labels:  plotting
mahler.c
Western music theory library in C99
Stars: ✭ 13 (-23.53%)
Mutual labels:  music-theory
oxyplot-avalonia
A cross-platform plotting library for .NET. This package targets Avalonia apps.
Stars: ✭ 102 (+500%)
Mutual labels:  plotting
BeautifulMakie
https://lazarusa.github.io/BeautifulMakie/
Stars: ✭ 281 (+1552.94%)
Mutual labels:  plotting
MusicTheory
Music Theory Library for Java and Android apps
Stars: ✭ 24 (+41.18%)
Mutual labels:  music-theory
AIBud
An experimental CreateML project for predicting playing musical key and scale in realtime
Stars: ✭ 18 (+5.88%)
Mutual labels:  music-theory
pyx
Repository of PyX, a Python package for the creation of PostScript, PDF, and SVG files.
Stars: ✭ 71 (+317.65%)
Mutual labels:  plotting
elementary-plotlib
C/C++ Plotting Library
Stars: ✭ 19 (+11.76%)
Mutual labels:  plotting
expyplot
Matplotlib for Elixir
Stars: ✭ 27 (+58.82%)
Mutual labels:  plotting
NegativeHarmonizer
A python tool to invert the tonality (a.k.a negative harmony) of midi notation
Stars: ✭ 23 (+35.29%)
Mutual labels:  music-theory
ggshakeR
An analysis and visualization R package that works with publicly available soccer data
Stars: ✭ 69 (+305.88%)
Mutual labels:  plotting
joypy
Joyplots in Python with matplotlib & pandas 📈
Stars: ✭ 418 (+2358.82%)
Mutual labels:  plotting

pitchplots

header

A python library for plotting note distributions in different tonal spaces. DOI

Getting Started

The library contains the following files

  • functions.py,
  • reader.py,
  • modified_music_xml.py,
  • parser.py
  • static.py

Prerequisites

In order to use pitchplots you need a running Python 3 environment and the following libraries:

  • matplotlib
  • pandas
  • numpy

to install these libraries, you can do the following command in the prompt:

python3 -m pip install matplotlib>=3.0.1 pandas>=0.23.4 numpy>=1.15.3

or if you're using the Anaconda prompt

pip install matplotlib>=3.0.1 pandas>=0.23.4 numpy>=1.15.3

Or you can use the requirements.txt file in the github. Dont' forget to set the path to the one of the requirements file.

python3 -m pip install -r requirements.txt

Installation

You can install the pitchplots package on pypi with pip using the following command in the prompt:

python3 -m pip install pitchplots

or if you're using the Anaconda prompt

pip install pitchplots

Functions

1 2 2 4 5 6

Pitchplots has currently three plotting functions

  • tonnetz uses a .csv file or a pandas DataFrame of a piece of music to do a hexagonal 2D representation ("Tonnetz").
  • circle uses a csv file or a pandas DataFrame of a piece of music to represent the notes by fifth or chromatic.
  • line uses a csv file or a pandas DataFrame of a piece of music to represent the notes by fifth or chromatic on a line, the unrolled equivalent to the circle function.

Two animation functions

  • tonnetz_animation plot the same graphs as the tonnetz function but is animated.
  • circle_animation plot the same graphs as the circle function but is animated.

and one function to parse (compressed) MusicXML files and uncompressed xml files

  • xml_to_csv uses a .mxl or .xml file and parses it into a .csv file using the TensorFlow Magenta musicxml_parser.py.

Working with files

Parsing

Pitchplots plots note distributions from MusicXML files (.xml or .mxl). You can either specify your own file or use the test file data_example.mxl. contained in the package.

The first step is to parse the file into a note list representation that is stored in a pandas DataFrame where each line corresponds to a note or a rest.

import pitchplots.parser as ppp

# If no filepath is specified, will automatically charge data_example.mxl
df_data_example = ppp.xml_to_csv(save_csv=True)

To use your own file, add filepath= with the location of your file in the parameters of the function xml_to_csv.

Plotting

In order to plot the notes of a piece, import the pitchplots.static module and use one of its plotting functions. They take as input the output of the parser, i.e. either a DataFrame object:

import pitchplots.static as pps

pps.tonnetz(df_data_example)

or a CSV file:

import pitchplots.static as pps

pps.tonnetz('csv/data_example.csv')

In both cases the output should look like the following image (of course, the note distribution depends on the piece you are plotting):

tonnetz_example

Or if you want to plot a line:

import pitchplots.static as pps

pps.line(df_data_example)

or a CSV file:

import pitchplots.static as pps

pps.line('csv/data_example.csv')

In both cases the output should look like the following image (of course, the note distribution depends on the piece you are plotting):

line_example

Or if you want to plot a circle:

import pitchplots.static as pps

pps.circle(df_data_example)

or a CSV file:

import pitchplots.static as pps

pps.circle('csv/data_example.csv')

In both cases the output should look like the following image (of course, the note distribution depends on the piece you are plotting):

circle_example

detailed functionality

see the following files for more informations about the functions parser, line, circle, tonnetz, circle_animation and tonnetz_animation.

parser documentation line documentation circle documentation tonnetz documentation

Further Information

Authors

If you use pitchplots in academic publications, please cite the library as

Moss, Fabian C.; Loayza, Timothy & Rohrmeier Martin. (2019). pitchplots (Version 1.4.2). Zenodo. http://doi.org/10.5281/zenodo.3265393

Usage of Magenta's code

The modified_musicxml_parser.py file is taken from the TensorFlow Magenta project and has been modified. See the modifications and the Magenta License.

License

Pitchplots is licensed under the MIT License - see the LICENSE file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].