Documentation
¶
Overview ¶
Package motion will own semantic motion targets, plans, sampling, retargeting, and active motion state.
Index ¶
- Constants
- Variables
- func DynamicSpanProfiles() []string
- func FollowSpeedBand(settings config.MotionSettings) (float64, float64)
- func LabSettingsKey(settings config.MotionSettings) string
- func UsesExactImportedCurve(definition PatternDefinition) bool
- func ValidDynamicSpanProfile(value string) bool
- type ActiveMotionState
- type AreaFocus
- type ContinuousRecipe
- type Curve
- type CurveMetrics
- type CurvePoint
- type DynamicAnchor
- type DynamicDefinition
- type DynamicExperiment
- type DynamicSection
- type Engine
- func (e *Engine) AdmissionGeneration() uint64
- func (e *Engine) ApplyTarget(ctx context.Context, target MotionTarget, reason string) (ActiveMotionState, error)
- func (e *Engine) ApplyTargetIfCurrent(ctx context.Context, target MotionTarget, reason string, planID string) (ActiveMotionState, error)
- func (e *Engine) ApplyVibration(ctx context.Context, spec VibrationSpec, admission uint64) (ActiveMotionState, error)
- func (e *Engine) ApplyVibrationIfCurrent(ctx context.Context, spec VibrationSpec, admission, generation uint64) (ActiveMotionState, error)
- func (e *Engine) Pause(ctx context.Context, reason string) (ActiveMotionState, error)
- func (e *Engine) RefreshSettings(ctx context.Context, settings config.MotionSettings, reason string) (ActiveMotionState, error)
- func (e *Engine) Resume(ctx context.Context, reason string) (ActiveMotionState, error)
- func (e *Engine) Snapshot() ActiveMotionState
- func (e *Engine) Start(ctx context.Context, target MotionTarget, settings config.MotionSettings) (ActiveMotionState, error)
- func (e *Engine) StartAtGeneration(ctx context.Context, target MotionTarget, settings config.MotionSettings, ...) (ActiveMotionState, error)
- func (e *Engine) Stop(ctx context.Context, reason string) (ActiveMotionState, error)
- type EngineOptions
- type FlowExperiment
- type FlowLayer
- type FlowPhrase
- type FlowPreview
- type FlowSpec
- type FlowStep
- type FreestyleControls
- type FreestyleKeyframe
- type FreestyleProgress
- type FreestyleSpec
- type GestureSpec
- type LabCandidate
- type LabPreview
- type LabRequest
- type LabSample
- type LabStart
- type MediaRoundingEffect
- type MediaTimelineDefinition
- type MotionPlan
- func (p MotionPlan) CompleteAt(streamMillis int64) bool
- func (p MotionPlan) DirectionAt(streamMillis int64) int
- func (p MotionPlan) PhaseAt(streamMillis int64) float64
- func (p MotionPlan) Retarget(id string, target MotionTarget, settings config.MotionSettings, ...) MotionPlan
- func (p MotionPlan) SampleAt(streamMillis int64) MotionSample
- func (p MotionPlan) VelocityAt(streamMillis int64) float64
- type MotionSample
- type MotionTarget
- type PaceSummary
- type PatternDefinition
- func BuiltinPatternDefinition(id PatternID) (PatternDefinition, bool)
- func BuiltinPatternDefinitions() []PatternDefinition
- func ContinuousPatternDefinition(id PatternID) (PatternDefinition, bool)
- func NormalizePatternDefinition(definition PatternDefinition) (PatternDefinition, error)
- func PromotedBuiltinPatternDefinitions() []PatternDefinition
- type PatternID
- type PerceptualSummary
- type PhraseStroke
- type PlanningEnvelope
- type ProgramDefinition
- type SoftAnchor
- type StrokeAccent
- type StrokeSpec
- type StrokeTurn
- type TurnCoverage
- type VibrationSpec
Constants ¶
const ( // RoutineCycleFloorMillis is the hardware-derived minimum stored authoring // cycle. Runtime playback may retime that curve through the shared plan. RoutineCycleFloorMillis int64 = 6600 // PatternKindRoutine identifies a normal repeating pattern. PatternKindRoutine = "routine" // PatternKindBurst identifies a deliberately short shape exempt from the // routine cycle floor. PatternKindBurst = "burst" // MaximumMediaTimelinePoints keeps feature-length funscripts bounded while // leaving normal pattern and program authoring on the smaller content cap. MaximumMediaTimelinePoints = 100_000 // TagExperimental marks catalog content that is fully playable in the // library but exposed to the model only behind the user's // experimental-patterns capability gate. TagExperimental = "experimental" // TagCurated marks user-selected curves promoted into the built-in catalog. TagCurated = "curated" )
const ( // DynamicMotionName is the user-facing content label for model-authored loops. DynamicMotionName = "Creative" // MinimumDynamicSpanPercent prevents narrow model targets from collapsing // into whole-percent device stalls at slow speeds. MinimumDynamicSpanPercent = 20 )
const ( DynamicSpanProfileSteady = "steady" DynamicSpanProfileBreathe = "breathe" DynamicSpanProfileWander = "wander" DynamicSpanProfileContrast = "contrast" )
DynamicSpanProfileSteady and its siblings are semantic texture choices, not transport modes. The empty profile retains alpha.25 compatibility, where variation_percent also produces a small implicit span swell.
const ( // FreestyleMaximumWindowStrokes keeps a window inside the curve point // budget with room for the rests a lively stream inserts. FreestyleMaximumWindowStrokes = 160 // FreestyleMaximumKeyframes bounds one window's control history; the mode // manager compacts settled ramps well before reaching it. FreestyleMaximumKeyframes = 48 // FreestyleMaximumRampStrokes bounds one ramp. FreestyleMaximumRampStrokes = 1024 )
const MinimumPatternReversalProminence = 2.0
MinimumPatternReversalProminence is the smallest adjacent swing treated as an intentional loop reversal. Smaller extrema are positional chatter.
const TargetSourceManualUI = "manual_ui"
TargetSourceManualUI identifies motion explicitly started by the diagnostic manual-test controls. Autonomous modes use their mode identifier as source.
const TargetSourceMedia = "media"
TargetSourceMedia identifies a clock-locked paired-funscript run.
const (
// TargetSourceMotionLab identifies an explicitly started experiment.
TargetSourceMotionLab = "motion_lab"
)
Variables ¶
var ErrUnsafeStartupState = errors.New("motion startup state is unsafe")
ErrUnsafeStartupState marks device geometry that the shared motion engine cannot safely recover through its bounded startup lead-in. Autonomous modes must not retry this unchanged state indefinitely; a new explicit start may be attempted after the device position or calibration changes.
var StrokeAccentMoves = []string{"plunge", "full", "tip_flicks", "deep_grind", "pause", "slow"}
StrokeAccentMoves are the motifs an accent can weave in.
var StrokeAccentRates = []string{"rarely", "sometimes", "often"}
StrokeAccentRates are how often an accent appears.
var StrokeCharacters = []string{"steady", "drift", "alternate", "occasional", "roam"}
StrokeCharacters are the ways a turn moves between its two positions: holding still, wandering smoothly, switching every few strokes, visiting the other position now and then, or wandering in step with the other roaming turn so the whole stroke moves.
Functions ¶
func DynamicSpanProfiles ¶
func DynamicSpanProfiles() []string
DynamicSpanProfiles lists the explicit model-facing profile vocabulary.
func FollowSpeedBand ¶
func FollowSpeedBand(settings config.MotionSettings) (float64, float64)
FollowSpeedBand returns the averaged carriage speeds, in full spans per second, at the user's slowest and fastest saved Handy speeds. Vibration that follows speed spans this band (ADR 0061).
func LabSettingsKey ¶
func LabSettingsKey(settings config.MotionSettings) string
LabSettingsKey detects a changed limit/calibration before audition.
func UsesExactImportedCurve ¶
func UsesExactImportedCurve(definition PatternDefinition) bool
UsesExactImportedCurve marks the explicit allowlist of imported timing that intentionally preserves holds and bypasses generated-pattern fitting. A bulk-imported filename is never sufficient evidence.
func ValidDynamicSpanProfile ¶
ValidDynamicSpanProfile reports whether value is an explicit profile.
Types ¶
type ActiveMotionState ¶
type ActiveMotionState struct {
LinkedSession *transport.LinkedSessionStatus `json:"linked_session,omitempty"`
Running bool `json:"running"`
Starting bool `json:"starting"`
Completing bool `json:"completing"`
Paused bool `json:"paused"`
RunningMillis int64 `json:"running_ms"`
Generation uint64 `json:"generation"`
StreamID string `json:"stream_id,omitempty"`
PlanID string `json:"plan_id,omitempty"`
Target MotionTarget `json:"target"`
Settings config.MotionSettings `json:"settings"`
StartedAt string `json:"started_at,omitempty"`
Phase float64 `json:"phase"`
NextSampleMillis int64 `json:"next_sample_ms"`
RecentCommandLatencyMillis int64 `json:"recent_command_latency_ms"`
CurrentSample *MotionSample `json:"current_sample,omitempty"`
LastSample *MotionSample `json:"last_sample,omitempty"`
LastResult *transport.CommandResult `json:"last_result,omitempty"`
LastError string `json:"last_error,omitempty"`
// Pace is the compact backend-authoritative Creative output readout. It is
// safe for the motion SSE because it contains no curve points or payloads.
Pace *PaceSummary `json:"pace,omitempty"`
// Perceptual is backend planning context. It stays out of the 8 Hz motion
// SSE snapshot; Autopilot records the compact values in decision traces.
Perceptual PerceptualSummary `json:"-"`
// Freestyle locates the playhead in a running Freestyle window for the
// mode manager. It is planning context and stays out of client snapshots.
Freestyle *FreestyleProgress `json:"-"`
}
ActiveMotionState is a safe snapshot of the current motion loop. CurrentSample follows the playback clock; LastSample is the accepted transport-buffer tail and may be ahead of playback.
type ContinuousRecipe ¶
type ContinuousRecipe struct {
ID PatternID `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Spec FlowSpec `json:"spec"`
}
ContinuousRecipe is a distinct movement behavior, independent of pace. IDs and descriptions are also the compact model-facing action vocabulary.
func ContinuousRecipeByID ¶
func ContinuousRecipeByID(id PatternID, speed int) (ContinuousRecipe, bool)
ContinuousRecipeByID resolves only the reviewed canonical action IDs.
func ContinuousRecipes ¶
func ContinuousRecipes(speed int) []ContinuousRecipe
ContinuousRecipes returns fresh scores so callers cannot mutate the catalog.
type Curve ¶
type Curve struct {
// contains filtered or unexported fields
}
Curve is a validated time-parameterized sampler. Pattern curves use monotone cubic interpolation; media timelines preserve linear segments.
func NewCurve ¶
func NewCurve(points []CurvePoint, durationMillis int64, loop bool) (Curve, error)
NewCurve validates points and builds PCHIP-style wall-time derivatives. Authoring, preview, and budget measurement use unscaled playback; only the engine plan knows the speed and focus a curve will actually be played at.
func (Curve) Preview ¶
func (c Curve) Preview(intervalMillis int64) []CurvePoint
Preview returns backend-sampled points including the final endpoint.
type CurveMetrics ¶
type CurveMetrics struct {
MaxAccelerationPercentPerSecond2 float64 `json:"max_acceleration_percent_per_second2"`
MinReversalGapMillis int64 `json:"min_reversal_gap_ms"`
}
CurveMetrics exposes generator budget measurements for tests and diagnostics.
func MeasureCurve ¶
func MeasureCurve(points []CurvePoint, durationMillis int64, loop bool) (CurveMetrics, error)
MeasureCurve reports the wall-time acceleration and reversal spacing.
type CurvePoint ¶
type CurvePoint struct {
TimeMillis int64 `json:"time_ms"`
PositionPercent float64 `json:"position_percent"`
}
CurvePoint is one relative 0..100 motion sample at wall-clock time.
func ContinuousPatternPreview ¶
func ContinuousPatternPreview(id PatternID) ([]CurvePoint, int64, bool)
ContinuousPatternPreview samples the real playback plan at a declared reference pace; the library must not show a different PCHIP reconstruction.
func SmoothMediaReversals ¶
func SmoothMediaReversals(points []CurvePoint, minimumProminence float64) []CurvePoint
SmoothMediaReversals removes only small excursions with two short flanks. A large authored reversal beside a small spike remains an anchor. The fixed wall-time window is independent of how much script remains after a seek.
func StabilizePatternReversals ¶
func StabilizePatternReversals(points []CurvePoint, minimumProminence float64) []CurvePoint
StabilizePatternReversals removes rapid, insignificant extrema while preserving monotonic detail, endpoints, dwell timing, and slow subtle motion.
type DynamicAnchor ¶
type DynamicAnchor struct {
Name string `json:"name"`
PositionPercent int `json:"position_percent"`
}
DynamicAnchor is one semantic pass-through target in a model-authored loop.
type DynamicDefinition ¶
type DynamicDefinition struct {
CenterPercent int `json:"center_percent"`
SpanPercent int `json:"span_percent"`
SpanMinPercent int `json:"span_min_percent,omitempty"`
SpanProfile string `json:"span_profile,omitempty"`
PhraseSeed uint32 `json:"phrase_seed,omitempty"`
Anchors []DynamicAnchor `json:"anchors,omitempty"`
VariationPercent int `json:"variation_percent"`
SegmentSeconds int `json:"segment_seconds"`
Sections []DynamicSection `json:"sections,omitempty"`
// Experiment is opt-in Motion Lab intent. The production LLM contract does
// not accept it; ordinary Creative targets retain their existing behavior.
Experiment *DynamicExperiment `json:"experiment,omitempty"`
}
DynamicDefinition is bounded geometry authored by the LLM and compiled by the backend into ordinary MotionPlan content. It is not a transport payload.
func AdvanceDynamicPhraseSeed ¶
func AdvanceDynamicPhraseSeed(definition DynamicDefinition, previous uint32) DynamicDefinition
AdvanceDynamicPhraseSeed gives an explicitly replaced phrase fresh micro-timing while retaining deterministic replay from the authoritative target. The current seed is the entire novelty memory: no unbounded history or second motion model is introduced.
func FreshDynamicPhrase ¶
func FreshDynamicPhrase(definition DynamicDefinition, previous uint32) DynamicDefinition
FreshDynamicPhrase changes only the realization of an explicitly authored Creative phrase. Normalization and saved-target replay stay deterministic; speed-only edits retain the active phrase. No sample-time randomness is used.
func NormalizeDynamicDefinition ¶
func NormalizeDynamicDefinition(definition DynamicDefinition) DynamicDefinition
NormalizeDynamicDefinition returns concrete, bounded geometry suitable for engine sampling. Named anchors take precedence over center/span geometry.
type DynamicExperiment ¶
type DynamicExperiment struct {
RangeAnchorPercent int `json:"range_anchor_percent"`
OutboundTimePercent int `json:"outbound_time_percent"`
}
DynamicExperiment separates two expressive axes that the production variation control couples. Both affect authored intent before the ordinary C2 fit, runtime envelope, sampler, sanitizer and transport dispatch.
type DynamicSection ¶
type DynamicSection struct {
CenterPercent int `json:"center_percent"`
SpanPercent int `json:"span_percent"`
SpanMinPercent int `json:"span_min_percent,omitempty"`
SpanProfile string `json:"span_profile,omitempty"`
Anchors []DynamicAnchor `json:"anchors,omitempty"`
VariationPercent int `json:"variation_percent"`
Cycles int `json:"cycles"`
}
DynamicSection is one compact movement idea inside a Creative phrase. It deliberately uses the same semantic geometry as DynamicDefinition: the LLM selects a few bounded sections and deterministic code turns them into one smooth, loop-closed curve through the shared motion engine.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine owns one active semantic motion loop.
func NewEngine ¶
func NewEngine(options EngineOptions) (*Engine, error)
NewEngine creates a motion engine bound to one transport dispatcher.
func (*Engine) AdmissionGeneration ¶
AdmissionGeneration snapshots the Stop epoch used to reject work admitted before a concurrent Emergency Stop.
func (*Engine) ApplyTarget ¶
func (e *Engine) ApplyTarget(ctx context.Context, target MotionTarget, reason string) (ActiveMotionState, error)
ApplyTarget retargets active motion without stopping the active stream.
func (*Engine) ApplyTargetIfCurrent ¶
func (e *Engine) ApplyTargetIfCurrent(ctx context.Context, target MotionTarget, reason string, planID string) (ActiveMotionState, error)
ApplyTargetIfCurrent rejects a late semantic update after Stop/replacement, including one waiting behind another target operation. It never starts motion.
func (*Engine) ApplyVibration ¶
func (e *Engine) ApplyVibration(ctx context.Context, spec VibrationSpec, admission uint64) (ActiveMotionState, error)
ApplyVibration changes only the scalar envelope. It neither retargets the linear plan nor starts idle outputs; admission and Stop use the same engine.
func (*Engine) ApplyVibrationIfCurrent ¶
func (e *Engine) ApplyVibrationIfCurrent(ctx context.Context, spec VibrationSpec, admission, generation uint64) (ActiveMotionState, error)
ApplyVibrationIfCurrent rejects a delayed repair after any newer motion edit.
func (*Engine) Pause ¶
Pause stops dispatch and the device while freezing the plan phase, so Resume can continue the same pattern where it left off. It is not the safety path: Stop clears everything, Pause deliberately retains state.
func (*Engine) RefreshSettings ¶
func (e *Engine) RefreshSettings(ctx context.Context, settings config.MotionSettings, reason string) (ActiveMotionState, error)
RefreshSettings applies active speed, stroke-window, and direction updates.
func (*Engine) Resume ¶
Resume continues paused motion with the same target and preserved phase on a fresh stream.
func (*Engine) Snapshot ¶
func (e *Engine) Snapshot() ActiveMotionState
Snapshot returns the current active motion state.
func (*Engine) Start ¶
func (e *Engine) Start(ctx context.Context, target MotionTarget, settings config.MotionSettings) (ActiveMotionState, error)
Start begins continuous motion against the configured transport.
func (*Engine) StartAtGeneration ¶
func (e *Engine) StartAtGeneration(ctx context.Context, target MotionTarget, settings config.MotionSettings, admission uint64) (ActiveMotionState, error)
StartAtGeneration starts only when no Stop has occurred since admission.
type EngineOptions ¶
type EngineOptions struct {
Transport transport.Transport
Traces *diagnostics.TraceRing
Now func() time.Time
ChunkSize int
DispatchInterval time.Duration
SampleInterval time.Duration
StreamIDPrefix string
// ArchiveTrace is notified after a completed Stop and after all engine and
// transport locks are released. firstSequence identifies this run inside
// the shared sanitized trace ring. Archival failure must never fail Stop.
ArchiveTrace func(reason string, firstSequence uint64)
}
EngineOptions configures a motion engine instance.
type FlowExperiment ¶
FlowExperiment pairs a frozen semantic score with a comparison prompt.
func FlowExperiments ¶
func FlowExperiments(base FlowSpec) []FlowExperiment
FlowExperiments is the shared roster used by guided tests and visual review. It preserves the user's band, layers and sections while isolating new axes.
type FlowLayer ¶
type FlowLayer struct {
Axis string `json:"axis"`
AmountPercent int `json:"amount_percent"`
PeriodCycles int `json:"period_cycles"`
PhasePercent int `json:"phase_percent"`
Shape string `json:"shape,omitempty"`
// LowRatePercent optionally widens a pace layer's contrast. It is a
// fraction of the base travel rate, not a selected speed or device command.
// Zero keeps the historical half-rate envelope for existing/local scores.
LowRatePercent int `json:"low_rate_percent,omitempty"`
// Inverted reverses an envelope exactly, including unequal alternation
// dwells; a half-period phase shift is equivalent only for a simple wave.
Inverted bool `json:"inverted,omitempty"`
}
FlowLayer modulates an axis of the carrier; positions are never added or clipped. Convex envelopes keep all combinations inside the requested band.
type FlowPhrase ¶
type FlowPhrase struct {
Strokes []PhraseStroke `json:"strokes"`
}
FlowPhrase supplies counted pairs of lower and upper turns. It is semantic content for the same Layered joint fitter, plan, sampler and Stop. No device coordinates, timestamps, private playback or implicit rests exist.
type FlowPreview ¶
type FlowPreview struct {
Spec FlowSpec `json:"spec"`
Settings config.MotionSettings `json:"settings"`
SettingsKey string `json:"settings_key"`
Candidates []LabCandidate `json:"candidates"`
}
FlowPreview compares independent generators through the same engine plan.
func PreviewFlow ¶
func PreviewFlow(spec FlowSpec, settings config.MotionSettings, references bool) (FlowPreview, error)
PreviewFlow returns a new-framework plan with optional historical references.
type FlowSpec ¶
type FlowSpec struct {
Gesture *GestureSpec `json:"gesture,omitempty"`
// Phrase is an explicitly counted stroke motif inside Layered mode.
Phrase *FlowPhrase `json:"phrase,omitempty"`
// Strokes is an LLM Lab experiment; see StrokeSpec.
Strokes *StrokeSpec `json:"strokes,omitempty"`
// Freestyle is one window of the Freestyle mode's generated stream.
Freestyle *FreestyleSpec `json:"freestyle,omitempty"`
MinPercent int `json:"min_percent"`
MaxPercent int `json:"max_percent"`
SpeedPercent int `json:"speed_percent"`
RangeFloorPercent int `json:"range_floor_percent"`
RangeCeilingPercent int `json:"range_ceiling_percent,omitempty"`
AnchorPercent int `json:"anchor_percent"`
MemoryCycles int `json:"memory_cycles"`
PaceVariationPercent int `json:"pace_variation_percent"`
VariationMode string `json:"variation_mode,omitempty"`
TurnSoftnessPercent int `json:"turn_softness_percent,omitempty"`
CadenceHoldPercent int `json:"cadence_hold_percent,omitempty"`
Seed uint32 `json:"seed"`
LoopCycles int `json:"loop_cycles,omitempty"`
Steps []FlowStep `json:"steps,omitempty"`
Layers []FlowLayer `json:"layers,omitempty"`
}
FlowSpec describes semantic motion content: a continuous layered field or an explicitly selected generated-stroke grammar. All compile through the shared plan, safety fitter and sampler; values are never wire points.
func CloneFlowSpec ¶
CloneFlowSpec prevents edits or snapshots from aliasing an active score.
func DefaultFlowSpec ¶
func DefaultFlowSpec() FlowSpec
DefaultFlowSpec supplies a reproducible starting comparison.
func NewFreestyleFlow ¶
func NewFreestyleFlow(seed uint32, maxSpeedPercent int, window FreestyleSpec) FlowSpec
NewFreestyleFlow wraps one Freestyle window in the flow contract the engine compiles. The carrier fields are fixed; the window carries everything else. The seed identifies the stream and must not be zero.
type FlowStep ¶
type FlowStep struct {
MinPercent int `json:"min_percent"`
MaxPercent int `json:"max_percent"`
SpeedPercent int `json:"speed_percent"`
Cycles int `json:"cycles"`
}
FlowStep is a section of one continuous score, not a separate motion run.
type FreestyleControls ¶
type FreestyleControls struct {
// PacePercent places the pace inside the speed band.
PacePercent int `json:"pace_percent"`
// LengthPercent is the typical stroke length, short to full.
LengthPercent int `json:"length_percent"`
// FocusPercent is where strokes gather, 0 the base and 100 the tip.
FocusPercent int `json:"focus_percent"`
// RoamingPercent is how far the working region wanders from the focus.
RoamingPercent int `json:"roaming_percent"`
// VarietyPercent is how much pace, length and texture evolve; 0 repeats
// one even stroke.
VarietyPercent int `json:"variety_percent"`
AccentPercent int `json:"accent_percent"`
// EnergyPercent scales the pace for a session shape: 100 is the chosen
// pace and 0 the bottom of the speed band.
EnergyPercent int `json:"energy_percent"`
// TeasePercent draws strokes toward short, unhurried work at the tip.
TeasePercent int `json:"tease_percent"`
}
FreestyleControls are tendencies of the generated stream, not a pattern. Percentages run 0-100 except AccentPercent, which runs from -100 (faster toward the base) through 0 (even) to 100 (faster toward the tip).
func FreestyleControlsAt ¶
func FreestyleControlsAt(keyframes []FreestyleKeyframe, stroke int) FreestyleControls
FreestyleControlsAt returns the keyframed controls at a stream stroke, rounded to whole percentages, so a caller can start a new ramp from where the stream actually is.
type FreestyleKeyframe ¶
type FreestyleKeyframe struct {
Stroke int `json:"stroke"`
RampStrokes int `json:"ramp_strokes,omitempty"`
// Linear ramps join into a steady trend, as a session shape needs; other
// ramps ease in and out, as a control change should.
Linear bool `json:"linear,omitempty"`
Controls FreestyleControls `json:"controls"`
}
FreestyleKeyframe starts a ramp at a stroke, from wherever the controls are there to new values reached RampStrokes strokes later. Strokes before it are unaffected, so adding a keyframe ahead of the playhead never rewrites motion that is already queued.
func CompactFreestyleKeyframes ¶
func CompactFreestyleKeyframes(keyframes []FreestyleKeyframe, fromStroke int) []FreestyleKeyframe
CompactFreestyleKeyframes drops control history that can no longer affect strokes at or after fromStroke. A keyframe is folded into the starting state only once its ramp has settled before both fromStroke and the next ramp, so every stroke from fromStroke on is generated exactly as before.
type FreestyleProgress ¶
type FreestyleProgress struct {
Seed uint32 `json:"-"`
StartStroke int `json:"-"`
// EndStroke is one past the window's last stroke.
EndStroke int `json:"-"`
// PlayingStroke is the stroke the device is estimated to be playing.
PlayingStroke int `json:"-"`
// EditableStroke is the first stroke that starts far enough beyond the
// queued handoff that a new ramp there cannot touch queued motion.
EditableStroke int `json:"-"`
// RemainingMillis is the window time left after the playhead.
RemainingMillis int64 `json:"-"`
// StrokeMillis is the window's mean stroke duration.
StrokeMillis int64 `json:"-"`
}
FreestyleProgress locates the playhead in the running Freestyle window. It is backend planning state for the mode manager, never sent to clients.
type FreestyleSpec ¶
type FreestyleSpec struct {
// FromStroke is where the stream starts from rest. Strokes before it rest
// at its lower turn, so a fresh start eases in instead of joining a stroke
// already in flight.
FromStroke int `json:"from_stroke"`
// StartStroke is the stream index of this window's first stroke.
StartStroke int `json:"start_stroke"`
// Strokes is how many strokes this window plays.
Strokes int `json:"strokes"`
// EndStroke, when positive, ends the stream: the strokes before it wind
// down and the stream comes to rest at its lower turn.
EndStroke int `json:"end_stroke,omitempty"`
// MinSpeedPercent is the slowest pace; FlowSpec.SpeedPercent is the fastest.
MinSpeedPercent int `json:"min_speed_percent"`
// Keyframes ramp the controls along the stream. The first is the starting
// state; each later one starts a ramp at its stroke.
Keyframes []FreestyleKeyframe `json:"keyframes"`
}
FreestyleSpec is one window of Freestyle's endless generated stroke stream. Every stroke is a pure function of the stream seed, its index and the keyframed controls, so two windows that overlap produce identical strokes there and a continuation has nothing to blend. Windows never loop: the mode manager continues the stream well before a window ends, and an unattended window finishes and stops like any other finite program.
The stream is semantic content for the shared engine. It has no timers, no transport access and no device coordinates; the ordinary plan, sampler, sanitizer and Stop own playback.
type GestureSpec ¶
type GestureSpec struct {
FocusPercent int `json:"focus_percent"`
FocusWidthPercent int `json:"focus_width_percent"`
FocusMixPercent int `json:"focus_mix_percent"`
FocusRoamPercent int `json:"focus_roam_percent"`
FasterDirection string `json:"faster_direction"`
ContrastPercent int `json:"contrast_percent"`
InertiaPercent int `json:"inertia_percent"`
ReboundCount int `json:"rebound_count"`
ReboundDecayPercent int `json:"rebound_decay_percent"`
VariationPercent int `json:"variation_percent"`
}
GestureSpec generates stroke destinations and travel character, rather than superimposing position oscillators. It is semantic content for the shared engine: no timers, transport access, device coordinates or private playback.
func DefaultGestureSpec ¶
func DefaultGestureSpec() GestureSpec
DefaultGestureSpec is a neutral vocabulary starting point, not a named path.
type LabCandidate ¶
type LabCandidate struct {
Method string `json:"method"`
Target MotionTarget `json:"target"`
PeriodMillis int64 `json:"period_ms"`
Perceptual PerceptualSummary `json:"perceptual"`
OutboundTimePercent float64 `json:"outbound_time_percent"`
MaximumAcceleration float64 `json:"maximum_acceleration"`
MaximumJerk float64 `json:"maximum_jerk"`
Samples []LabSample `json:"samples"`
Flow *FlowSpec `json:"flow,omitempty"`
}
LabCandidate contains full-loop diagnostics and a fixed 12s excerpt.
type LabPreview ¶
type LabPreview struct {
Version int `json:"version"`
Request LabRequest `json:"request"`
Settings config.MotionSettings `json:"settings"`
SettingsKey string `json:"settings_key"`
PreviewMillis int64 `json:"preview_ms"`
Candidates []LabCandidate `json:"candidates"`
}
LabPreview is fully computed on the backend without creating an Engine, acquiring a controller, changing settings, or contacting a device.
func PreviewMotionLab ¶
func PreviewMotionLab(request LabRequest, settings config.MotionSettings) (LabPreview, error)
PreviewMotionLab compares identical source intent, seed and saved limits.
type LabRequest ¶
type LabRequest struct {
SpeedPercent int `json:"speed_percent"`
CenterPercent int `json:"center_percent"`
SpanPercent int `json:"span_percent"`
SpanMinPercent int `json:"span_min_percent"`
SpanProfile string `json:"span_profile"`
VariationPercent int `json:"variation_percent"`
RangeAnchorPercent int `json:"range_anchor_percent"`
OutboundTimePercent int `json:"outbound_time_percent"`
Seed uint32 `json:"seed"`
}
LabRequest is a bounded semantic experiment, never a timed-point API. Its seed permits matched, reproducible comparisons without hidden variation.
func (LabRequest) Target ¶
func (r LabRequest) Target(method string) (MotionTarget, error)
Target resolves a lab method through the same Creative semantic compiler.
type LabSample ¶
type LabSample struct {
TimeMillis int64 `json:"time_ms"`
PositionPercent float64 `json:"position_percent"`
VelocityPerSecond float64 `json:"velocity_percent_per_second"`
}
LabSample is a planned semantic position and a velocity estimate, not a wire point or measured device feedback. Transport fitting is deliberately excluded from the preview and still occurs normally during an audition.
type LabStart ¶
type LabStart struct {
Request LabRequest `json:"request"`
Method string `json:"method"`
SettingsKey string `json:"settings_key"`
Flow *FlowSpec `json:"flow,omitempty"`
}
LabStart binds an explicit audition to the settings used for preview.
type MediaRoundingEffect ¶
type MediaRoundingEffect struct {
RoundedCorners int `json:"rounded_corners"`
LimitedCorners int `json:"rounding_limited_corners"`
SkippedCorners int `json:"rounding_skipped_corners"`
PeakReductionPercent float64 `json:"peak_reduction_percent"`
PeakShiftMillis float64 `json:"peak_shift_ms"`
}
MediaRoundingEffect describes the compiled, optionally speed-limited curve. These are commanded geometry measurements, never physical-device telemetry.
type MediaTimelineDefinition ¶
type MediaTimelineDefinition struct {
ID string `json:"id"`
Name string `json:"name"`
DurationMillis int64 `json:"duration_ms"`
Points []CurvePoint `json:"points"`
// RoundingMillis is opt-in local C2 corner interpolation. The authored
// timestamps and linear bodies remain unchanged; zero is authored-exact.
RoundingMillis int `json:"rounding_ms,omitempty"`
}
MediaTimelineDefinition is finite, clock-locked motion authored against a media file. It is deliberately separate from ProgramDefinition: feature- length funscripts need a larger bound and linear interpolation, and they are never persisted in the pattern library.
func NormalizeMediaTimelineDefinition ¶
func NormalizeMediaTimelineDefinition(definition MediaTimelineDefinition) (MediaTimelineDefinition, error)
NormalizeMediaTimelineDefinition validates a bounded feature-length media curve without applying pattern-library normalization or loop closure.
type MotionPlan ¶
type MotionPlan struct {
ID string `json:"id"`
Target MotionTarget `json:"target"`
PatternID PatternID `json:"pattern_id,omitempty"`
ProgramID string `json:"program_id,omitempty"`
MediaID string `json:"media_id,omitempty"`
PeriodMillis int64 `json:"period_ms"`
HandoffMillis int64 `json:"handoff_ms"`
PhaseOffset float64 `json:"phase_offset"`
PhasePreserved bool `json:"phase_preserved"`
Loop bool `json:"loop"`
CreatedAt string `json:"created_at"`
Perceptual PerceptualSummary `json:"perceptual"`
// contains filtered or unexported fields
}
MotionPlan is repeatable or finite semantic content sampled over stream time.
func NewMotionPlan ¶
func NewMotionPlan( id string, target MotionTarget, settings config.MotionSettings, phaseOffset float64, handoffMillis int64, createdAt time.Time, ) MotionPlan
NewMotionPlan returns a normalized plan for a target.
func (MotionPlan) CompleteAt ¶
func (p MotionPlan) CompleteAt(streamMillis int64) bool
CompleteAt reports whether finite program content reached its final point.
func (MotionPlan) DirectionAt ¶
func (p MotionPlan) DirectionAt(streamMillis int64) int
DirectionAt estimates current semantic travel direction.
func (MotionPlan) PhaseAt ¶
func (p MotionPlan) PhaseAt(streamMillis int64) float64
PhaseAt returns semantic phase at the given stream-relative time.
func (MotionPlan) Retarget ¶
func (p MotionPlan) Retarget( id string, target MotionTarget, settings config.MotionSettings, streamMillis int64, createdAt time.Time, ) MotionPlan
Retarget returns a replacement plan, preserving phase for the same content.
func (MotionPlan) SampleAt ¶
func (p MotionPlan) SampleAt(streamMillis int64) MotionSample
SampleAt samples the plan at the given stream-relative time.
func (MotionPlan) VelocityAt ¶
func (p MotionPlan) VelocityAt(streamMillis int64) float64
VelocityAt estimates played semantic velocity in percent per second. It is used only to choose a smooth retarget phase; transports still receive the normal sampled plan.
type MotionSample ¶
type MotionSample struct {
PlanID string `json:"plan_id"`
PatternID PatternID `json:"pattern_id,omitempty"`
ProgramID string `json:"program_id,omitempty"`
MediaID string `json:"media_id,omitempty"`
PositionPercent float64 `json:"position_percent"`
TimeMillis int64 `json:"time_ms"`
Phase float64 `json:"phase"`
}
MotionSample is one transport-neutral semantic sample.
type MotionTarget ¶
type MotionTarget struct {
Vibration *VibrationSpec `json:"vibration,omitempty"`
VibrationOnly bool `json:"vibration_only,omitempty"`
Label string `json:"label,omitempty"`
Source string `json:"source,omitempty"`
PatternID PatternID `json:"pattern_id,omitempty"`
PatternName string `json:"pattern_name,omitempty"`
ProgramID string `json:"program_id,omitempty"`
MediaID string `json:"media_id,omitempty"`
SpeedPercent int `json:"speed_percent"`
MediaSpeedLimitEnabled bool `json:"media_speed_limit_enabled,omitempty"`
// Derived compact geometry survives snapshots without copying media points.
MediaRoundingEffect MediaRoundingEffect `json:"-"`
AreaFocus *AreaFocus `json:"area_focus,omitempty"`
SoftAnchor *SoftAnchor `json:"soft_anchor,omitempty"`
Dynamic *DynamicDefinition `json:"dynamic,omitempty"`
Flow *FlowSpec `json:"flow,omitempty"`
// Resolved content is backend-owned and never serialized to clients. The
// public IDs above remain the authoritative snapshot vocabulary.
Pattern *PatternDefinition `json:"-"`
Program *ProgramDefinition `json:"-"`
Media *MediaTimelineDefinition `json:"-"`
// contains filtered or unexported fields
}
MotionTarget is the app-level semantic motion intent.
func FlowTarget ¶
func FlowTarget(spec FlowSpec, settings config.MotionSettings) (MotionTarget, error)
FlowTarget compiles the score once into immutable kinematic content. The ordinary engine owns playback, live limit changes, handoffs and Stop.
func HoldingTarget ¶
func HoldingTarget(state ActiveMotionState, settings config.MotionSettings) (MotionTarget, error)
HoldingTarget is deliberately cheap and independent of inference. Keep the familiar working region, soften the turns, and reduce pace inside saved limits.
func NormalizeTarget ¶
func NormalizeTarget(target MotionTarget, settings config.MotionSettings) MotionTarget
NormalizeTarget clamps semantic intent without applying physical stroke settings.
type PaceSummary ¶
type PaceSummary struct {
RequestedPercent int `json:"requested_percent"`
EffectivePercent float64 `json:"effective_percent"`
RequestedMeanTravelPerSecond float64 `json:"requested_mean_travel_percent_per_second"`
PlannedPercent float64 `json:"planned_percent,omitempty"`
PlannedMeanTravelPerSecond float64 `json:"planned_mean_travel_percent_per_second,omitempty"`
CommandedMeanTravelPerSecond float64 `json:"commanded_mean_travel_percent_per_second"`
CommandedPeakVelocityPerSecond float64 `json:"commanded_peak_velocity_percent_per_second"`
DevicePeakVelocityPerSecond float64 `json:"device_peak_velocity_percent_per_second"`
Limited bool `json:"limited"`
Limiters []string `json:"limiters,omitempty"`
}
PaceSummary explains how the selected Creative percentage became the final transport-neutral trajectory. RequestedPercent is the control value; EffectivePercent is the calibrated equivalent of commanded mean travel. Limiters are observational diagnostics and never alter model authority.
type PatternDefinition ¶
type PatternDefinition struct {
ID PatternID `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Kind string `json:"kind"`
CycleMillis int64 `json:"cycle_ms"`
Points []CurvePoint `json:"points"`
Tags []string `json:"tags,omitempty"`
// contains filtered or unexported fields
}
PatternDefinition is reusable loop content. Positions are always relative and are projected into the configured stroke window only by the transport.
func BuiltinPatternDefinition ¶
func BuiltinPatternDefinition(id PatternID) (PatternDefinition, bool)
BuiltinPatternDefinition resolves one generated built-in pattern.
func BuiltinPatternDefinitions ¶
func BuiltinPatternDefinitions() []PatternDefinition
BuiltinPatternDefinitions returns the parametrically generated catalog.
func ContinuousPatternDefinition ¶
func ContinuousPatternDefinition(id PatternID) (PatternDefinition, bool)
ContinuousPatternDefinition supplies canonical content to the durable library.
func NormalizePatternDefinition ¶
func NormalizePatternDefinition(definition PatternDefinition) (PatternDefinition, error)
NormalizePatternDefinition validates, closes, and floor-stretches loop data.
func PromotedBuiltinPatternDefinitions ¶
func PromotedBuiltinPatternDefinitions() []PatternDefinition
PromotedBuiltinPatternDefinitions returns defensive copies of user-tested curves promoted into the catalog.
type PatternID ¶
type PatternID string
PatternID identifies a repeatable semantic motion pattern.
const ( // PatternFullSweeps is the default continuous full-band carrier. PatternFullSweeps PatternID = "flow-full-sweeps" // PatternBaseVariation varies reach while retaining the lower return. PatternBaseVariation PatternID = "flow-base-anchored" // PatternPaceWave varies pace without changing full-band geometry. PatternPaceWave PatternID = "flow-pace-wave" // TagDeprecated identifies retired built-ins retained only for export. TagDeprecated = "deprecated" )
const ( // PatternStroke is the default full-stroke triangle pattern. PatternStroke PatternID = "stroke" // PatternPulse is a fixed double-peak pattern. PatternPulse PatternID = "pulse" // PatternTease is a fixed shallow-to-deep pattern. PatternTease PatternID = "tease" // PatternWaves identifies a retired swelling-amplitude pattern. PatternWaves PatternID = "waves" // PatternClimb identifies a retired ratcheting-build pattern. PatternClimb PatternID = "climb" // PatternFlutter identifies a retired shallow-flutter-with-sweep pattern. PatternFlutter PatternID = "flutter" // PatternSway identifies a retired asymmetric broad-arc pattern. PatternSway PatternID = "sway" // PatternDrift migrates a consistent stroke window across a cycle. PatternDrift PatternID = "drift" // PatternDoubleTap identifies a retired paired-accent pattern. PatternDoubleTap PatternID = "double-tap" // PatternCascade identifies a retired descending-peak pattern. PatternCascade PatternID = "cascade" // PatternPendulum identifies a retired alternating centered-arc pattern. PatternPendulum PatternID = "pendulum" // PatternCradle identifies the retired restrained centered-arcs pattern. PatternCradle PatternID = "cradle" // PatternSurge identifies a retired decaying-echo pattern. PatternSurge PatternID = "surge" // PatternRolling identifies a retired layered medium-and-deep pattern. PatternRolling PatternID = "rolling" // PatternSyncopate identifies a retired uneven-rhythm pattern. PatternSyncopate PatternID = "syncopate" // PatternFourLevelCircuit cycles full and partial strokes across both zones. PatternFourLevelCircuit PatternID = "four-level-circuit" // PatternHighLowBlocks identifies retired grouped upper/lower zone pulses. PatternHighLowBlocks PatternID = "high-low-blocks" // PatternDeepShallowSequence identifies a retired upper-anchored sequence. PatternDeepShallowSequence PatternID = "deep-shallow-sequence" // PatternShortMediumSteps identifies a retired lower-anchored step pattern. PatternShortMediumSteps PatternID = "short-medium-steps" // PatternTopAnchoredDepths identifies a retired upper-return catalog pattern. PatternTopAnchoredDepths PatternID = "top-anchored-depths" // PatternDeepBookends identifies a retired lower-return catalog pattern. PatternDeepBookends PatternID = "deep-bookends" // PatternOneDeepThreeShallow identifies a retired shallow-pulse catalog pattern. PatternOneDeepThreeShallow PatternID = "one-deep-three-shallow" // PatternLowerMidrangeMix identifies a retired lower-midrange catalog pattern. PatternLowerMidrangeMix PatternID = "lower-midrange-mix" // PatternMidTopSwitch identifies a retired upper-pulse catalog pattern. PatternMidTopSwitch PatternID = "mid-top-switch" // PatternSlowFastFull changes from slow full strokes to fast full strokes. PatternSlowFastFull PatternID = "slow-fast-full" // PatternMidrangeFullFinish identifies a retired repeated-midrange pattern. PatternMidrangeFullFinish PatternID = "midrange-full-finish" // PatternDeepPartialSequence mixes full and partial lower-anchored strokes. PatternDeepPartialSequence PatternID = "deep-partial-sequence" // PatternDeepMediumShortPairs identifies a retired paired reach-band pattern. PatternDeepMediumShortPairs PatternID = "deep-medium-short-pairs" // PatternFallingCrest identifies a retired lowering-reversal pattern. PatternFallingCrest PatternID = "falling-crest" // PatternThreeDeepOneShort identifies a retired grouped broad-stroke pattern. PatternThreeDeepOneShort PatternID = "three-deep-one-short" // PatternDescendingLadder identifies a retired stepped-endpoint pattern. PatternDescendingLadder PatternID = "descending-ladder" // PatternWanderingSwell identifies a retired migrating center-and-reach pattern. PatternWanderingSwell PatternID = "wandering-swell" // PatternRisingReach progressively extends alternating upper reversals. PatternRisingReach PatternID = "rising-reach" // PatternHardAndRegular is a promoted user-curated full-range rhythm. PatternHardAndRegular PatternID = "hard-and-regular" // PatternPlayfulJerk is a promoted user-curated staggered full-range rhythm. PatternPlayfulJerk PatternID = "playful-jerk" // PatternEasingDown steps the whole stroke window lower at a held pace. PatternEasingDown PatternID = "easing-down" // PatternBuildingUp steps the whole stroke window higher at a held pace. PatternBuildingUp PatternID = "building-up" // PatternBroadAndTight identifies a retired wide/tight contrast pattern. PatternBroadAndTight PatternID = "broad-and-tight" // PatternUpperAccents keeps quick accents in the upper range. PatternUpperAccents PatternID = "upper-accents" // PatternLowerAccents identifies a retired lower-range accent pattern. PatternLowerAccents PatternID = "lower-accents" // PatternSteadyDrift holds one pace while the window wanders. PatternSteadyDrift PatternID = "steady-drift" // PatternOffbeat breaks even strokes with one displaced deeper reach. PatternOffbeat PatternID = "offbeat" // PatternNarrowing converges stroke width toward the center. PatternNarrowing PatternID = "narrowing" // PatternOpeningUp diverges stroke width away from the center. PatternOpeningUp PatternID = "opening-up" // PatternLongReturn pairs a quick reach with an unhurried return. PatternLongReturn PatternID = "long-return" // PatternSwell carries the window up and back across one long arc. PatternSwell PatternID = "swell" // PatternRocking repeats one even mid-range stroke at a fixed pace. PatternRocking PatternID = "rocking" // PatternSurgeAndSettle follows one full sweep with a long settled run. PatternSurgeAndSettle PatternID = "surge-and-settle" // PatternThreeAndOne identifies a retired grouped upper/full-range pattern. PatternThreeAndOne PatternID = "three-and-one" // PatternCrosscut trades long blocks of broad and tight strokes. PatternCrosscut PatternID = "crosscut" )
func RetiredBuiltinPatternIDs ¶
func RetiredBuiltinPatternIDs() []PatternID
RetiredBuiltinPatternIDs returns catalog IDs removed after physical feedback.
type PerceptualSummary ¶
type PerceptualSummary struct {
PositionMinPercent float64 `json:"position_min_percent"`
PositionMaxPercent float64 `json:"position_max_percent"`
MeanStrokePercent float64 `json:"mean_stroke_percent"`
StrokeLengthCV float64 `json:"stroke_length_cv"`
MinimumLocalStrokeCV float64 `json:"minimum_local_stroke_cv"`
MinimumLocalStrokeRange float64 `json:"minimum_local_stroke_range_percent"`
CommandedMeanTravelPerSecond float64 `json:"commanded_mean_travel_percent_per_second"`
CommandedPeakVelocityPerSecond float64 `json:"commanded_peak_velocity_percent_per_second"`
AnchorCount int `json:"anchor_count"`
SectionCount int `json:"section_count"`
SpanProfile string `json:"span_profile,omitempty"`
Pace PaceSummary `json:"pace"`
Turns TurnCoverage `json:"turn_coverage"`
}
PerceptualSummary is a compact description of the curve that the shared engine actually commands after speed calibration and safety fitting. It contains no transport payload and is safe to expose to the mode planner and diagnostics without retaining raw curve points.
func (PerceptualSummary) MateriallyDifferent ¶
func (s PerceptualSummary) MateriallyDifferent(other PerceptualSummary) bool
MateriallyDifferent reports whether two commanded curves differ enough to count as a new felt phrase. It is deliberately one normalized perceptual distance rather than a list of schema-field exceptions. Speed is absent: the scheduler already tracks pace age independently.
type PhraseStroke ¶
type PhraseStroke struct {
BottomPercent int `json:"bottom_percent"`
TopPercent int `json:"top_percent"`
Count int `json:"count"`
RatePercent int `json:"rate_percent"`
}
PhraseStroke contributes Count lower/upper turn pairs, directly joined to the preceding upper turn. Shared descents belong to the narrowest adjacent group containing the whole leg; otherwise they use the destination's rate. RatePercent is a fraction of the score's selected travel rate, not a second absolute speed. The model selects reach; there is no built-in tip width.
type PlanningEnvelope ¶
type PlanningEnvelope struct {
PositionMinPercent int `json:"position_min_percent"`
PositionMaxPercent int `json:"position_max_percent"`
ProfilePeakVelocityPerSecond float64 `json:"profile_peak_velocity_percent_per_second"`
}
PlanningEnvelope exposes the current semantic coordinate system and the profile-derived velocity ceiling. It is a planning reference, not telemetry. Physical stroke-window mapping and final curve fitting stay in the engine.
func CurrentPlanningEnvelope ¶
func CurrentPlanningEnvelope(settings config.MotionSettings) PlanningEnvelope
CurrentPlanningEnvelope derives values from the same profile as the shared sampler; callers need no knowledge of hardware names or version differences.
type ProgramDefinition ¶
type ProgramDefinition struct {
ID string `json:"id"`
Name string `json:"name"`
DurationMillis int64 `json:"duration_ms"`
Points []CurvePoint `json:"points"`
}
ProgramDefinition is finite, non-looping motion content.
func NormalizeProgramDefinition ¶
func NormalizeProgramDefinition(definition ProgramDefinition) (ProgramDefinition, error)
NormalizeProgramDefinition validates finite program content without looping it.
type SoftAnchor ¶
type SoftAnchor struct {
PositionPercent int `json:"position_percent"`
WeightPercent int `json:"weight_percent"`
}
SoftAnchor gently biases sampled positions toward one semantic point.
type StrokeAccent ¶
StrokeAccent is a short motif that appears at a seeded rate.
type StrokeSpec ¶
type StrokeSpec struct {
Bottom StrokeTurn `json:"bottom"`
Top StrokeTurn `json:"top"`
// Accents are at most three distinct motifs.
Accents []StrokeAccent `json:"accents,omitempty"`
// VariationPercent lets timing breathe from stroke to stroke; 0 repeats
// every stroke's timing exactly.
VariationPercent int `json:"variation_percent"`
}
StrokeSpec is an LLM Lab experiment that describes continuous motion by where each stroke turns, in absolute slider positions: its bottom turn, how deep the stroke goes (0 is the base), and its top turn, how close to the tip it turns. Each turn has a usual position, a position it may go instead, and a character for how it moves between them. Accents are short motifs woven into the stream at a seeded rate. The shared joint leg fit times the strokes, as it does for Creative v2, so the ordinary plan, sampler and Stop own playback.
type StrokeTurn ¶
type StrokeTurn struct {
// AtPercent is the usual turning point, 0 the base and 100 the tip.
AtPercent int `json:"at_percent"`
// VaryToPercent is where the turn goes instead, deeper or shallower. It
// equals AtPercent when the turn holds still.
VaryToPercent int `json:"vary_to_percent"`
// Character is how the turn moves between the two positions.
Character string `json:"character"`
}
StrokeTurn is one turning point of every stroke.
type TurnCoverage ¶
type TurnCoverage struct {
LowerPercentiles [3]float64 `json:"lower_p10_p50_p90"`
UpperPercentiles [3]float64 `json:"upper_p10_p50_p90"`
BaseFraction float64 `json:"lower_within_one_of_base_fraction"`
TipFraction float64 `json:"upper_within_one_of_tip_fraction"`
LowerCount int `json:"lower_count"`
UpperCount int `json:"upper_count"`
}
TurnCoverage separates one isolated endpoint visit from typical stroke reach. Fractions describe compiled turns, never measured carriage position.
type VibrationSpec ¶
type VibrationSpec struct {
Mode string `json:"mode"`
MinPercent int `json:"min_percent"`
MaxPercent int `json:"max_percent"`
PeriodSeconds float64 `json:"period_seconds"`
}
VibrationSpec is drive in percent of the user's Max (ADR 0061), never a hardware level or permission to raise Max. It drives all motors. Follow may carry a range: min_percent is the floor and max_percent the strength while vibration follows movement; all zeros follow at the vibrator's own level.
func (VibrationSpec) Validate ¶
func (s VibrationSpec) Validate() error
Validate rejects malformed envelopes without changing their requested shape.
Source Files
¶
- content.go
- content_curated.go
- continuous_catalog.go
- curated_builtin.go
- curve_hygiene.go
- dispatch.go
- doc.go
- dynamic.go
- dynamic_timing.go
- dynamic_variation.go
- engine.go
- flow.go
- flow_curve.go
- flow_experiments.go
- flow_interior_transition.go
- flow_join_budget.go
- flow_layers.go
- flow_phrase.go
- flow_phrase_transition.go
- flow_preview.go
- flow_shape_transition.go
- flow_target.go
- flow_timing.go
- flow_transition.go
- flow_turns.go
- freestyle.go
- freestyle_strokes.go
- freestyle_window.go
- gesture.go
- gesture_cruise.go
- gesture_curve.go
- gesture_field.go
- gesture_handoff.go
- gesture_phrasing.go
- gesture_timing.go
- holding.go
- lab.go
- lab_timing.go
- media_rounding.go
- perceptual.go
- plan.go
- planning_envelope.go
- prepared.go
- quintic.go
- reversal_filter.go
- reversal_profile.go
- sampling.go
- sampling_policy.go
- sampling_refine.go
- sampling_timing.go
- startup.go
- stroke_score.go
- target.go
- trace.go
- transition.go
- turn_coverage.go
- vibration.go