campy.util.note module
Exports a Note
class that can play musical notes.
A Note
has several attributes - its Pitch
To create a note, you can
-
class
campy.util.note.
Note
(duration, pitch, octave, accidental=<Accidental.NATURAL: 0>, repeat=False)[source]
Bases: object
-
class
Accidental
[source]
Bases: enum.Enum
-
FLAT
= -1
-
NATURAL
= 0
-
SHARP
= 1
-
class
Pitch
[source]
Bases: enum.Enum
-
A
= 1
-
B
= 2
-
C
= 3
-
D
= 4
-
E
= 5
-
F
= 6
-
G
= 7
-
R
= 0
-
accidental
-
duration
-
classmethod
from_line
(line)[source]
Constructs a new note from a line definition.
- Usage:
- note = Note.from_line(‘1.5 G 5 NATURAL false’)
-
is_rest
()[source]
-
octave
-
pitch
-
play
()[source]
-
classmethod
rest
(duration, repeat=False)[source]