matchmaker.dp

class matchmaker.dp.oltw_dixon.OnlineTimeWarpingDixon(reference_features, score_positions, queue=None, max_run_count=3, distance_func='euclidean', **kwargs)[source]

Bases: OnlineAlignment

Base class for Dixon-style OLTW.

Subclasses must implement step(), reset(), is_still_following().

Parameters

reference_featuresnp.ndarray

Feature matrix for the reference (score) sequence.

queueRECVQueue or None

Input queue for streaming.

max_run_countint

Max consecutive same-direction advances.

distance_funcstr

Distance metric.

score_positionsnp.ndarray or None

Score positions (beats).

__init__(reference_features, score_positions, queue=None, max_run_count=3, distance_func='euclidean', **kwargs)[source]
run(verbose: bool = True) Generator[float, None, ndarray[Any, dtype[_ScalarType_co]]]

Drive the score follower from self.queue.

Pulls (features, perf_time) items from self.queue, calls self(item) per step, and yields the current beat each step. The final return value is the alignment path.

Parameters

verbosebool, optional

Whether to print a progress bar.

Returns

(yield) beatfloat

The current beat.

(return) alignment_pathNDArray

The alignment path.

class matchmaker.dp.oltw_arzt.OnlineTimeWarpingArzt(reference_features: ndarray[Any, dtype[float32]], score_positions: ndarray[Any, dtype[float32]], window_size=10, step_size: int = 3, start_window_size=0.1, queue: RECVQueue | None = None, **kwargs)[source]

Bases: OnlineAlignment

Base class for Arzt-style OLTW with step-size constraint.

Parameters

reference_featuresnp.ndarray

Feature matrix for the reference (score) sequence.

score_positionsnp.ndarray

Score beat positions for unique onsets.

window_sizeint

Search window size (interpretation depends on subclass).

step_sizeint

Maximum position advance per input step.

start_window_sizeint

Window size during warmup.

queueRECVQueue or None

Input queue for streaming.

__init__(reference_features: ndarray[Any, dtype[float32]], score_positions: ndarray[Any, dtype[float32]], window_size=10, step_size: int = 3, start_window_size=0.1, queue: RECVQueue | None = None, **kwargs) None[source]
run(verbose: bool = True) Generator[float, None, ndarray[Any, dtype[_ScalarType_co]]][source]

Drive the score follower from self.queue.

Pulls (features, perf_time) items from self.queue, calls self(item) per step, and yields the current beat each step. The final return value is the alignment path.

Parameters

verbosebool, optional

Whether to print a progress bar.

Returns

(yield) beatfloat

The current beat.

(return) alignment_pathNDArray

The alignment path.