symusic.factory.NoteFactory

class NoteFactory[source]

Bases: object

Builds typed note events and typed note vectors backed by symusic.core.

Calling the factory automatically dispatches to NoteTick, NoteQuarter, or NoteSecond depending on the requested time unit, which mirrors the templated C++ API while remaining ergonomic for Python callers.

__init__() None

Methods

__init__()

from_numpy(time, duration, pitch, velocity)

Convert structure-of-array NumPy buffers into typed note lists.

from_numpy(time: numpy.ndarray, duration: numpy.ndarray, pitch: numpy.ndarray, velocity: numpy.ndarray, ttype: TimeUnit | str = 'tick') NoteTickList | NoteQuarterList | NoteSecondList | List[Note][source]

Convert structure-of-array NumPy buffers into typed note lists.

The helper simply forwards to the underlying symusic.core.Note*List implementation so the returned container stays synchronized with the nanobind shared-pointer semantics.