GithubHelp home page GithubHelp logo

cable's Introduction

Cable

A fretted instrument chord generator written in Python

Create a new instance of Cable, optionally specifying a tuning and maximum number of spanned frets. The defaults are shown here

from Cable import Cable, STANDARD, Note, Interval, Quality, Extension
cable = Cable(tuning=STANDARD, span=3)

Build chords by specifying the note and optionally added notes, bass, quality, and extension

# Bb major:
cable.generate(Note.Bb)

# Building chords:

# F# Power chord
cable.generate(Note.Fs, Interval.PERFECT_FIFTH, Interval.PERFECT_FOURTH)
# The above can also be written as:
cable.generate(Note.Fs, Interval.a4, Interval.a5)

# A#maj#11 chord
cable.generate(Note.As, # Sharp/flat notes are succeded by s or b
               Interval.M7,  # capital M for a major 2nd, 3rd, 6th, or 7th. Lowercase m for minor
               Interval.a9,  # Standard added intervals are preceded by the letter 'a'
               Interval.s11, # Sharp/flat intervals are preceded by s or b
               quality=Quality.MAJ)
# Can also be written as:
cable.generate(Note.As,
               quality=Quality.MAJ,
               extension=Extension.s11)  # Sharp/flat extensions are preceded by s/b

# Bb9/F# chord:
cable.generate(Note.Bb,
               bass=Note.Fs,
               extension=Extension.E9)  # Unmodified extensions are preceded by E

Create a new tuning of any length by creating a list of notes:

BASS_DROP_D = [Note.D, Note.A, Note.D, Note.G]
cable = Cable(tuning=BASS_DROP_D)
FIVE_STRING_BASS = [Note.B, Note.E, Note.A, Note.D, Note.G]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.