Create a new root context.
Optionalgas: numberComputational budget for evaluating the program.
Values that depend on the current root pitch or up/lift inflections.
The remaining computational budget.
Values passed to a tagged template literal converted to types understood by the SonicWeave runtime.
Title of the scale.
Current tracking ID.
OptionalunisonAbsolute frequency associated with 1/1 (linear) or P1 (logarithmic perfect unison).
Create an independent clone of the context useable as a cache of runtime state.
A RootContext in the same state as this one.
Convert the state of this context into a block of text in the SonicWeave DSL.
Root context for determining if the root pitch etc. has changed.
A string that when evaluated should recreate the same runtime context.
Obtain the next free tracking ID and advance the counter.
An identifier for tracking the evolution of a Interval instance.
Serialize the context to a JSON compatible object.
WARNING: Template arguments or "fragile" dependencies are not serialized.
A revived context is mainly intended to make stdlib.public functions work without full source code re-evaluation.
The serialized object with property type set to 'RootContext'.
StaticreviverRevive a RootContext instance produced by RootContext.toJSON(). Return everything else as is.
Intended usage:
const data = JSON.parse(serializedData, RootContext.reviver);
Property name.
Property value.
Deserialized RootContext instance or other data without modifications.
Root context of a SonicWeave runtime containing the scale title, root pitch, value of the 'up' inflection etc.