Source Code
Power Law Fitting
power_law_fitting.zip
- This python collection was developed by Joel Ornstein at Santa Fé Institute.
- After executing the file named example.py on a given data, the program will return the exponential parameter α and a p-value; ergo, the results of first and second steps, according to Clauset' s recipe.
Likelihood Ratio
likelihood.py
- This python program is based on Jeff Alstott powerlaw package.
- After executing the program on a given data, it will compare the power law result against: exponential, stretched exponential, lognormal, and truncated power law. It returns the likelihood ratio (LR) and a p-value; ergo, the results of third step, according to Clauset' s recipe.
Algorithm A.1: Building a network from a MIDI file
directedGraph.py
multi-DirectedGraph.py
- These python programs were developed based on Networkx python package.
- An undirected graph can be easily created within Networkx, after you create a directed graph, or a multi-directed graph. Please, see the last block of code inside the file directedGraph.py or file multi-DirectedGraph.py.
Algorithm A.2: Following the Composer
followingTheComposer.py
- This block of code must be copy-pasted in a python console that already has a musical network constructed.
- The algorithm following the composer requires multi-directed graphs as input data, otherwise, part of the algorithm instructions shall be ignored.
Algorithm A.3: Back to Down-town
backToDownTown.py
- This block of code must be copy-pasted in a python console that already has a musical network constructed.
- The algorithm back to down-town does not require multi-directed graphs as input data, however, multi-directed graphs provide richer musical networks, when compared to directed or undirected graphs. Thus, multi-directed graphs are also recommended when using back to down-town algorithm.
Chuck Player
chuckPlayerv3.ck
- The output of both algorithms (following the composer and back to down-town) can be immediately played back with the simple chuck player provided above.
- To make use of the chuck player, it is necessary to install the Chuck Proramming Language.