API¶
Note types¶
|
Pitch without octave. |
|
A pitch with value relative to C0. |
|
A note has a pitch and a duration. |
Alternative initializers:
|
From pitch class name (e.g., |
From pitch instance. |
|
|
From scientific pitch notation (SPN). |
|
From pitch class name and octave. |
|
From pitch class chromatic value and octave. |
From frequency, rounding to the nearest piano key. |
|
|
From Helmholtz pitch notation. |
|
From pitch class instance. |
|
Parse ABC string to note. |
|
From pitch instance. |
Key type¶
|
Key, including mode. |
|
Parse a key spec string (e.g., |
|
Compute a relative key by specifying the target mode. |
Tune type¶
|
Tune. |
Some tune attributes derived from parsing the ABC header are available as instance attributes:
Tune primary title (first in the ABC). |
|
All tune titles. |
|
Tune type/rhythm, e.g. 'jig'. |
|
Key object corresponding to the tune's key. |
|
Revelant URL for this particular tune/setting. |
Other metadata from the ABC can be found in the Tune.header dict,
and the original ABC is present at Tune.abc.
Information contained in the tune header. |
|
Original ABC string. |
These methods/properties result from tune body parsing and repeat/ending expansion:
Notes from "playing" the tune. |
|
Iterator (generator) for |
|
|
Print measures to check parsing. |
Tune sources¶
The pyabc2.sources namespace contains a few general tools.
|
Load an example ABC string, random if title not provided. |
|
Load an example tune, random if title not provided. |
|
Load tune from ABC found at the specified webpage. |
Others are found in source-specific submodules. For example:
from pyabc2.sources import norbeck
See examples in Tune sources.
Norbeck¶
Load Henrik Norbeck’s ABC Tunes (https://www.norbeck.nu/abc/).
Requires:
Functions:
|
Load a list of tunes, by type(s) or all of them. |
|
Load tune from a specified |
The Session¶
Load data from The Session (https://thesession.org).
Requires (to load tunes with load() or load_url()):
To load additional archive datasets with load_meta(), requires:
Functions:
|
Load tunes from The Session archive (https://github.com/adactio/TheSession-data). |
|
Load data from The Session archive (https://github.com/adactio/TheSession-data) as a dataframe (requires pandas). |
|
Load tune from a specified |
Eskin ABC Tools¶
Load data from the Eskin ABC Transcription Tools tunebook websites (https://michaeleskin.com/tunebooks.html).
Requires:
Functions:
|
Load the tunebook data, no parsing. |
|
Load tune from an Eskin abctools ( |
|
Extract the ABC from an Eskin abctools ( |
|
Create an Eskin abctools ( |
Bill Black¶
Bill Black’s Irish Traditional Tune Library
https://www.capeirish.com/ittl/
Requires:
Functions:
|
Load all data, splitting into ABC tune blocks and removing lines that start with |
Paul Hardy¶
Load data from Paul Hardy’s tunebooks (https://pghardy.net/tunebooks/).
Requires:
Functions:
|
Load ABC tune blocks from a Paul Hardy tunebook, no parsing. |
abcjs tools¶
See examples in Widget.
Widget¶
abcjs widget for Jupyter and more.
See examples in Widget.
|
Display SVG sheet music rendered from ABC notation by abcjs. |
|
Return a Jupyter widget for interactive use, using ipywidgets. |
Headless rendering¶
Render ABC notation to SVG sheet music using abcjs in the background.
See examples in Widget.
HTML page generation¶
Generate an HTML page to render ABC with abcjs.