smoosic 1.0.40 → 1.0.41

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.
Files changed (71) hide show
  1. package/build/smoosic.js +3 -3
  2. package/package.json +1 -1
  3. package/release/smoosic.js +3 -3
  4. package/src/smo/data/scoreModifiers.ts +2 -2
  5. package/src/ui/components/dialogs/timeSignature.vue +25 -4
  6. package/types/src/application/application.d.ts +103 -102
  7. package/types/src/application/common.d.ts +6 -0
  8. package/types/src/application/configuration.d.ts +75 -75
  9. package/types/src/application/dynamicInit.d.ts +6 -6
  10. package/types/src/application/eventHandler.d.ts +87 -81
  11. package/types/src/application/exports.d.ts +482 -485
  12. package/types/src/render/audio/oscillator.d.ts +99 -99
  13. package/types/src/render/audio/player.d.ts +143 -143
  14. package/types/src/render/audio/samples.d.ts +56 -56
  15. package/types/src/render/sui/NoteEntryCaret.d.ts +107 -0
  16. package/types/src/render/sui/NoteEntryMediator.d.ts +24 -0
  17. package/types/src/render/sui/configuration.d.ts +53 -49
  18. package/types/src/render/sui/formatter.d.ts +163 -161
  19. package/types/src/render/sui/layoutDebug.d.ts +46 -46
  20. package/types/src/render/sui/mapper.d.ts +138 -135
  21. package/types/src/render/sui/renderState.d.ts +92 -90
  22. package/types/src/render/sui/scoreRender.d.ts +97 -96
  23. package/types/src/render/sui/scoreView.d.ts +280 -279
  24. package/types/src/render/sui/scoreViewOperations.d.ts +604 -594
  25. package/types/src/render/sui/scroller.d.ts +41 -41
  26. package/types/src/render/sui/svgPageMap.d.ts +344 -344
  27. package/types/src/render/sui/textEdit.d.ts +316 -316
  28. package/types/src/render/sui/tracker.d.ts +10 -4
  29. package/types/src/render/vex/vxMeasure.d.ts +97 -97
  30. package/types/src/smo/data/common.d.ts +220 -220
  31. package/types/src/smo/data/measure.d.ts +511 -511
  32. package/types/src/smo/data/measureModifiers.d.ts +509 -508
  33. package/types/src/smo/data/music.d.ts +2 -1
  34. package/types/src/smo/data/note.d.ts +2 -0
  35. package/types/src/smo/data/noteModifiers.d.ts +2 -0
  36. package/types/src/smo/data/score.d.ts +7 -5
  37. package/types/src/smo/data/scoreModifiers.d.ts +441 -440
  38. package/types/src/smo/data/systemStaff.d.ts +2 -2
  39. package/types/src/smo/data/tuplet.d.ts +7 -0
  40. package/types/src/smo/midi/midiToSmo.d.ts +12 -12
  41. package/types/src/smo/midi/smoToMidi.d.ts +3 -3
  42. package/types/src/smo/mxml/smoToXml.d.ts +4 -4
  43. package/types/src/smo/mxml/xmlState.d.ts +3 -3
  44. package/types/src/smo/mxml/xmlToSmo.d.ts +2 -2
  45. package/types/src/smo/xform/operations.d.ts +3 -3
  46. package/types/src/smo/xform/selections.d.ts +154 -154
  47. package/types/src/ui/buttons/display.d.ts +1 -0
  48. package/types/src/ui/common.d.ts +69 -67
  49. package/types/src/ui/composable/draggable.d.ts +1 -1
  50. package/types/src/ui/configuration.d.ts +30 -30
  51. package/types/src/ui/dialogs/chordChange.d.ts +35 -35
  52. package/types/src/ui/dialogs/components/baseComponent.d.ts +158 -158
  53. package/types/src/ui/dialogs/components/button.d.ts +54 -54
  54. package/types/src/ui/dialogs/components/dropdown.d.ts +78 -78
  55. package/types/src/ui/dialogs/components/pitch.d.ts +95 -95
  56. package/types/src/ui/dialogs/components/rocker.d.ts +66 -66
  57. package/types/src/ui/dialogs/components/textInPlace.d.ts +90 -90
  58. package/types/src/ui/dialogs/components/textInput.d.ts +58 -58
  59. package/types/src/ui/dialogs/components/toggle.d.ts +53 -53
  60. package/types/src/ui/dialogs/dialog.d.ts +203 -203
  61. package/types/src/ui/dialogs/endings.d.ts +2 -2
  62. package/types/src/ui/dialogs/lyric.d.ts +39 -39
  63. package/types/src/ui/dialogs/measureFormat.d.ts +2 -2
  64. package/types/src/ui/dialogs/tempo.d.ts +3 -3
  65. package/types/src/ui/dialogs/textBlock.d.ts +55 -61
  66. package/types/src/ui/dialogs/timeSignature.d.ts +2 -34
  67. package/types/src/ui/exceptions.d.ts +15 -15
  68. package/types/src/ui/help.d.ts +6 -1
  69. package/types/src/ui/menus/manager.d.ts +59 -59
  70. package/types/src/ui/navigation.d.ts +44 -37
  71. package/types/typedoc.d.ts +157 -157
@@ -1,99 +1,99 @@
1
- import { SmoMeasure } from '../../smo/data/measure';
2
- import { SmoNote } from '../../smo/data/note';
3
- import { SmoSelection } from '../../smo/xform/selections';
4
- import { SmoScore } from '../../smo/data/score';
5
- import { SmoInstrument } from '../../smo/data/staffModifiers';
6
- import { Soundfont } from 'smplr';
7
- /**
8
- * Create audio reverb node.
9
- * @category SuiAudio
10
- */
11
- export declare class SuiReverb {
12
- static get defaults(): {
13
- length: number;
14
- decay: number;
15
- };
16
- static impulse: AudioBuffer | null;
17
- connect(destination: AudioNode): void;
18
- disconnect(): void;
19
- _buildImpulse(): void;
20
- output: ConvolverNode;
21
- input: ConvolverNode;
22
- length: number;
23
- decay: number;
24
- damp: number;
25
- reverse: boolean;
26
- _context: AudioContext;
27
- constructor(context: AudioContext);
28
- }
29
- /**
30
- * Audio custom osc node. Not used much.
31
- */
32
- export interface WaveTable {
33
- real: number[];
34
- imaginary: number[];
35
- }
36
- /**
37
- * Parameters to create an oscillator for a single note of music
38
- * @category SuiAudio
39
- */
40
- export interface SuiOscillatorParams {
41
- duration: number;
42
- delayTime: number;
43
- frequency: number;
44
- detune?: number;
45
- attackEnv: number;
46
- decayEnv: number;
47
- sustainEnv: number;
48
- releaseEnv: number;
49
- sustainLevel: number;
50
- releaseLevel: number;
51
- waveform: OscillatorType;
52
- gain: number;
53
- wavetable?: WaveTable;
54
- useReverb: boolean;
55
- instrument: string;
56
- }
57
- export declare const SynthWavetable: WaveTable;
58
- /**
59
- * Simple waveform synthesizer thing that plays notes. Oscillator works in either
60
- * analog synthisizer or sampler mode.
61
- * @category SuiAudio
62
- */
63
- export declare abstract class SuiOscillator {
64
- abstract play(): void;
65
- static get defaults(): SuiOscillatorParams;
66
- static audio: AudioContext;
67
- duration: number;
68
- constructor(params: SuiOscillatorParams);
69
- /**
70
- * Generate a tone from a note selected or added
71
- * @param measure
72
- * @param note
73
- * @param score
74
- * @param instrument
75
- * @param gain
76
- * @returns
77
- */
78
- static fromNote(measure: SmoMeasure, note: SmoNote, score: SmoScore, instrument: SmoInstrument, gain: number): SuiOscillator[];
79
- static playSelectionNow(selection: SmoSelection, score: SmoScore, gain: number): void;
80
- }
81
- export declare class SuiOscillatorSoundfont extends SuiOscillator {
82
- instrument: string;
83
- samples: Soundfont;
84
- midinumber: number;
85
- offset: number;
86
- velocity: number;
87
- delayTime: number;
88
- detune: number;
89
- static debug: boolean;
90
- constructor(params: SuiOscillatorParams);
91
- play(): void;
92
- }
93
- /**
94
- * An audio output primitive that uses frequency-adjusted sampled sounds
95
- * @category SuiAudio
96
- */
97
- export declare class SuiSampler extends SuiOscillatorSoundfont {
98
- constructor(params: SuiOscillatorParams);
99
- }
1
+ import { SmoMeasure } from '../../smo/data/measure';
2
+ import { SmoNote } from '../../smo/data/note';
3
+ import { SmoSelection } from '../../smo/xform/selections';
4
+ import { SmoScore } from '../../smo/data/score';
5
+ import { SmoInstrument } from '../../smo/data/staffModifiers';
6
+ import { Soundfont } from 'smplr';
7
+ /**
8
+ * Create audio reverb node.
9
+ * @category SuiAudio
10
+ */
11
+ export declare class SuiReverb {
12
+ static get defaults(): {
13
+ length: number;
14
+ decay: number;
15
+ };
16
+ static impulse: AudioBuffer | null;
17
+ connect(destination: AudioNode): void;
18
+ disconnect(): void;
19
+ _buildImpulse(): void;
20
+ output: ConvolverNode;
21
+ input: ConvolverNode;
22
+ length: number;
23
+ decay: number;
24
+ damp: number;
25
+ reverse: boolean;
26
+ _context: AudioContext;
27
+ constructor(context: AudioContext);
28
+ }
29
+ /**
30
+ * Audio custom osc node. Not used much.
31
+ */
32
+ export interface WaveTable {
33
+ real: number[];
34
+ imaginary: number[];
35
+ }
36
+ /**
37
+ * Parameters to create an oscillator for a single note of music
38
+ * @category SuiAudio
39
+ */
40
+ export interface SuiOscillatorParams {
41
+ duration: number;
42
+ delayTime: number;
43
+ frequency: number;
44
+ detune?: number;
45
+ attackEnv: number;
46
+ decayEnv: number;
47
+ sustainEnv: number;
48
+ releaseEnv: number;
49
+ sustainLevel: number;
50
+ releaseLevel: number;
51
+ waveform: OscillatorType;
52
+ gain: number;
53
+ wavetable?: WaveTable;
54
+ useReverb: boolean;
55
+ instrument: string;
56
+ }
57
+ export declare const SynthWavetable: WaveTable;
58
+ /**
59
+ * Simple waveform synthesizer thing that plays notes. Oscillator works in either
60
+ * analog synthisizer or sampler mode.
61
+ * @category SuiAudio
62
+ */
63
+ export declare abstract class SuiOscillator {
64
+ abstract play(): void;
65
+ static get defaults(): SuiOscillatorParams;
66
+ static audio: AudioContext;
67
+ duration: number;
68
+ constructor(params: SuiOscillatorParams);
69
+ /**
70
+ * Generate a tone from a note selected or added
71
+ * @param measure
72
+ * @param note
73
+ * @param score
74
+ * @param instrument
75
+ * @param gain
76
+ * @returns
77
+ */
78
+ static fromNote(measure: SmoMeasure, note: SmoNote, score: SmoScore, instrument: SmoInstrument, gain: number): SuiOscillator[];
79
+ static playSelectionNow(selection: SmoSelection, score: SmoScore, gain: number): void;
80
+ }
81
+ export declare class SuiOscillatorSoundfont extends SuiOscillator {
82
+ instrument: string;
83
+ samples: Soundfont;
84
+ midinumber: number;
85
+ offset: number;
86
+ velocity: number;
87
+ delayTime: number;
88
+ detune: number;
89
+ static debug: boolean;
90
+ constructor(params: SuiOscillatorParams);
91
+ play(): void;
92
+ }
93
+ /**
94
+ * An audio output primitive that uses frequency-adjusted sampled sounds
95
+ * @category SuiAudio
96
+ */
97
+ export declare class SuiSampler extends SuiOscillatorSoundfont {
98
+ constructor(params: SuiOscillatorParams);
99
+ }
@@ -1,143 +1,143 @@
1
- import { SuiOscillator } from './oscillator';
2
- import { SuiScoreView } from '../sui/scoreView';
3
- import { SmoScore } from '../../smo/data/score';
4
- import { SmoSelector } from '../../smo/xform/selections';
5
- import { SuiAudioAnimationParams } from './musicCursor';
6
- import { layoutDebug } from '../sui/layoutDebug';
7
- /**
8
- * Create audio player for the score from the start point
9
- * @category SuiAudio
10
- */
11
- export interface SuiAudioPlayerParams {
12
- startIndex: number;
13
- view: SuiScoreView;
14
- score: SmoScore;
15
- audioAnimation: SuiAudioAnimationParams;
16
- }
17
- export interface midiFrequency {
18
- midinumber: number;
19
- detune: number;
20
- }
21
- export interface OscAudioData {
22
- pitches: midiFrequency[];
23
- duration: number;
24
- durationPct: number;
25
- delay: number;
26
- }
27
- /**
28
- * Parameters used to create just-in-time oscillators
29
- * @category SuiAudio
30
- */
31
- export interface SoundParams {
32
- frequencies: OscAudioData[];
33
- overallDuration: number;
34
- volume: number;
35
- noteType: string;
36
- instrument: string;
37
- selector: SmoSelector;
38
- }
39
- /**
40
- * A list of sound parameters for just-in-time oscillator creation
41
- * @category SuiAudio
42
- */
43
- export interface SoundParamMeasureLink {
44
- soundParams: Record<number, SoundParams[]>;
45
- endTicks: number;
46
- measureIndex: number;
47
- next: SoundParamMeasureLink | null;
48
- }
49
- /**
50
- * A set of oscillators to be played at a certain time.
51
- * @category SuiAudio
52
- */
53
- export interface CuedAudioContext {
54
- oscs: SuiOscillator[];
55
- playMeasureIndex: number;
56
- playTickIndex: number;
57
- waitTime: number;
58
- offsetPct: number;
59
- durationPct: number;
60
- selector: SmoSelector;
61
- }
62
- /**
63
- * A list of oscillators. We keep them in a list until played so we
64
- * can GC them if playing is cancelled
65
- * @category SuiAudio
66
- */
67
- export interface CuedAudioLink {
68
- sound: CuedAudioContext;
69
- next: CuedAudioLink | null;
70
- }
71
- /**
72
- * Maintain a list of buffers ready to play, since this is a
73
- * system resource.
74
- * @category SuiAudio
75
- */
76
- export declare class CuedAudioContexts {
77
- soundHead: CuedAudioLink | null;
78
- soundTail: CuedAudioLink | null;
79
- paramLinkHead: SoundParamMeasureLink | null;
80
- paramLinkTail: SoundParamMeasureLink | null;
81
- soundListLength: number;
82
- playWaitTimer: number;
83
- complete: boolean;
84
- addToTail(cuedSound: CuedAudioContext): void;
85
- advanceHead(): CuedAudioContext | null;
86
- get soundCount(): number;
87
- reset(): void;
88
- }
89
- /**
90
- * Play the music, ja!
91
- * @category SuiAudio
92
- */
93
- export declare class SuiAudioPlayer {
94
- static _playing: boolean;
95
- static instanceId: number;
96
- static duplicatePitchThresh: number;
97
- static voiceThresh: number;
98
- static _playingInstance: SuiAudioPlayer | null;
99
- static set playing(val: boolean);
100
- static get audioBufferSize(): number;
101
- static incrementInstanceId(): number;
102
- static get playing(): boolean;
103
- static pausePlayer(): void;
104
- instanceId: number;
105
- paused: boolean;
106
- view: SuiScoreView;
107
- score: SmoScore;
108
- cuedSounds: CuedAudioContexts;
109
- audioDefaults: import("./oscillator").SuiOscillatorParams;
110
- volumeMap: Record<string, number>;
111
- audioAnimation: SuiAudioAnimationParams;
112
- debug: layoutDebug;
113
- constructor(parameters: SuiAudioPlayerParams);
114
- /**
115
- * Popuate the SoundData structures used to create the oscillators
116
- * from the notes in this measure.
117
- * @param measureIndex
118
- * @returns
119
- */
120
- private getNoteSoundData;
121
- /**
122
- * Create the audio resources to be played.
123
- * @param measureIndex
124
- * @returns
125
- */
126
- createCuedSound(measureIndex: number): void;
127
- private delaySilence;
128
- /**
129
- * Get the next sound from the oscillator cue and play it. Stop if either the
130
- * player was stopped, or if we run out of sounds.
131
- */
132
- playSounds(): Promise<void>;
133
- waitForDoneOrFull(): Promise<void>;
134
- /**
135
- * Create all the audio samples and start the player until done.
136
- * @param measureIndex
137
- */
138
- startPlayer(measureIndex: number): Promise<void>;
139
- static stopPlayer(): void;
140
- static get playingInstance(): SuiAudioPlayer | null;
141
- static _playChord(oscAr: SuiOscillator[]): void;
142
- play(): Promise<void>;
143
- }
1
+ import { SuiOscillator } from './oscillator';
2
+ import { SuiScoreView } from '../sui/scoreView';
3
+ import { SmoScore } from '../../smo/data/score';
4
+ import { SmoSelector } from '../../smo/xform/selections';
5
+ import { SuiAudioAnimationParams } from './musicCursor';
6
+ import { layoutDebug } from '../sui/layoutDebug';
7
+ /**
8
+ * Create audio player for the score from the start point
9
+ * @category SuiAudio
10
+ */
11
+ export interface SuiAudioPlayerParams {
12
+ startIndex: number;
13
+ view: SuiScoreView;
14
+ score: SmoScore;
15
+ audioAnimation: SuiAudioAnimationParams;
16
+ }
17
+ export interface midiFrequency {
18
+ midinumber: number;
19
+ detune: number;
20
+ }
21
+ export interface OscAudioData {
22
+ pitches: midiFrequency[];
23
+ duration: number;
24
+ durationPct: number;
25
+ delay: number;
26
+ }
27
+ /**
28
+ * Parameters used to create just-in-time oscillators
29
+ * @category SuiAudio
30
+ */
31
+ export interface SoundParams {
32
+ frequencies: OscAudioData[];
33
+ overallDuration: number;
34
+ volume: number;
35
+ noteType: string;
36
+ instrument: string;
37
+ selector: SmoSelector;
38
+ }
39
+ /**
40
+ * A list of sound parameters for just-in-time oscillator creation
41
+ * @category SuiAudio
42
+ */
43
+ export interface SoundParamMeasureLink {
44
+ soundParams: Record<number, SoundParams[]>;
45
+ endTicks: number;
46
+ measureIndex: number;
47
+ next: SoundParamMeasureLink | null;
48
+ }
49
+ /**
50
+ * A set of oscillators to be played at a certain time.
51
+ * @category SuiAudio
52
+ */
53
+ export interface CuedAudioContext {
54
+ oscs: SuiOscillator[];
55
+ playMeasureIndex: number;
56
+ playTickIndex: number;
57
+ waitTime: number;
58
+ offsetPct: number;
59
+ durationPct: number;
60
+ selector: SmoSelector;
61
+ }
62
+ /**
63
+ * A list of oscillators. We keep them in a list until played so we
64
+ * can GC them if playing is cancelled
65
+ * @category SuiAudio
66
+ */
67
+ export interface CuedAudioLink {
68
+ sound: CuedAudioContext;
69
+ next: CuedAudioLink | null;
70
+ }
71
+ /**
72
+ * Maintain a list of buffers ready to play, since this is a
73
+ * system resource.
74
+ * @category SuiAudio
75
+ */
76
+ export declare class CuedAudioContexts {
77
+ soundHead: CuedAudioLink | null;
78
+ soundTail: CuedAudioLink | null;
79
+ paramLinkHead: SoundParamMeasureLink | null;
80
+ paramLinkTail: SoundParamMeasureLink | null;
81
+ soundListLength: number;
82
+ playWaitTimer: number;
83
+ complete: boolean;
84
+ addToTail(cuedSound: CuedAudioContext): void;
85
+ advanceHead(): CuedAudioContext | null;
86
+ get soundCount(): number;
87
+ reset(): void;
88
+ }
89
+ /**
90
+ * Play the music, ja!
91
+ * @category SuiAudio
92
+ */
93
+ export declare class SuiAudioPlayer {
94
+ static _playing: boolean;
95
+ static instanceId: number;
96
+ static duplicatePitchThresh: number;
97
+ static voiceThresh: number;
98
+ static _playingInstance: SuiAudioPlayer | null;
99
+ static set playing(val: boolean);
100
+ static get audioBufferSize(): number;
101
+ static incrementInstanceId(): number;
102
+ static get playing(): boolean;
103
+ static pausePlayer(): void;
104
+ instanceId: number;
105
+ paused: boolean;
106
+ view: SuiScoreView;
107
+ score: SmoScore;
108
+ cuedSounds: CuedAudioContexts;
109
+ audioDefaults: import("./oscillator").SuiOscillatorParams;
110
+ volumeMap: Record<string, number>;
111
+ audioAnimation: SuiAudioAnimationParams;
112
+ debug: layoutDebug;
113
+ constructor(parameters: SuiAudioPlayerParams);
114
+ /**
115
+ * Popuate the SoundData structures used to create the oscillators
116
+ * from the notes in this measure.
117
+ * @param measureIndex
118
+ * @returns
119
+ */
120
+ private getNoteSoundData;
121
+ /**
122
+ * Create the audio resources to be played.
123
+ * @param measureIndex
124
+ * @returns
125
+ */
126
+ createCuedSound(measureIndex: number): void;
127
+ private delaySilence;
128
+ /**
129
+ * Get the next sound from the oscillator cue and play it. Stop if either the
130
+ * player was stopped, or if we run out of sounds.
131
+ */
132
+ playSounds(): Promise<void>;
133
+ waitForDoneOrFull(): Promise<void>;
134
+ /**
135
+ * Create all the audio samples and start the player until done.
136
+ * @param measureIndex
137
+ */
138
+ startPlayer(measureIndex: number): Promise<void>;
139
+ static stopPlayer(): void;
140
+ static get playingInstance(): SuiAudioPlayer | null;
141
+ static _playChord(oscAr: SuiOscillator[]): void;
142
+ play(): Promise<void>;
143
+ }
@@ -1,56 +1,56 @@
1
- import { SmoOscillatorInfo } from '../../smo/data/staffModifiers';
2
- import { Soundfont } from 'smplr';
3
- export declare const instrumentSampleMap: Record<string, string>;
4
- export declare const loadedSoundfonts: Record<string, Soundfont>;
5
- /**
6
- * A set of parameters from the instrument interface used to create audio from samples.
7
- * @category SuiAudio
8
- */
9
- export interface SampleChooserParams {
10
- family?: string;
11
- instrument: string;
12
- frequency: number;
13
- duration: number;
14
- gain: number;
15
- articulation?: string;
16
- }
17
- /**
18
- * A function prototype that chooses from among samples to return the correct one for that note
19
- */
20
- export type SampleChooser = (params: SampleChooserParams, samples: SmoOscillatorInfo[]) => AudioSample | null;
21
- /**
22
- * A specific audio sample that can be converted into an audio node
23
- * @category SuiAudio
24
- */
25
- export interface AudioSample {
26
- sample: AudioBuffer;
27
- frequency: number;
28
- patch: string;
29
- gain: number;
30
- }
31
- /**
32
- * Interface for a chooser function and a set of samples
33
- * @category SuiAudio
34
- */
35
- export interface InstrumentSampleChooser {
36
- instrument: string;
37
- sampleChooser: SampleChooser;
38
- samples: SmoOscillatorInfo[];
39
- }
40
- /**
41
- * Logic to create audio nodes out of HTML5 media elements
42
- * @category SuiAudio
43
- */
44
- export declare class SuiSampleMedia {
45
- static sampleFiles: SmoOscillatorInfo[];
46
- static sampleBufferMap: Record<string, AudioBuffer>;
47
- static sampleOscMap: Record<string, SmoOscillatorInfo[]>;
48
- static instrumentChooser: Record<string, InstrumentSampleChooser>;
49
- static receivedBuffer: boolean;
50
- static getFamilyForInstrument(instKey: string): string;
51
- /**
52
- * Load samples so we can play the music
53
- * @returns - promise, resolved when loaded
54
- */
55
- static samplePromise(audio: AudioContext): Promise<any>;
56
- }
1
+ import { SmoOscillatorInfo } from '../../smo/data/staffModifiers';
2
+ import { Soundfont } from 'smplr';
3
+ export declare const instrumentSampleMap: Record<string, string>;
4
+ export declare const loadedSoundfonts: Record<string, Soundfont>;
5
+ /**
6
+ * A set of parameters from the instrument interface used to create audio from samples.
7
+ * @category SuiAudio
8
+ */
9
+ export interface SampleChooserParams {
10
+ family?: string;
11
+ instrument: string;
12
+ frequency: number;
13
+ duration: number;
14
+ gain: number;
15
+ articulation?: string;
16
+ }
17
+ /**
18
+ * A function prototype that chooses from among samples to return the correct one for that note
19
+ */
20
+ export type SampleChooser = (params: SampleChooserParams, samples: SmoOscillatorInfo[]) => AudioSample | null;
21
+ /**
22
+ * A specific audio sample that can be converted into an audio node
23
+ * @category SuiAudio
24
+ */
25
+ export interface AudioSample {
26
+ sample: AudioBuffer;
27
+ frequency: number;
28
+ patch: string;
29
+ gain: number;
30
+ }
31
+ /**
32
+ * Interface for a chooser function and a set of samples
33
+ * @category SuiAudio
34
+ */
35
+ export interface InstrumentSampleChooser {
36
+ instrument: string;
37
+ sampleChooser: SampleChooser;
38
+ samples: SmoOscillatorInfo[];
39
+ }
40
+ /**
41
+ * Logic to create audio nodes out of HTML5 media elements
42
+ * @category SuiAudio
43
+ */
44
+ export declare class SuiSampleMedia {
45
+ static sampleFiles: SmoOscillatorInfo[];
46
+ static sampleBufferMap: Record<string, AudioBuffer>;
47
+ static sampleOscMap: Record<string, SmoOscillatorInfo[]>;
48
+ static instrumentChooser: Record<string, InstrumentSampleChooser>;
49
+ static receivedBuffer: boolean;
50
+ static getFamilyForInstrument(instKey: string): string;
51
+ /**
52
+ * Load samples so we can play the music
53
+ * @returns - promise, resolved when loaded
54
+ */
55
+ static samplePromise(audio: AudioContext, setProgress: (percent: number) => void): Promise<any>;
56
+ }