No release in over 3 years
A music theory library based on Python's `musictheory` package.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

MusicSetTheory

music_set_theory.gem is ruby version of musictheory of python package, by Peter Murphy.

The package has roughly the same philosophy as Music Set Theory but uses different terminology.

The music theory treats notes and the relationships among them, i.e., temperament, chords, scale, modes, etc.

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add music_set_theory

If bundler is not being used to manage dependencies, install the gem by executing:

gem install music_set_theory

Usage

See the examples/ directory. The scripts for listing chords and scales are there.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Testing

If you want to test all:

bundle exec rake test

test a specified test case:

TEST=./test/something_test.rb  bundle exec rake test

If you want to test specified test method(s), then:

TESTOPTS=--name=/pattern-matches-to-the-description/ TEST=./test/something_test.rb  bundle exec rake test

Future Works, etc.

I would like to add some examples, debug more, and refactor the structure and method names... (Actually, I don't have the knowledge about temperament and modes at (almost) all, though I can understand chords and scales a little since I had played the guitar.)

The state-dependencies exists in the original test cases on WestTemp. So I have already removed them. All tests, including commented out one (TestChords), are passed now.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mephistobooks/music_set_theory.

License

The gem is available as open source under the terms of the MIT License.

The original musictheory is BSD 3-clauses Licence.

Copyright (c) 2009-2020 Peter Murphy <peterkmurphy@gmail.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * The names of its contributors may not be used to endorse or promote 
      products derived from this software without specific prior written
      permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.