import { Input, Output, IEventNote, InputEventNoteoff, InputEventNoteon } from 'webmidi';
export interface NoteEvent {
    note: IEventNote;
    velocity: number;
    timestamp: number;
    type: 'noteon' | 'noteoff';
}
export declare function transposeSyllableSeq(notes: NoteEvent[], semitones: number): NoteEvent[];
export declare function eventsToSyllableSequence(midi: NoteEvent[]): SyllableSequence;
export declare class SyllableSequence {
    syllables: Syllable[];
    rootNote: IEventNote;
    append(e: NoteEvent): void;
    /**
     *
     */
    constructor(syllables: Syllable[]);
    grade(answer: SyllableSequence): SyllableSequence;
    toString(): string;
    isCorrect(): boolean;
}
declare class Syllable {
    notes: (NoteEvent & {
        isCorrect: boolean;
        isMissing: boolean;
    })[];
    isCorrect: boolean | undefined;
    get timestamp(): number;
    /**
     *
     */
    constructor(notes: NoteEvent[]);
    /**
     * Returns the size of a timespan (in ms) that
     * a n-note chord must be contained within
     * @param n number of notes
     */
    private static gracePeriod;
    grade(answer: Syllable): Syllable;
}
declare class SkMidi {
    private static _instance;
    /**
     * OFFSET is used to push all playback events (noteon, note off)
     * forward by OFFSET milliseconds. This is to prevent a
     * 'stutter' effect between the first and second syllables
     * when the time between them is small. (noteon at ~0 ms suffers
     * from a latency effect, while other timestamps don't).
     */
    static readonly OFFSET: number;
    recording: NoteEvent[];
    private webmidi;
    private input;
    private output;
    private _noteonListeners;
    private _noteoffListeners;
    private static _initializedWithUserConfig;
    private midiAccess;
    private _state;
    get state(): "nodevice" | "notsupported" | "ready" | "initializing";
    private _userLookup;
    private constructor();
    private init;
    private loadUserConfiguration;
    setStateChangeListener(f: () => void): void;
    private attachListeners;
    get hasRecording(): boolean;
    get configuredInput(): string;
    eraseRecording(): void;
    stopRecording(): void;
    record(): void;
    addNoteonListenter(f: (e: InputEventNoteon) => void): void;
    addNoteoffListenter(f: (e: InputEventNoteoff) => void): void;
    play(recording?: NoteEvent[]): void;
    static instance(): Promise<SkMidi>;
    get inputs(): Input[];
    get outputs(): Output[];
    selectInput(id: string): void;
    selectOutput(id: string): void;
}
export default SkMidi;
//# sourceMappingURL=midi.d.ts.map