Skip to content

robert-lieck/MusicTreequence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MusicTreequence

MusicTreequence is a Python library to code music. It provides an abstraction layer on top of Sonic Pi, which in turn is a front end to SuperCollider. MusicTreequence produces Ruby code that can be processes by Sonic Pi, that is, if you want to listen to what you've coded with MusicTreequence you have to install Sonic Pi, which is cross-platform, free and open source.

Installation

To use MusicTreequence will need to install Python (MusicTreequence is developed for Python 3). The details of the installation procedure depend on your operating system. You might want to use a Python distribution like Anaconda. A convenient way to start coding, especially if you are not familiar with Python, is to use the interactive Python shell iPython especially through Jupyter Notebook browser-based interface. The Tutorial, for instance, is such a notebook.

To listen to the music generated with MusicTreequence you will need to install Sonic Pi, which is a self-contained application independently of MusicTreequence.

Listen to the Music

For an easy start

  1. code some music (have a look at the small Tutorial for a start) and write it to a file called 'song.rb'
  2. open main.rb in Sonic Pi
  3. adapt the path to 'song.rb' to the directory where you've just saved your music
  4. run main.rb

Look at the Music

In the future I might add some simple export to music scores using music21. For this to work you have to install music21 and MuseScore (also cross-platform, free and open source) and set up music21 to use MuseScore for producing visual output by executing the following Python code:

from music21 import *
us = environment.UserSettings()
us.create()  # create config file
print(us.getSettingsPath())  # location of config file
us['musescoreDirectPNGPath'] = '/usr/bin/mscore'  # output of `which mscore`

You can test whether it's working by executing something like this

converter.parse("tinynotation: 3/4 CC#16 d8 f g16 a g f# 4/4 c4 d8 f g16 a g f#").show()

The Name

This library is called MusicTreequence because some aspects in music have a sequential nature (such as voice leading) and some are rather structured like trees (such as harmony). Since we somehow need a combination of both...well...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published