import { TimeMonzo, TimeReal } from './monzo'; /** * Step count vector indexed by strings representing distinct step sizes. */ export type StepVector = Record; /** * Create a new empty step vector with all counts implicitly zero. * @returns The additive identity element. */ export declare function zeroVector(): StepVector; /** * Add two {@link StepVector} instances. * @param v1 Fist step vector. * @param v2 Second step vector. * @returns The sum of the step vectors. */ export declare function add(v1: StepVector, v2: StepVector): StepVector; /** * Multiply a step vector by a scalar. * @param v Step vector to scale. * @param scalar A scalar to scale by. * @returns The vector multiplied by the given scalar. */ export declare function scalarMult(v: StepVector, scalar: number): StepVector; /** * Obtain the additive inverse of a {@link StepVector} instance. * @param v Step vector to negate. * @returns The negated step vector. */ export declare function neg(v: StepVector): StepVector; /** * Subtract two {@link StepVector} instances. * @param v1 Step vector to subtract from. * @param v2 Step vector to subtract. * @returns Difference of the step vectors. */ export declare function sub(v1: StepVector, v2: StepVector): StepVector; /** * Rotate a string by moving it by the given offset. * @param str String to rotate. * @param offset Offset to rotate by. * @returns The rotated string. */ export declare function rotate(str: string, offset: number): string; /** * Obtain the step vector associated it the given interval class of the given word. * @param word A mode of a (periodic) scale given as a string where each character represents a (geometric) step. * @param intervalClass Which subtension from root position to calculate (defaults to the whole word). * @returns A {@link StepVector} instance representing the interval class in terms of the word characters. */ export declare function getStepVector(word: string, intervalClass?: number): StepVector; /** * Calculate the step signature of an entire scale word. * @param word A (periodic) scale given as a string where each character represents a (geometric) step. * @returns A {@link StepVector} instance representing the size of the entire scale. */ export declare function stepSignature(word: string): StepVector; /** * Compute the interval matrix a.k.a. the modes of a scale in terms of {@link StepVector} instances. * @param word A (periodic) scale given as a string where each character represents a (geometric) step. * @returns An array of arrays of {@link StepVector} instances representing the modes of the scale (j-step on mode i). */ export declare function stepVectorMatrix(word: string): StepVector[][]; /** * Return the number of distinct letters in a word. * @param word A word usually representing a scale where each character represents a step. * @returns The number of distinct steps in the scale. */ export declare function wordArity(word: string): number; /** * Return the number of distinct letters in a step vector. * @param sv Step vector to measure. * @returns Arity of the step vector. */ export declare function stepVectorArity(sv: StepVector): number; /** * Return the set of letters representing scale steps, sorted in ASCII order. * @param sv Step vector to extract letters from. * @returns Letters with non-zero count in the step vector. */ export declare function letters(sv: StepVector): string[]; /** * Return the taxicab norm of a step vector, the sum of the absolute values of the components. * @param sv Step vector to measure. * @returns Size of the step vector. */ export declare function norm(sv: StepVector): number; /** * Break a scale with implicit unison into an implicitly repeating scale word. * @param monzos Relative monzos representing intervals of the scale. * @returns A scale word where each character represents a step of distinct size. */ export declare function stepString(monzos: (TimeMonzo | TimeReal)[]): string;