a python framework for programming music applications
Project description
kord
kord is a python framework exposing a simple api that enables programmers to create music-based applications. It focuses mainly on plucked-string, tempered instruments such as guitars, basses, ukuleles and such...
API
class Note():
Note instances are the lowest-level objects of the framework and have 3 main attributes:
- (str) chr
- (str) alt
- (int) oct
Only the chr argument is required to create an instance. Arguments alt and oct will default to '' and 3 respectively.
>>> from kord import Note
>>> e = Note('e')
>>> e
E³
Note objects implement comparison operators based on their semitone intervals:
>>> f = Note('F')
>>> f
F³
>>> f > e
True
Therefore, enharmonic relationships can be evaluated as follows:
>>> n1 = Note('F', '#', 5)
>>> n2 = Note('G', 'b', 5)
>>> n1, n2
(F♯⁵, G♭⁵)
>>> n1 != n2
False
Notes with double alterations are also supported:
>>> n3 = Note('A', 'bb', 1)
>>> n3
A𝄫¹
>>> n4 = Note('F', '##', 1)
>>> n4
F𝄪¹
Given that python lacks a === operator, Notes can be compared for a "stricter" equality using their is_a() method:
>>> n3 == n4
True
>>> n3.is_a(n4)
False
This method directly compares Note attributes instead of their semitone interval. Set the ignore_oct argument appropriately for a less strict comparison:
>>> n1
F♯⁵
>>> n1.is_a(Note('F', '#', 3))
False
>>> n1.is_a(Note('F', '#', 3), ignore_oct=False)
True
class DiatonicKey():
class ChromaticKey():
class String():
class StringInstrument():
Arguments
-
-h --help
-
-f --frets [int]
-
-v --verbose [int]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kord-0.4.tar.gz.
File metadata
- Download URL: kord-0.4.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f595900e483e916a105a4824095c5ce9c09a495dbde4830bc4db9fd54f97c298
|
|
| MD5 |
889263a41cc21c60c3d5db815d37388a
|
|
| BLAKE2b-256 |
c5f3f45400188709ed7269349c79f22fa8d2a6eac6db759e2be2ca1de20cea52
|
File details
Details for the file kord-0.4-py3-none-any.whl.
File metadata
- Download URL: kord-0.4-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
302c1b67fc8d7cdb42643ea81217a4e3ff33bcc53967c4f8ae8895db5f7f481e
|
|
| MD5 |
d4a30526bbb38ab215df99916542fdba
|
|
| BLAKE2b-256 |
25d86311c7be5de12e9b879bed7930983a288558fdb1f84df5079349946b9c28
|