pyabc2.Tune

class pyabc2.Tune(abc)

Tune.

Parameters:

abc (str) – String of a single ABC tune.

Examples

>>> from pyabc2 import Tune
>>> Tune("""\
... T: G major scale
... K: G
... GABc defg | fedc BAG2 ||
... """)
Tune(title='G major scale', key=Gmaj, type='?')

Note

You must include the K: info field as the last header line for the tune header and body to be properly recognized (title and measures to be populated, etc.).

>>> from pyabc2.sources import load_example_abc
>>> Tune(load_example_abc("Tell Her I am"))
Tune(title='Tell Her I Am', key=Gmaj, type='jig')
__init__(abc)
Parameters:

abc (str)

Methods

__init__(abc)

iter_notes()

Iterator (generator) for Notes of the tune.

print_measures([n, note_format])

Print measures to check parsing.

Attributes

abc

Original ABC string.

header

Information contained in the tune header.

title

Tune primary title (first in the ABC).

titles

All tune titles.

type

Tune type/rhythm, e.g. 'jig'.

key

Key object corresponding to the tune's key.

url

Revelant URL for this particular tune/setting.

measures

Notes from "playing" the tune.