Margrete RPC

Curve

A width-agnostic slide path built by chaining eased legs between :class:Waypoints.

Start with Curve(t=..., x=..., h=...) then chain :meth:to to add legs. Materialize to a note with :meth:to_slide, :meth:to_air_slide, or :meth:to_air_crush (each applies a constant width w). Load an existing note's path with :meth:from_note.

Attributes

attribute__slots__
= ('waypoints',)
attributewaypointstuple[Waypoint, ...]
= (Waypoint(resolve_tick(t), x, DEFAULT_H if h is None else h),)

Functions

func__init__(self, *, t, x, h=None) -> None
paramself
paramtint | PositionLike
paramxint
paramhint | None
= None

Returns

None
func_of(cls, waypoints) -> Curve

Build a Curve directly from control waypoints (internal; validates ticks).

paramcls
paramwaypointstuple[Waypoint, ...]

Returns

margrete_rpc.chart.util.curve.Curve
funcfrom_note(cls, note) -> Curve

Load a long note's path as editable control waypoints with linear legs.

paramcls
paramnoteSlideLike

A :class:Slide, :class:Hold, :class:AirSlide, :class:AirHold, or :class:AirCrush.

Returns

margrete_rpc.chart.util.curve.Curve

A new :class:Curve spanning the note's begin point through its joints.

func__len__(self) -> int
paramself

Returns

int
func__iter__(self) -> Iterator[Waypoint]
paramself

Returns

collections.abc.Iterator[margrete_rpc.chart.util.curve.Waypoint]
functo(self, *, t, x, h=None, ease_x='linear', ease_h='linear') -> Curve

Add one eased leg to (t, x, h) and return the extended curve.

paramself
paramtint | PositionLike

Target tick or tuple.

paramxint

Target lane.

paramhint | None
= None

Target height; defaults to the current end height (constant-height leg).

paramease_xEaseLike
= 'linear'

Lane easing for this leg.

paramease_hEaseLike
= 'linear'

Height easing for this leg.

Returns

margrete_rpc.chart.util.curve.Curve

A new :class:Curve with this leg appended.

funcpoints(self) -> tuple[Waypoint, ...]

Quantize the path into integer waypoints.

paramself

Returns

margrete_rpc.chart.util.curve.Waypoint

All sampled waypoints in order; useful to preview the realized joints before

func_path(self) -> tuple[Waypoint, list[Waypoint], Waypoint]

Quantize, then split into (first, interior, last) (always >= 2 points).

paramself

Returns

tuple[margrete_rpc.chart.util.curve.Waypoint, list[margrete_rpc.chart.util.curve.Waypoint], margrete_rpc.chart.util.curve.Waypoint]
functo_slide(self, *, w, til=0) -> Slide

Materialize as a ground :class:Slide.

paramself
paramwint

Constant lane width for every joint.

paramtilint
= 0

Timeline index assigned to the note.

Returns

margrete_rpc.chart.notes.Slide

class:Slide whose joints follow the quantized path. Height is preserved

functo_air_slide(self, *, w, til=0) -> AirSlide

Materialize as an :class:AirSlide.

paramself
paramwint

Constant lane width for every joint.

paramtilint
= 0

Timeline index assigned to the note.

Returns

margrete_rpc.chart.notes.AirSlide

class:AirSlide whose joints follow the quantized path.

functo_air_crush(self, *, w, gap=DEFAULT_AIRCRUSH_GAP, color=ColorValue.DEFAULT, til=0) -> AirCrush

Materialize as an :class:AirCrush.

paramself
paramwint

Constant lane width for every joint.

paramgapint | DivisionLike
= DEFAULT_AIRCRUSH_GAP

Segment gap between crush particles.

paramcolorColorLike | int
= ColorValue.DEFAULT

Crush particle color.

paramtilint
= 0

Timeline index assigned to the note.

Returns

margrete_rpc.chart.notes.AirCrush

class:AirCrush whose joints follow the quantized path.

funcat(self, tick) -> Waypoint

Evaluate the eased path at tick.

paramself
paramtickint

The tick to evaluate; clamped to [first.t, last.t].

Returns

margrete_rpc.chart.util.curve.Waypoint

class:Waypoint with interpolated (x, h) at tick.

functhen(self, other) -> Curve

Concatenate other after this curve.

paramself
paramotherCurve

The curve to append; may share the seam tick with this curve's end.

Returns

margrete_rpc.chart.util.curve.Curve

A new :class:Curve with other's waypoints appended; a shared seam tick

func__add__(self, other) -> Curve
paramself
paramotherCurve

Returns

margrete_rpc.chart.util.curve.Curve

On this page