Swayam Sahoo

Note

Overview

The Note class can be accesed within a Part object of a Scopul object. It has 4 properties: name, measure, velocity, length, music21

Here’s an example of how you could get a Note object with the Scopul class:

from Scopul import Scopul

scop = Scopul("test.mid")

# Get parts
parts = scop.parts

# Get random part's sequence
random_part = parts[0].sequence

# Lets say, for example, 
# random_part = [<Sequence.Note object at 0x0000024774D85190>, <Sequence.Rest object at 0x0000024774D1D9D0>]

note = random_part[0] # Getting the first object in the sequence, which is a note


Creating a Note object

Note(self, m21=None, name=None, length=None, velocity=None, measure=None)

You can create your own note class, which you may use to append to the existing MIDI or use for other purposes

Args

There are two ways to create a Note class:

To make it your self:

from Scopul import Note

my_note = Note(name="C4", length=1.5, velocity=2, measure=5)


To use a music21 object to create a Note object:

from Scopul import Note
from music21 import note

music21_note = note.Note("C4", quarterlength=4)
scopul_note = Note(m21=music21_note) # Automatically sets up all the attributes


Properties