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) -> Noneparamselfparamtint | PositionLikeparamxintparamhint | None= NoneReturns
Nonefunc_of(cls, waypoints) -> CurveBuild a Curve directly from control waypoints (internal; validates ticks).
paramclsparamwaypointstuple[Waypoint, ...]Returns
margrete_rpc.chart.util.curve.Curvefuncfrom_note(cls, note) -> CurveLoad a long note's path as editable control waypoints with linear legs.
paramclsparamnoteSlideLikeA :class:Slide, :class:Hold, :class:AirSlide, :class:AirHold,
or :class:AirCrush.
Returns
margrete_rpc.chart.util.curve.CurveA new :class:Curve spanning the note's begin point through its joints.
func__len__(self) -> intparamselfReturns
intfunc__iter__(self) -> Iterator[Waypoint]paramselfReturns
collections.abc.Iterator[margrete_rpc.chart.util.curve.Waypoint]functo(self, *, t, x, h=None, ease_x='linear', ease_h='linear') -> CurveAdd one eased leg to (t, x, h) and return the extended curve.
paramselfparamtint | PositionLikeTarget tick or tuple.
paramxintTarget lane.
paramhint | None= NoneTarget 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.CurveA new :class:Curve with this leg appended.
funcpoints(self) -> tuple[Waypoint, ...]Quantize the path into integer waypoints.
paramselfReturns
margrete_rpc.chart.util.curve.WaypointAll 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).
paramselfReturns
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) -> SlideMaterialize as a ground :class:Slide.
paramselfparamwintConstant lane width for every joint.
paramtilint= 0Timeline index assigned to the note.
Returns
margrete_rpc.chart.notes.Slideclass:Slide whose joints follow the quantized path. Height is preserved
functo_air_slide(self, *, w, til=0) -> AirSlideMaterialize as an :class:AirSlide.
paramselfparamwintConstant lane width for every joint.
paramtilint= 0Timeline index assigned to the note.
Returns
margrete_rpc.chart.notes.AirSlideclass:AirSlide whose joints follow the quantized path.
functo_air_crush(self, *, w, gap=DEFAULT_AIRCRUSH_GAP, color=ColorValue.DEFAULT, til=0) -> AirCrushMaterialize as an :class:AirCrush.
paramselfparamwintConstant lane width for every joint.
paramgapint | DivisionLike= DEFAULT_AIRCRUSH_GAPSegment gap between crush particles.
paramcolorColorLike | int= ColorValue.DEFAULTCrush particle color.
paramtilint= 0Timeline index assigned to the note.
Returns
margrete_rpc.chart.notes.AirCrushclass:AirCrush whose joints follow the quantized path.
funcat(self, tick) -> WaypointEvaluate the eased path at tick.
paramselfparamtickintThe tick to evaluate; clamped to [first.t, last.t].
Returns
margrete_rpc.chart.util.curve.Waypointclass:Waypoint with interpolated (x, h) at tick.
functhen(self, other) -> CurveConcatenate other after this curve.
paramselfparamotherCurveThe curve to append; may share the seam tick with this curve's end.
Returns
margrete_rpc.chart.util.curve.CurveA new :class:Curve with other's waypoints appended; a shared seam tick
func__add__(self, other) -> CurveparamselfparamotherCurveReturns
margrete_rpc.chart.util.curve.Curve