[RFC] Single-file multi-axis

Funscript 2.0

Valid funscripts have the following format

type axis = 'stroke' | '...';
interface Action {
  at: number // 0.-1e9.
  pos: number // 0.00-100.00
}
interface Channel {
  // sorted by .at
  // L/R axes may not have two points with same .at
  // other can have two but not more
  actions: Action[]
  // effective values of pos units, in L0 or deg units
  // defaults to 0-100 for L0, +-25 for L12 and +-15 +-25 +-120 for R012(iirc) (so SR6 scale)
  // compatible with legacy scripts that had [5, 95] - they should be upscaled lol
  // implicitly allows scaling/inverting
  range?: [number, number]
}
interface Script extends Channel {
  version: "funscript@2.0.0-alpha.1"
  metadata?: Partial<Metadata>
  // for L0 axis
  actions: Action[]
  channels?: {
    // stroke channel overrides script.actions for multi-axis devices
    stroke?: Channel
    [axis in axis]?: Channel
  }
  // proposed:
  // chapters: Record<string, Chapter> 
}
// all properties optional
interface Metadata {
  title: string
  duration: number // .000 in seconds
  // proposed: durationTime: timeStamp
  
  // sorted by startTime
  // may cross over
  chapters: Chapter[]
  // auto inferredfrom topic tags
  tags: string[]
  // auto inferred from topic
  author: string
  // official link to sauce (not to reuploads)
  videoSourceUrl: string
}
type timeStamp = string // "hh:mm:ss.uuu"
interface Chapter {
  startTime: timeStamp
  endTime: timeStamp
  name: string
  // proposed to replace with:
  // startAt: number
  // endAt: number
}

Intermediate script format has following differences:

  • allows negative at
  • at precision at least .2f
  • at allows UTC numbers (for recordings)
  • pos may be out of 0-100 range

@Yoooi @Khrull thoughts?