@tremolo-ui/functions 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2,35 +2,58 @@
2
2
  /**
3
3
  * clamp value between min and max
4
4
  */
5
- declare function clamp(value: number, min: number, max: number): number;
5
+ export declare function clamp(value: number, min: number, max: number): number;
6
6
  /**
7
7
  * Normalize the value from 0 to 1, spreading the range evenly.
8
8
  *
9
9
  * This is the linear mapping and takes no curve of its own; a `Scale` builds
10
10
  * whatever curve it needs on top of it.
11
11
  */
12
- declare function normalizeValue(value: number, min: number, max: number): number;
12
+ export declare function normalizeValue(value: number, min: number, max: number): number;
13
13
  /**
14
14
  * Convert normalized values back to raw values, spreading the range evenly.
15
15
  *
16
16
  * The inverse of {@link normalizeValue}.
17
17
  */
18
- declare function rawValue(normalizedValue: number, min: number, max: number): number;
19
- declare function stepValue(value: number, step: number): number;
20
- declare function toFixed(x: number, fractionDigits?: number): number;
21
- declare function integerPart(x: number | string): string | undefined;
22
- declare function decimalPart(x: number | string): string | undefined;
23
- declare function radian(degree: number): number;
24
- declare function degree(radian: number): number;
25
- declare function mapValue(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
26
- declare function dbToGain(db: number): number;
27
- declare function gainToDb(gain: number): number;
28
- //#endregion
29
- //#region src/types.d.ts
18
+ export declare function rawValue(normalizedValue: number, min: number, max: number): number;
30
19
  /**
31
- * Options for setting the amount of keyboard and mouse wheel changes.
20
+ * Put a value on the grid the caller asked for, rounding a half step upwards.
21
+ *
22
+ * The rounding is done on the quotient rather than by comparing the distance
23
+ * to the two neighbours, because both of those carry error of their own. The
24
+ * quotient is cleared of its artefact first: `0.15 / 0.1` is 1.4999999999999998,
25
+ * and a value sitting exactly on a half step would otherwise fall to whichever
26
+ * side the last bit happened to land on — 0.25 rounded up while 0.15 and 0.35
27
+ * rounded down.
32
28
  */
33
- type InputEventOption = ['normalized' | 'raw', number];
29
+ export declare function stepValue(value: number, step: number): number;
30
+ export declare function toFixed(x: number, fractionDigits?: number): number;
31
+ /**
32
+ * Drop the binary artefact from a computed value.
33
+ *
34
+ * Arithmetic on doubles leaves debris in the last couple of digits, and it
35
+ * accumulates: adding 0.1 to 5 twelve times gives 5.699999999999998 rather
36
+ * than 5.7, and the display of a control shows exactly that. Rounding to the
37
+ * digits a double can carry removes it, and adds nothing back — the value was
38
+ * already the result of a calculation whose own error is that size or larger.
39
+ *
40
+ * This is not the same as rounding to a `step`. {@link stepValue} puts a value
41
+ * on a grid the caller asked for and is a decision about the value; this only
42
+ * removes what was never in the value to begin with.
43
+ *
44
+ * @param significantDigits how many digits to keep. The default is the only
45
+ * one that is purely artefact removal; a smaller number starts discarding real
46
+ * precision.
47
+ *
48
+ * @example
49
+ * toPrecision(5.1 + 0.1) // 5.2, rather than 5.199999999999999
50
+ */
51
+ export declare function toPrecision(x: number, significantDigits?: number): number;
52
+ export declare function radian(degree: number): number;
53
+ export declare function degree(radian: number): number;
54
+ export declare function mapValue(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
55
+ export declare function dbToGain(db: number): number;
56
+ export declare function gainToDb(gain: number): number;
34
57
  //#endregion
35
58
  //#region src/scales.d.ts
36
59
  /**
@@ -60,7 +83,7 @@ interface Scale {
60
83
  * The right default for anything already linear in perception: dB values,
61
84
  * pan, percentages, MIDI note numbers, semitones.
62
85
  */
63
- declare const linearScale: Scale;
86
+ export declare const linearScale: Scale;
64
87
  /**
65
88
  * The power law of JUCE's `NormalisableRange::skew`, applied to `value - min`.
66
89
  *
@@ -77,12 +100,12 @@ declare const linearScale: Scale;
77
100
  *
78
101
  * @param skew the JUCE skew factor
79
102
  */
80
- declare function skewScale(skew: number): Scale;
103
+ export declare function skewScale(skew: number): Scale;
81
104
  /**
82
105
  * The skew factor for {@link skewScale} that puts `centerValue` at the middle
83
106
  * of the travel — JUCE's `NormalisableRange::setSkewForCentre`.
84
107
  */
85
- declare function skewWithCenterValue(centerValue: number, min: number, max: number): number;
108
+ export declare function skewWithCenterValue(centerValue: number, min: number, max: number): number;
86
109
  /**
87
110
  * Equal travel gives an equal *ratio*, so an octave — or a percentage — takes
88
111
  * the same distance wherever it falls.
@@ -94,7 +117,7 @@ declare function skewWithCenterValue(centerValue: number, min: number, max: numb
94
117
  * ratio reaches zero or crosses it. Use {@link curveScale} for a range that
95
118
  * starts at 0.
96
119
  */
97
- declare const exponentialScale: Scale;
120
+ export declare const exponentialScale: Scale;
98
121
  /**
99
122
  * An exponential bend that still passes exactly through `min` and `max`, so
100
123
  * unlike {@link exponentialScale} it works on a range that starts at 0 or
@@ -116,7 +139,7 @@ declare const exponentialScale: Scale;
116
139
  *
117
140
  * @param curve how hard the curve bends, and in which direction
118
141
  */
119
- declare function curveScale(curve: number): Scale;
142
+ export declare function curveScale(curve: number): Scale;
120
143
  /**
121
144
  * {@link skewScale} mirrored about the middle of the range, so both halves
122
145
  * bend the same way — JUCE's `symmetricSkew`.
@@ -129,12 +152,12 @@ declare function curveScale(curve: number): Scale;
129
152
  *
130
153
  * @param skew the JUCE skew factor
131
154
  */
132
- declare function symmetricSkewScale(skew: number): Scale;
155
+ export declare function symmetricSkewScale(skew: number): Scale;
133
156
  /**
134
157
  * The curve for {@link curveScale} that puts `centerValue` at the middle of
135
158
  * the travel — the counterpart of {@link skewWithCenterValue}.
136
159
  */
137
- declare function curveWithCenterValue(centerValue: number, min: number, max: number): number;
160
+ export declare function curveWithCenterValue(centerValue: number, min: number, max: number): number;
138
161
  /**
139
162
  * How a value is scaled: the range it lives in, how it is rounded, and how it
140
163
  * is distributed across the travel.
@@ -156,33 +179,13 @@ interface ValueRange {
156
179
  */
157
180
  scale?: Scale;
158
181
  }
159
- /**
160
- * Move a value by an amount of input, as reported by a wheel or an arrow key.
161
- *
162
- * The pipeline matches `createDragValue` of `@tremolo-ui/dom`: scale, then
163
- * step, then clamp. Which key or which sign of `deltaY` counts as which
164
- * direction is left to the caller, since it differs per component.
165
- *
166
- * @param direction which way, and how many times, to apply the option. The
167
- * size of one step is `option[1]`, so this is normally `1` or `-1`.
168
- *
169
- * @example
170
- * // ArrowDown on a slider whose keyboard option is ['raw', 1]
171
- * applyDelta(value, -1, keyboard, { min, max, step, scale })
172
- */
173
- declare function applyDelta(value: number, direction: number, [mode, amount]: InputEventOption, {
174
- min,
175
- max,
176
- step,
177
- scale
178
- }: ValueRange): number;
179
182
  //#endregion
180
183
  //#region src/midi.d.ts
181
- declare const whiteKeys: readonly ["A", "B", "C", "D", "E", "F", "G"];
184
+ export declare const whiteKeys: readonly ["A", "B", "C", "D", "E", "F", "G"];
182
185
  type WhiteKey = (typeof whiteKeys)[number];
183
- declare const noteKeys: readonly ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"];
186
+ export declare const noteKeys: readonly ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"];
184
187
  type NoteKey = (typeof noteKeys)[number];
185
- declare function parseNoteName(noteName: string): {
188
+ export declare function parseNoteName(noteName: string): {
186
189
  letter: WhiteKey;
187
190
  accidental: "#" | "##" | "b" | "bb" | "";
188
191
  octave: number;
@@ -190,33 +193,33 @@ declare function parseNoteName(noteName: string): {
190
193
  /**
191
194
  * Convert noteName to noteNumber
192
195
  */
193
- declare function noteNumber(noteName: string): number;
196
+ export declare function noteNumber(noteName: string): number;
194
197
  /**
195
198
  * Convert noteNumber to noteName
196
199
  * C-1 = 0
197
200
  * G9 = 127
198
201
  * @param noteNumber noteNumber
199
202
  */
200
- declare function noteName(noteNumber: number): `${NoteKey}${number}`;
203
+ export declare function noteName(noteNumber: number): `${NoteKey}${number}`;
201
204
  /**
202
205
  * Convert noteNumber to noteKey
203
206
  */
204
- declare function noteKey(noteNumber: number): NoteKey;
207
+ export declare function noteKey(noteNumber: number): NoteKey;
205
208
  /**
206
209
  * @param note noteNumber: 0 ~ 127 or noteName e.g. 'C3'
207
210
  */
208
- declare function isWhiteKey(note: number | string): boolean;
211
+ export declare function isWhiteKey(note: number | string): boolean;
209
212
  /**
210
213
  * @param note noteNumber: 0 ~ 127 or noteName e.g. 'C3'
211
214
  */
212
- declare function isBlackKey(note: number | string): boolean;
215
+ export declare function isBlackKey(note: number | string): boolean;
213
216
  /**
214
217
  * @param note noteNumber: 0 ~ 127 or noteName e.g. 'C3'
215
218
  * @param detune [cent]
216
219
  * @param a4 A4 frequency [Hz]
217
220
  * @returns frequency [Hz]
218
221
  */
219
- declare function noteToFrequency(note: number | string, detune?: number, a4?: number): number;
222
+ export declare function noteToFrequency(note: number | string, detune?: number, a4?: number): number;
220
223
  /**
221
224
  * Semitones above the root, for each supported scale.
222
225
  *
@@ -228,7 +231,7 @@ declare function noteToFrequency(note: number | string, detune?: number, a4?: nu
228
231
  * spellings are here because both are what someone reaches for depending on
229
232
  * whether they are thinking in keys or in modes.
230
233
  */
231
- declare const scaleIntervals: {
234
+ export declare const scaleIntervals: {
232
235
  readonly major: readonly [0, 2, 4, 5, 7, 9, 11];
233
236
  readonly naturalMinor: readonly [0, 2, 3, 5, 7, 8, 10];
234
237
  readonly harmonicMinor: readonly [0, 2, 3, 5, 7, 8, 11];
@@ -258,7 +261,7 @@ type ScaleName = keyof typeof scaleIntervals;
258
261
  * inScale('F#4', 'D3', 'major') // true
259
262
  * ```
260
263
  */
261
- declare function inScale(note: number | string, root: number | string, name: ScaleName): boolean;
264
+ export declare function inScale(note: number | string, root: number | string, name: ScaleName): boolean;
262
265
  /**
263
266
  * The notes of a scale, ascending from `root`.
264
267
  *
@@ -273,120 +276,69 @@ declare function inScale(note: number | string, root: number | string, name: Sca
273
276
  * scaleNotes('C3', 'majorPentatonic') // [48, 50, 52, 55, 57]
274
277
  * ```
275
278
  */
276
- declare function scaleNotes(root: number | string, name: ScaleName, octaves?: number): number[];
279
+ export declare function scaleNotes(root: number | string, name: ScaleName, octaves?: number): number[];
277
280
  //#endregion
278
- //#region src/piano.d.ts
279
- type NoteRange = {
280
- first: number;
281
- last: number;
282
- };
283
- /**
284
- * `[noteRange.first, noteRange.first + 1, ..., noteRange.last]`
285
- */
286
- declare function getNoteRangeArray(noteRange: NoteRange): number[];
281
+ //#region src/unit.d.ts
287
282
  /**
288
- * The geometry of a drawn keyboard.
283
+ * The SI prefixes {@link unitFormat} chooses between.
289
284
  *
290
- * One description is shared by the drawing and the hit testing, so a key cannot
291
- * be drawn somewhere other than where it responds.
285
+ * Deliberately narrower than the full SI set: yocto through yotta are of no
286
+ * use to an audio control, and every extra prefix is one more symbol `parse`
287
+ * has to tell apart from a unit.
292
288
  */
293
- interface PianoLayout {
294
- noteRange: NoteRange;
295
- /** Width of a white key, excluding {@link PianoLayout.keyGap}. */
296
- whiteKeyWidth: number;
289
+ type SIPrefix = 'p' | 'n' | 'µ' | 'm' | '' | 'k' | 'M' | 'G';
290
+ interface UnitFormatOptions {
297
291
  /**
298
- * Space between two white keys. Part of the slot a white key occupies, so it
299
- * still belongs to one of the keys for the purpose of hit testing.
292
+ * The prefix the stored value is already in.
293
+ *
294
+ * A control that keeps milliseconds in `value` is `{ base: 'm' }` with a
295
+ * unit of `'s'`: 1500 then displays as `1.5s`, and `parse` gives 1500 back.
300
296
  *
301
- * @default 1
297
+ * @default ''
302
298
  */
303
- keyGap?: number;
299
+ base?: SIPrefix;
304
300
  /**
305
- * Width of a black key, as a fraction of {@link PianoLayout.whiteKeyWidth}.
301
+ * Whether to scale the number and pick a prefix at all.
302
+ *
303
+ * Turn it off for anything that is not an SI quantity. dB, %, cents and
304
+ * semitones do not take prefixes, and `-6dB` read as "-6 deci-B" is wrong
305
+ * rather than merely unusual.
306
306
  *
307
- * @default 0.65
307
+ * @default true
308
308
  */
309
- blackKeyWidthRatio?: number;
309
+ prefixes?: boolean;
310
310
  /**
311
- * Height of a black key, as a fraction of the height of the keyboard.
312
- *
313
- * @default 0.6
311
+ * Digits after the decimal point. The number is left as-is when omitted.
314
312
  */
315
- blackKeyHeightRatio?: number;
313
+ digits?: number;
314
+ /**
315
+ * Text placed between the number and the unit.
316
+ * @default ''
317
+ */
318
+ separator?: string;
319
+ }
320
+ /** The `format` / `parse` pair a `NumberInput` takes. */
321
+ interface UnitFormatter {
322
+ format: (value: number) => string;
323
+ parse: (text: string) => number;
316
324
  }
317
- /** Width of a black key in pixels. */
318
- declare function blackKeyWidth(layout: PianoLayout): number;
319
- /** Width of the whole keyboard in pixels. */
320
- declare function pianoWidth(layout: PianoLayout): number;
321
- /**
322
- * Offset of the left edge of a key from the left edge of the keyboard, in
323
- * pixels.
324
- *
325
- * Notes outside `noteRange` are placed too, so the value is negative below
326
- * `noteRange.first`.
327
- */
328
- declare function notePosition(note: number, layout: PianoLayout): number;
329
- /**
330
- * The note drawn at a point, or null where there is none.
331
- *
332
- * Black keys are tested first, so they win where they overlap a white one. A
333
- * white key covers its gap as well as its width, so the whole width of the
334
- * keyboard belongs to some key and a click cannot fall between two.
335
- *
336
- * @param x offset from the left edge of the keyboard, in pixels
337
- * @param y offset from its top edge, in pixels
338
- * @param height height of the keyboard, in pixels
339
- */
340
- declare function noteAt(x: number, y: number, height: number, layout: PianoLayout): number | null;
341
- //#endregion
342
- //#region src/unit.d.ts
343
- /**
344
- * Units a value can be displayed in, as `[symbol, scale]` pairs ordered from
345
- * the smallest scale up. A value is shown in the largest unit that does not
346
- * exceed it.
347
- *
348
- * @example
349
- * [['Hz', 1], ['kHz', 1000]]
350
- * [['ms', 1], ['s', 1000]]
351
- */
352
- type Units = [string, number][];
353
- /**
354
- * Pick the unit a value is displayed in: the largest one whose scale does not
355
- * exceed the magnitude of the value.
356
- */
357
- declare function selectUnit(units: Units, value: number): [string, number];
358
325
  /**
359
- * Render a value as text, in the unit that suits its magnitude.
326
+ * Build the `format` and `parse` of a unit, as one pair.
360
327
  *
361
- * @param units a single symbol appended as-is, or a list to choose from.
362
- * @param digit digits after the decimal point. Left as-is when omitted.
328
+ * They are returned together because they have to agree: a `format` that
329
+ * writes `1.23kHz` is only useful next to a `parse` that reads it back as
330
+ * 1230. Spread the result into the input.
363
331
  *
364
332
  * @example
365
- * formatValue(1234, [['Hz', 1], ['kHz', 1000]], 2) // '1.23kHz'
366
- * formatValue(1.5, 'Hz') // '1.5Hz'
367
- */
368
- declare function formatValue(value: number, units?: string | Units, digit?: number): string;
369
- /**
370
- * Read a value back out of text, undoing the scaling of {@link formatValue}.
371
- *
372
- * With a list of units the text has to be a number followed by an optional
373
- * unit and nothing else, since the unit decides the scale; anything else reads
374
- * as 0. With a single unit, or none, the first number found anywhere in the
375
- * text is taken, so a half-typed entry still yields something.
333
+ * unitFormat('Hz') // 1234 -> '1.23kHz'
334
+ * unitFormat('s', { base: 'm' }) // value in ms. 1500 -> '1.5s'
335
+ * unitFormat('s', { base: 'm', digits: 2 }) // 1500 -> '1.50s'
336
+ * unitFormat('dB', { prefixes: false, digits: 1 }) // -6.25 -> '-6.3dB'
376
337
  *
377
338
  * @example
378
- * parseValue('1.23kHz', [['Hz', 1], ['kHz', 1000]]) // 1230
379
- * parseValue('4abc') // 4
339
+ * <NumberInput.Root {...unitFormat('Hz', { digits: 2 })} value={v} onChange={setV}>
380
340
  */
381
- declare function parseValue(text: string, units?: string | Units): number;
382
- //#endregion
383
- //#region src/util.d.ts
384
- type Operator = '+' | '-' | '*' | '/';
385
- declare function styleHelper(value: string | number): string;
386
- declare function styleHelper(value: string | number, op: Operator, influencer?: number): string;
387
- declare function isEmpty(obj: object): boolean;
388
- declare function mod(n: number, m: number): number;
389
- declare function xor(a?: boolean, b?: boolean): boolean;
341
+ export declare function unitFormat(unit: string, options?: UnitFormatOptions): UnitFormatter;
390
342
  //#endregion
391
- export { type InputEventOption, type NoteKey, type NoteRange, type PianoLayout, type Scale, type ScaleName, type Units, type ValueRange, type WhiteKey, applyDelta, blackKeyWidth, clamp, curveScale, curveWithCenterValue, dbToGain, decimalPart, degree, exponentialScale, formatValue, gainToDb, getNoteRangeArray, inScale, integerPart, isBlackKey, isEmpty, isWhiteKey, linearScale, mapValue, mod, normalizeValue, noteAt, noteKey, noteKeys, noteName, noteNumber, notePosition, noteToFrequency, parseNoteName, parseValue, pianoWidth, radian, rawValue, scaleIntervals, scaleNotes, selectUnit, skewScale, skewWithCenterValue, stepValue, styleHelper, symmetricSkewScale, toFixed, whiteKeys, xor };
343
+ export type { NoteKey, SIPrefix, Scale, ScaleName, UnitFormatOptions, UnitFormatter, ValueRange, WhiteKey };
392
344
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/math.ts","../src/types.ts","../src/scales.ts","../src/midi.ts","../src/piano.ts","../src/unit.ts","../src/util.ts"],"mappings":";;AAGA;;iBAAgB,KAAA,CAAM,KAAA,UAAe,GAAA,UAAa,GAAA;;;;;;;iBAUlC,cAAA,CAAe,KAAA,UAAe,GAAA,UAAa,GAAA;;;;;;iBAU3C,QAAA,CAAS,eAAA,UAAyB,GAAA,UAAa,GAAA;AAAA,iBAK/C,SAAA,CAAU,KAAA,UAAe,IAAA;AAAA,iBASzB,OAAA,CAAQ,CAAA,UAAW,cAAA;AAAA,iBAInB,WAAA,CAAY,CAAA;AAAA,iBAOZ,WAAA,CAAY,CAAA;AAAA,iBAIZ,MAAA,CAAO,MAAA;AAAA,iBAIP,MAAA,CAAO,MAAA;AAAA,iBAIP,QAAA,CACd,KAAA,UACA,KAAA,UACA,KAAA,UACA,MAAA,UACA,MAAA;AAAA,iBAKc,QAAA,CAAS,EAAA;AAAA,iBAIT,QAAA,CAAS,IAAA;;;;AAvEzB;;KCAY,gBAAA;;;ADAZ;;;;;;;;;AAUA;;;;;;AAVA,UEgBiB,KAAA;EFNqD;EEQpE,SAAA,GAAY,KAAA,UAAe,GAAA,UAAa,GAAA;EFE1B;EEAd,WAAA,GAAc,QAAA,UAAkB,GAAA,UAAa,GAAA;AAAA;;;;;;;cAalC,WAAA,EAAa,KAAA;;;;;AFC1B;;;;;AAIA;;;;;AAOA;;iBESgB,SAAA,CAAU,IAAA,WAAe,KAAA;;;AFLzC;;iBE0BgB,mB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