UNPKG

aibandtab

Version:

aibandTab is a music notation and guitar tablature rendering library

1,795 lines (1,760 loc) 274 kB
/** * Defines all loglevels. * @json */ declare enum LogLevel { /** * No logging */ None = 0, /** * Debug level (internal details are displayed). */ Debug = 1, /** * Info level (only important details are shown) */ Info = 2, /** * Warning level */ Warning = 3, /** * Error level. */ Error = 4 } /** * @json * @json_declaration */ declare class CoreSettings { /** * Gets or sets the script file url that will be used to spawn the workers. * @target web */ scriptFile: string | null; /** * Gets or sets the url to the fonts that will be used to generate the aibandTab font style. * @target web */ fontDirectory: string | null; /** * Gets or sets the file to load directly after initializing aibandTab. * @target web */ file: string | null; /** * Gets or sets whether the UI element contains aibandTex code that should be * used to initialize aibandTab. * @target web */ tex: boolean; /** * Gets or sets the initial tracks that should be loaded for the score. * @target web * @json_raw */ tracks: number | number[] | 'all' | null; /** * Gets or sets whether lazy loading for displayed elements is enabled. */ enableLazyLoading: boolean; /** * The engine which should be used to render the the tablature. * * - **default**- Platform specific default engine * - **html5**- HTML5 Canvas * - **svg**- SVG */ engine: string; /** * The log level to use within aibandTab */ logLevel: LogLevel; /** * Gets or sets whether the rendering should be done in a worker if possible. */ useWorkers: boolean; /** * Gets or sets whether in the {@link BoundsLookup} also the * position and area of each individual note is provided. */ includeNoteBounds: boolean; /** * @target web */ constructor(); } /** * Describes a color for rendering. * If provided as string one of these formats needs to be used: #RGB, #RGBA, #RRGGBB, #RRGGBBAA, rgb(r,g,b), rgba(r,g,b,a) * If provided as number a raw RGBA value needs to be used. * * @target web */ type ColorJson = Color | string | number; /** * @json_immutable */ declare class Color { static readonly BlackRgb: string; /** * Initializes a new instance of the {@link Color} class. * @param r The red component. * @param g The green component. * @param b The blue component. * @param a The alpha component. */ constructor(r: number, g: number, b: number, a?: number); updateRgba(): void; /** * Gets or sets the raw RGBA value. */ raw: number; get a(): number; get r(): number; get g(): number; get b(): number; /** * Gets the RGBA hex string to use in CSS areas. */ rgba: string; static random(opacity?: number): Color; static fromJson(v: unknown): Color | null; static toJson(obj: Color): number; } /** * Lists all flags for font styles. */ declare enum FontStyle { /** * No flags. */ Plain = 0, /** * Font is italic. */ Italic = 1 } /** * Lists all font weight values. */ declare enum FontWeight { /** * Not bold */ Regular = 0, /** * Font is bold */ Bold = 1 } /** * Describes a font to be used. * If specified as string, a CSS `font` shorthand property compliant value needs to be used. * @target web */ type FontJson = Font | string | { families: string[]; size: number; style: FontStyle | keyof typeof FontStyle; weight: FontWeight | keyof typeof FontWeight; }; /** * @json_immutable */ declare class Font { private _css; private _cssScale; private _families; private _style; private _weight; private _size; private reset; /** * Gets the first font family name. * @deprecated Consider using {@link families} for multi font family support. */ get family(): string; /** * Sets the font family list. * @deprecated Consider using {@link families} for multi font family support. */ set family(value: string); /** * Gets the font family name. */ get families(): string[]; /** * Sets the font family name. */ set families(value: string[]); /** * Gets the font size in pixels. */ get size(): number; /** * Sets the font size in pixels. */ set size(value: number); /** * Gets the font style. */ get style(): FontStyle; /** * Sets the font style. */ set style(value: FontStyle); /** * Gets the font weight. */ get weight(): FontWeight; /** * Gets or sets the font weight. */ set weight(value: FontWeight); get isBold(): boolean; get isItalic(): boolean; /** * Initializes a new instance of the {@link Font} class. * @param family The family. * @param size The size. * @param style The style. * @param weight The weight. */ constructor(family: string, size: number, style?: FontStyle, weight?: FontWeight); withSize(newSize: number): Font; /** * Initializes a new instance of the {@link Font} class. * @param families The families. * @param size The size. * @param style The style. * @param weight The weight. */ static withFamilyList(families: string[], size: number, style?: FontStyle, weight?: FontWeight): Font; toCssString(scale?: number): string; static fromJson(v: unknown): Font | null; static toJson(font: Font): Map<string, unknown>; } /** * This public class contains central definitions for controlling the visual appearance. * @json * @json_declaration */ declare class RenderingResources { private static sansFont; private static serifFont; /** * Gets or sets the font to use for displaying the songs copyright information in the header of the music sheet. */ copyrightFont: Font; /** * Gets or sets the font to use for displaying the songs title in the header of the music sheet. */ titleFont: Font; /** * Gets or sets the font to use for displaying the songs subtitle in the header of the music sheet. */ subTitleFont: Font; /** * Gets or sets the font to use for displaying the lyrics information in the header of the music sheet. */ wordsFont: Font; /** * Gets or sets the font to use for displaying certain effect related elements in the music sheet. */ effectFont: Font; /** * Gets or sets the font to use for displaying the fretboard numbers in chord diagrams. */ fretboardNumberFont: Font; /** * Gets or sets the font to use for displaying the numbered music notation in the music sheet. */ numberedNotationFont: Font; /** * Gets or sets the font to use for displaying the grace notes in numbered music notation in the music sheet. */ numberedNotationGraceFont: Font; /** * Gets or sets the font to use for displaying the guitar tablature numbers in the music sheet. */ tablatureFont: Font; /** * Gets or sets the font to use for grace notation related texts in the music sheet. */ graceFont: Font; /** * Gets or sets the color to use for rendering the lines of staves. */ staffLineColor: Color; /** * Gets or sets the color to use for rendering bar separators, the accolade and repeat signs. */ barSeparatorColor: Color; /** * Gets or sets the font to use for displaying the bar numbers above the music sheet. */ barNumberFont: Font; /** * Gets or sets the color to use for displaying the bar numbers above the music sheet. */ barNumberColor: Color; /** * Gets or sets the font to use for displaying finger information above the music sheet. */ fingeringFont: Font; /** * Gets or sets the font to use for displaying finger information when inline into the music sheet. */ inlineFingeringFont: Font; /** * Gets or sets the font to use for section marker labels shown above the music sheet. */ markerFont: Font; /** * Gets or sets the color to use for music notation elements of the primary voice. * Color(0, 0, 0, 0xff) 黑色 * Color(0xff, 0xff, 0xff, 0xff) 白色 */ mainGlyphColor: Color; /** * Gets or sets the color to use for music notation elements of the secondary voices. */ secondaryGlyphColor: Color; /** * Gets or sets the color to use for displaying the song information above the music sheet. */ scoreInfoColor: Color; } /** * Lists all layout modes that are supported. */ declare enum LayoutMode { /** * Bars are aligned in rows using a fixed width. */ Page = 0, /** * Bars are aligned horizontally in one row */ Horizontal = 1 } /** * Lists all stave profiles controlling which staves are shown. */ declare enum StaveProfile { /** * The profile is auto detected by the track configurations. */ Default = 0, /** * Standard music notation and guitar tablature are rendered. */ ScoreTab = 1, /** * Only standard music notation is rendered. */ Score = 2, /** * Only guitar tablature is rendered. */ Tab = 3, /** * Only guitar tablature is rendered, but also rests and time signatures are not shown. * This profile is typically used in multi-track scenarios. */ TabMixed = 4 } /** * Lists the different modes in which the staves and systems are arranged. */ declare enum SystemsLayoutMode { /** * Use the automatic alignment system provided by aibandTab (default) */ Automatic = 0, /** * Use the systems layout and sizing information stored from the score model. */ UseModelLayout = 1 } /** * The display settings control how the general layout and display of aibandTab is done. * @json * @json_declaration */ declare class DisplaySettings { /** * Sets the zoom level of the rendered notation */ scale: number; /** * The default stretch force to use for layouting. */ stretchForce: number; /** * The layouting mode used to arrange the the notation. */ layoutMode: LayoutMode; /** * The stave profile to use. */ staveProfile: StaveProfile; /** * Limit the displayed bars per row. */ barsPerRow: number; /** * The bar start number to start layouting with. Note that this is the bar number and not an index! */ startBar: number; /** * The amount of bars to render overall. */ barCount: number; /** * The number of bars that should be rendered per partial. This setting is not used by all layouts. */ barCountPerPartial: number; /** * Whether the last system (row) should be also justified to the whole width of the music sheet. * (applies only for page layout). */ justifyLastSystem: boolean; /** * Gets or sets the resources used during rendering. This defines all fonts and colors used. * @json_partial_names */ resources: RenderingResources; /** * Gets or sets the padding between the music notation and the border. */ padding: number[]; /** * Gets or sets the top padding applied to first system. */ firstSystemPaddingTop: number; /** * Gets or sets the top padding applied to systems. */ systemPaddingTop: number; /** * Gets or sets the bottom padding applied to systems. */ systemPaddingBottom: number; /** * Gets or sets the bottom padding applied to last system. */ lastSystemPaddingBottom: number; /** * Gets or sets the padding left to the track name label of the system. */ systemLabelPaddingLeft: number; /** * Gets or sets the padding right to the track name label of the system. */ systemLabelPaddingRight: number; /** * Gets or sets the padding between the accolade bar and the start of the bar itself. */ accoladeBarPaddingRight: number; /** * Gets or sets the top padding applied to main notation staffs. */ notationStaffPaddingTop: number; /** * Gets or sets the bottom padding applied to main notation staffs. */ notationStaffPaddingBottom: number; /** * Gets or sets the top padding applied to effect annotation staffs. */ effectStaffPaddingTop: number; /** * Gets or sets the bottom padding applied to effect annotation staffs. */ effectStaffPaddingBottom: number; /** * Gets or sets the left padding applied between the left line and the first glyph in the first staff in a system. */ firstStaffPaddingLeft: number; /** * Gets or sets the left padding applied between the left line and the first glyph in the following staff in a system. */ staffPaddingLeft: number; /** * Gets how the systems should be layed out. */ systemsLayoutMode: SystemsLayoutMode; } /** * All settings related to importers that decode file formats. * @json * @json_declaration */ declare class ImporterSettings { /** * The text encoding to use when decoding strings. By default UTF-8 is used. */ encoding: string; /** * If part-groups should be merged into a single track. */ mergePartGroupsInMusicXml: boolean; /** * If set to true, text annotations on beats are attempted to be parsed as * lyrics considering spaces as separators and removing underscores. * If a track/staff has explicit lyrics the beat texts will not be detected as lyrics. */ beatTextAsLyrics: boolean; } /** * Lists the different modes on how rhythm notation is shown on the tab staff. */ declare enum TabRhythmMode { /** * Rhythm notation is hidden. */ Hidden = 0, /** * Rhythm notation is shown with individual beams per beat. */ ShowWithBeams = 1, /** * Rhythm notation is shown and behaves like normal score notation with connected bars. */ ShowWithBars = 2, /** * Automatic detection whether the tabs should show rhythm based on hidden standard notation. */ Automatic = 3 } /** * Lists all modes on how fingerings should be displayed. */ declare enum FingeringMode { /** * Fingerings will be shown in the standard notation staff. */ ScoreDefault = 0, /** * Fingerings will be shown in the standard notation staff. Piano finger style is enforced, where * fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. */ ScoreForcePiano = 1, /** * Fingerings will be shown in a effect band above the tabs in case * they have only a single note on the beat. */ SingleNoteEffectBand = 2, /** * Fingerings will be shown in a effect band above the tabs in case * they have only a single note on the beat. Piano finger style is enforced, where * fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. */ SingleNoteEffectBandForcePiano = 3 } /** * Lists all modes on how alphaTab can handle the display and playback of music notation. */ declare enum NotationMode { /** * Music elements will be displayed and played as in Guitar Pro. */ GuitarPro = 0, /** * Music elements will be displayed and played as in traditional songbooks. * Changes: * 1. Bends * For bends additional grace beats are introduced. * Bends are categorized into gradual and fast bends. * - Gradual bends are indicated by beat text "grad" or "grad.". Bend will sound along the beat duration. * - Fast bends are done right before the next note. If the next note is tied even on-beat of the next note. * 2. Whammy Bars * Dips are shown as simple annotation over the beats * Whammy Bars are categorized into gradual and fast. * - Gradual whammys are indicated by beat text "grad" or "grad.". Whammys will sound along the beat duration. * - Fast whammys are done right the beat. * 3. Let Ring * Tied notes with let ring are not shown in standard notation * Let ring does not cause a longer playback, duration is defined via tied notes. */ SongBook = 1 } /** * Lists all major music notation elements that are part * of the music sheet and can be dynamically controlled to be shown * or hidden. */ declare enum NotationElement { /** * The score title shown at the start of the music sheet. */ ScoreTitle = 0, /** * The score subtitle shown at the start of the music sheet. */ ScoreSubTitle = 1, /** * The score artist shown at the start of the music sheet. */ ScoreArtist = 2, /** * The score album shown at the start of the music sheet. */ ScoreAlbum = 3, /** * The score words author shown at the start of the music sheet. */ ScoreWords = 4, /** * The score music author shown at the start of the music sheet. */ ScoreMusic = 5, /** * The score words&music author shown at the start of the music sheet. */ ScoreWordsAndMusic = 6, /** * The score copyright owner shown at the start of the music sheet. */ ScoreCopyright = 7, /** * The tuning information of the guitar shown * above the staves. */ GuitarTuning = 8, /** * The track names which are shown in the accolade. */ TrackNames = 9, /** * The chord diagrams for guitars. Usually shown * below the score info. */ ChordDiagrams = 10, /** * Parenthesis that are shown for tied bends * if they are preceeded by bends. */ ParenthesisOnTiedBends = 11, /** * The tab number for tied notes if the * bend of a note is increased at that point. */ TabNotesOnTiedBends = 12, /** * Zero tab numbers on "dive whammys". */ ZerosOnDiveWhammys = 13, /** * The alternate endings information on repeats shown above the staff. */ EffectAlternateEndings = 14, /** * The information about the fret on which the capo is placed shown above the staff. */ EffectCapo = 15, /** * The chord names shown above beats shown above the staff. */ EffectChordNames = 16, /** * The crescendo/decrescendo angle shown above the staff. */ EffectCrescendo = 17, /** * The beat dynamics shown above the staff. */ EffectDynamics = 18, /** * The curved angle for fade in/out effects shown above the staff. */ EffectFadeIn = 19, /** * The fermata symbol shown above the staff. */ EffectFermata = 20, /** * The fingering information. */ EffectFingering = 21, /** * The harmonics names shown above the staff. * (does not represent the harmonic note heads) */ EffectHarmonics = 22, /** * The let ring name and line above the staff. */ EffectLetRing = 23, /** * The lyrics of the track shown above the staff. */ EffectLyrics = 24, /** * The section markers shown above the staff. */ EffectMarker = 25, /** * The ottava symbol and lines shown above the staff. */ EffectOttavia = 26, /** * The palm mute name and line shown above the staff. */ EffectPalmMute = 27, /** * The pick slide information shown above the staff. * (does not control the pick slide lines) */ EffectPickSlide = 28, /** * The pick stroke symbols shown above the staff. */ EffectPickStroke = 29, /** * The slight beat vibrato waves shown above the staff. */ EffectSlightBeatVibrato = 30, /** * The slight note vibrato waves shown above the staff. */ EffectSlightNoteVibrato = 31, /** * The tap/slap/pop effect names shown above the staff. */ EffectTap = 32, /** * The tempo information shown above the staff. */ EffectTempo = 33, /** * The additional beat text shown above the staff. */ EffectText = 34, /** * The trill name and waves shown above the staff. */ EffectTrill = 35, /** * The triplet feel symbol shown above the staff. */ EffectTripletFeel = 36, /** * The whammy bar information shown above the staff. * (does not control the whammy lines shown within the staff) */ EffectWhammyBar = 37, /** * The wide beat vibrato waves shown above the staff. */ EffectWideBeatVibrato = 38, /** * The wide note vibrato waves shown above the staff. */ EffectWideNoteVibrato = 39, /** * The left hand tap symbol shown above the staff. */ EffectLeftHandTap = 40, /** * The "Free time" text shown above the staff. */ EffectFreeTime = 41, /** * The Sustain pedal effect shown above the staff "Ped.____*" */ EffectSustainPedal = 42, /** * The Golpe effect signs above and below the staff. */ EffectGolpe = 43, /** * The Wah effect signs above and below the staff. */ EffectWahPedal = 44, /** * The Beat barre effect signs above and below the staff "1/2B IV ─────┐" */ EffectBeatBarre = 45, /** * The note ornaments like turns and mordents. */ EffectNoteOrnament = 46, /** * The Rasgueado indicator above the staff Rasg. ----|" */ EffectRasgueado = 47 } /** * The notation settings control how various music notation elements are shown and behaving * @json * @json_declaration */ declare class NotationSettings { /** * Gets or sets the mode to use for display and play music notation elements. */ notationMode: NotationMode; /** * Gets or sets the fingering mode to use. */ fingeringMode: FingeringMode; /** * Gets or sets the configuration on whether music notation elements are visible or not. * If notation elements are not specified, the default configuration will be applied. */ elements: Map<NotationElement, boolean>; /** * Gets the default configuration of the {@see notationElements} setting. Do not modify * this map as it might not result in the expected side effects. * If items are not listed explicitly in this list, they are considered visible. */ static defaultElements: Map<NotationElement, boolean>; /** * Whether to show rhythm notation in the guitar tablature. */ rhythmMode: TabRhythmMode; /** * The height of the rythm bars. */ rhythmHeight: number; /** * The transposition pitch offsets for the individual tracks. * They apply to rendering and playback. */ transpositionPitches: number[]; /** * The transposition pitch offsets for the individual tracks. * They apply to rendering only. */ displayTranspositionPitches: number[]; /** * If set to true the guitar tabs on grace beats are rendered smaller. */ smallGraceTabNotes: boolean; /** * If set to true bend arrows expand to the end of the last tied note * of the string. Otherwise they end on the next beat. */ extendBendArrowsOnTiedNotes: boolean; /** * If set to true, line effects (like w/bar, let-ring etc) * are drawn until the end of the beat instead of the start. */ extendLineEffectsToBeatEnd: boolean; /** * Gets or sets the height for slurs. The factor is multiplied with the a logarithmic distance * between slur start and end. */ slurHeight: number; /** * Gets whether the given music notation element should be shown * @param element the element to check * @returns true if the element should be shown, otherwise false. */ isNotationElementVisible(element: NotationElement): boolean; } /** * Lists all modes how alphaTab can scroll the container during playback. */ declare enum ScrollMode { /** * Do not scroll automatically */ Off = 0, /** * Scrolling happens as soon the offsets of the cursors change. */ Continuous = 1, /** * Scrolling happens as soon the cursors exceed the displayed range. */ OffScreen = 2 } /** * This object defines the details on how to generate the vibrato effects. * @json * @json_declaration */ declare class VibratoPlaybackSettings { /** * Gets or sets the wavelength of the note-wide vibrato in midi ticks. */ noteWideLength: number; /** * Gets or sets the amplitude for the note-wide vibrato in semitones. */ noteWideAmplitude: number; /** * Gets or sets the wavelength of the note-slight vibrato in midi ticks. */ noteSlightLength: number; /** * Gets or sets the amplitude for the note-slight vibrato in semitones. */ noteSlightAmplitude: number; /** * Gets or sets the wavelength of the beat-wide vibrato in midi ticks. */ beatWideLength: number; /** * Gets or sets the amplitude for the beat-wide vibrato in semitones. */ beatWideAmplitude: number; /** * Gets or sets the wavelength of the beat-slight vibrato in midi ticks. */ beatSlightLength: number; /** * Gets or sets the amplitude for the beat-slight vibrato in semitones. */ beatSlightAmplitude: number; } /** * This object defines the details on how to generate the slide effects. * @json * @json_declaration */ declare class SlidePlaybackSettings { /** * Gets or sets 1/4 tones (bend value) offset that * simple slides like slide-out-below or slide-in-above use. */ simpleSlidePitchOffset: number; /** * Gets or sets the percentage which the simple slides should take up * from the whole note. for "slide into" effects the slide will take place * from time 0 where the note is plucked to 25% of the overall note duration. * For "slide out" effects the slide will start 75% and finish at 100% of the overall * note duration. */ simpleSlideDurationRatio: number; /** * Gets or sets the percentage which the legato and shift slides should take up * from the whole note. For a value 0.5 the sliding will start at 50% of the overall note duration * and finish at 100% */ shiftSlideDurationRatio: number; } /** * Lists the different modes how alphaTab will play the generated audio. * @target web */ declare enum PlayerOutputMode { /** * If audio worklets are available in the browser, they will be used for playing the audio. * It will fallback to the ScriptProcessor output if unavailable. */ WebAudioAudioWorklets = 0, /** * Uses the legacy ScriptProcessor output which might perform worse. */ WebAudioScriptProcessor = 1 } /** * The player settings control how the audio playback and UI is behaving. * @json * @json_declaration */ declare class PlayerSettings { /** * Gets or sets the URL of the sound font to be loaded. */ soundFont: string | null; /** * Gets or sets the element that should be used for scrolling. * @target web * @json_read_only */ scrollElement: string | HTMLElement; /** * Gets or sets which output mode alphaTab should use. * @target web */ outputMode: PlayerOutputMode; /** * Gets or sets whether the player should be enabled. */ enablePlayer: boolean; /** * Gets or sets whether playback cursors should be displayed. */ enableCursor: boolean; /** * Gets or sets whether the beat cursor should be animated or just ticking. */ enableAnimatedBeatCursor: boolean; /** * Gets or sets whether the notation elements of the currently played beat should be * highlighted. */ enableElementHighlighting: boolean; /** * Gets or sets alphaTab should provide user interaction features to * select playback ranges and jump to the playback position by click (aka. seeking). */ enableUserInteraction: boolean; /** * Gets or sets the X-offset to add when scrolling. */ scrollOffsetX: number; /** * Gets or sets the Y-offset to add when scrolling */ scrollOffsetY: number; /** * Gets or sets the mode how to scroll. */ scrollMode: ScrollMode; /** * Gets or sets how fast the scrolling to the new position should happen (in milliseconds) */ scrollSpeed: number; /** * Gets or sets whether the native browser smooth scroll mechanism should be used over a custom animation. * @target web */ nativeBrowserSmoothScroll: boolean; /** * Gets or sets the bend duration in milliseconds for songbook bends. */ songBookBendDuration: number; /** * Gets or sets the duration of whammy dips in milliseconds for songbook whammys. */ songBookDipDuration: number; /** * Gets or sets the settings on how the vibrato audio is generated. * @json_partial_names */ readonly vibrato: VibratoPlaybackSettings; /** * Gets or sets the setitngs on how the slide audio is generated. * @json_partial_names */ readonly slide: SlidePlaybackSettings; /** * Gets or sets whether the triplet feel should be applied/played during audio playback. */ playTripletFeel: boolean; /** * Gets or sets how many milliseconds of audio samples should be buffered in total. * Larger buffers cause a delay from when audio settings like volumes will be applied. * Smaller buffers can cause audio crackling due to constant buffering that is happening. */ bufferTimeInMilliseconds: number; } /** * Represents the progress of any data being loaded. */ declare class ProgressEventArgs { /** * Gets the currently loaded bytes. */ readonly loaded: number; /** * Gets the total number of bytes to load. */ readonly total: number; /** * Initializes a new instance of the {@link ProgressEventArgs} class. * @param loaded * @param total */ constructor(loaded: number, total: number); } /** * This public class contains instance specific settings for alphaTab * @json * @json_declaration * @public_api */ declare class Settings { /** * The core settings control the general behavior of alphatab like * what modules are active. * @json_on_parent * @json_partial_names */ readonly core: CoreSettings; /** * The display settings control how the general layout and display of alphaTab is done. * @json_on_parent * @json_partial_names */ readonly display: DisplaySettings; /** * The notation settings control how various music notation elements are shown and behaving. * @json_partial_names */ readonly notation: NotationSettings; /** * All settings related to importers that decode file formats. * @json_partial_names */ readonly importer: ImporterSettings; /** * Contains all player related settings * @json_partial_names */ player: PlayerSettings; setSongBookModeSettings(): void; static get songBook(): Settings; /** * @target web */ fillFromJson(json: any): void; } /** * Represents the information related to a resize event. */ declare class ResizeEventArgs { /** * Gets the size before the resizing happened. */ oldWidth: number; /** * Gets the size after the resize was complete. */ newWidth: number; /** * Gets the settings currently used for rendering. */ settings: Settings | null; core(): CoreSettings; private causeIssue; } declare enum AibandTabErrorType { General = 0, Format = 1, AibandTex = 2 } declare class AibandTabError extends Error { type: AibandTabErrorType; constructor(type: AibandTabErrorType, message?: string | null, inner?: Error); } /** * An invalid input format was detected (e.g. invalid setting values, file formats,...) */ declare class FormatError extends AibandTabError { constructor(message: string); } interface ILogger { debug(category: string, msg: string, ...details: unknown[]): void; warning(category: string, msg: string, ...details: unknown[]): void; info(category: string, msg: string, ...details: unknown[]): void; error(category: string, msg: string, ...details: unknown[]): void; } declare class Logger { static logLevel: LogLevel; static log: ILogger; private static shouldLog; static debug(category: string, msg: string, ...details: unknown[]): void; static warning(category: string, msg: string, ...details: unknown[]): void; static info(category: string, msg: string, ...details: unknown[]): void; static error(category: string, msg: string, ...details: unknown[]): void; } /** * @target web */ declare class FileLoadError extends AibandTabError { xhr: XMLHttpRequest; constructor(message: string, xhr: XMLHttpRequest); } /** * Represents a stream of binary data that can be read from. */ interface IReadable { /** * Gets or sets the current read position relative in the stream. */ position: number; /** * Gets the total number of bytes contained in the stream. */ readonly length: number; /** * Resets the stream for reading the data from the beginning. */ reset(): void; /** * Skip the given number of bytes. * @param offset The number of bytes to skip. */ skip(offset: number): void; /** * Read a single byte from the data stream. * @returns The value of the next byte or -1 if there is no more data. */ readByte(): number; /** * Reads the given number of bytes from the stream into the given buffer. * @param buffer The buffer to fill. * @param offset The offset in the buffer where to start writing. * @param count The number of bytes to read. * @returns */ read(buffer: Uint8Array, offset: number, count: number): number; /** * Reads the remaining data. * @returns */ readAll(): Uint8Array; } /** * This public enumeration lists all types of automations. */ declare enum AutomationType { /** * Tempo change. */ Tempo = 0, /** * Colume change. */ Volume = 1, /** * Instrument change. */ Instrument = 2, /** * Balance change. */ Balance = 3 } /** * Automations are used to change the behaviour of a song. * @cloneable * @json * @json_strict */ declare class Automation { /** * Gets or sets whether the automation is applied linear. */ isLinear: boolean; /** * Gets or sets the type of the automation. */ type: AutomationType; /** * Gets or sets the target value of the automation. */ value: number; /** * Gets or sets the relative position of of the automation. */ ratioPosition: number; /** * Gets or sets the additional text of the automation. */ text: string; static buildTempoAutomation(isLinear: boolean, ratioPosition: number, value: number, reference: number): Automation; static buildInstrumentAutomation(isLinear: boolean, ratioPosition: number, value: number): Automation; } /** * A single point of a bending graph. Used to * describe WhammyBar and String Bending effects. * @cloneable * @json * @json_strict */ declare class BendPoint { static readonly MaxPosition: number; static readonly MaxValue: number; /** * Gets or sets offset of the point relative to the note duration (0-60) */ offset: number; /** * Gets or sets the 1/4 note value offsets for the bend. */ value: number; /** * Initializes a new instance of the {@link BendPoint} class. * @param offset The offset. * @param value The value. */ constructor(offset?: number, value?: number); } /** * Lists the different bend styles */ declare enum BendStyle { /** * The bends are as described by the bend points */ Default = 0, /** * The bends are gradual over the beat duration. */ Gradual = 1, /** * The bends are done fast before the next note. */ Fast = 2 } /** * Lists all types of how to brush multiple notes on a beat. */ declare enum BrushType { /** * No brush. */ None = 0, /** * Normal brush up. */ BrushUp = 1, /** * Normal brush down. */ BrushDown = 2, /** * Arpeggio up. */ ArpeggioUp = 3, /** * Arpeggio down. */ ArpeggioDown = 4 } /** * This public enumeration lists all supported Clefs. * What is a Clef? A Clef is a musical symbol used in sheet music to indicate the pitch range and position of notes on the staff. It tells musicians which notes correspond to which lines and spaces on the staff, essentially setting the "reference point" for reading music. The word "Clef" comes from the French word for "key," as it provides the "key" to understanding the notes on the staff. Explanation of the Clefs in Your Code In the code you provided, the Clef enumeration lists different types of clefs. Here’s what they mean: 1. Neutral Clef Description: The neutral clef does not assign specific pitches to lines or spaces. Use Case: It is typically used for unpitched percussion instruments, like drums, where the height of the note on the staff does not represent a pitch. 2. C Clefs (C3 and C4) Description: The C clef indicates the position of Middle C (C4) on the staff. It can be shifted to different lines to adjust the pitch range for specific instruments. C3 Clef: Middle C is placed on the third line of the staff. C4 Clef: Middle C is placed on the fourth line of the staff. Use Case: The C clef is commonly used for instruments with a midrange pitch, such as the viola (Alto Clef) or some vocal parts (Tenor Clef). 3. F Clef (F4) Description: The F clef (commonly known as the Bass Clef) indicates that the F below Middle C (F3) is located on the fourth line of the staff. Use Case: Used for low-pitched instruments, such as the cello, bass, trombone, and tuba. 4. G Clef (G2) Description: The G clef (commonly known as the Treble Clef) indicates that the G above Middle C (G4) is located on the second line of the staff. Use Case: Used for high-pitched instruments, such as the violin, flute, clarinet, and trumpet, as well as for soprano and alto voices. Summary of Clefs Clef Name Symbol Purpose / Notes Typical Instruments / Voices Neutral 🥁 For unpitched percussion; no defined pitches on the staff. Drums, cymbals, other percussion. C3 🎼 Middle C on the third line of the staff (Alto Clef). Viola, alto trombone. C4 🎼 Middle C on the fourth line of the staff (Tenor Clef). Cello, trombone, bassoon. F4 🎼 F below Middle C on the fourth line (Bass Clef). Cello, bass, tuba, bassoon. G2 🎼 G above Middle C on the second line (Treble Clef). Violin, flute, clarinet, trumpet, soprano voice. Each clef determines how notes are interpreted on the staff and is essential for reading and playing music across different instruments and vocal ranges. */ declare enum Clef { /** * Neutral clef. */ Neutral = 0, /** * C3 clef */ C3 = 1, /** * C4 clef */ C4 = 2, /** * F4 clef */ F4 = 3, /** * G2 clef */ G2 = 4 } /** * Lists all ottavia. */ declare enum Ottavia { /** * 2 octaves higher */ _15ma = 0, /** * 1 octave higher */ _8va = 1, /** * Normal */ Regular = 2, /** * 1 octave lower */ _8vb = 3, /** * 2 octaves lower. */ _15mb = 4 } /** * Lists all simile mark types as they are assigned to bars. */ declare enum SimileMark { /** * No simile mark is applied */ None = 0, /** * A simple simile mark. The previous bar is repeated. */ Simple = 1, /** * A double simile mark. This value is assigned to the first * bar of the 2 repeat bars. */ FirstOfDouble = 2, /** * A double simile mark. This value is assigned to the second * bar of the 2 repeat bars. */ SecondOfDouble = 3 } /** * A voice represents a group of beats * that can be played during a bar. * @json * @json_strict */ declare class Voice { private _beatLookup; private static _globalBarId; /** * Gets or sets the unique id of this bar. */ id: number; /** * Gets or sets the zero-based index of this voice within the bar. * @json_ignore */ index: number; /** * Gets or sets the reference to the bar this voice belongs to. * @json_ignore */ bar: Bar; /** * Gets or sets the list of beats contained in this voice. * @json_add addBeat */ beats: Beat[]; /** * Gets or sets a value indicating whether this voice is empty. */ isEmpty: boolean; insertBeat(after: Beat, newBeat: Beat): void; addBeat(beat: Beat): void; private chain; addGraceBeat(beat: Beat): void; getBeatAtPlaybackStart(playbackStart: number): Beat | null; finish(settings: Settings, sharedDataBag?: Map<string, unknown> | null): void; calculateDuration(): number; } /** * The different pedal marker types. */ declare enum SustainPedalMarkerType { /** * Indicates that the pedal should be pressed from this time on. */ Down = 0, /** * Indicates that the pedal should be held on this marker (used when the pedal is held for the whole bar) */ Hold = 1, /** * indicates that the pedal should be lifted up at this time. */ Up = 2 } /** * A marker on whether a sustain pedal starts or ends. * @json * @json_strict */ declare class SustainPedalMarker { /** * The relative position of pedal markers within the bar. */ ratioPosition: number; /** * Whether what should be done with the pedal at this point */ pedalType: SustainPedalMarkerType; /** * THe bar to which this marker belongs to. * @json_ignore */ bar: Bar; /** * The next pedal marker for linking the related markers together to a "down -> hold -> up" or "down -> up" sequence. * Always null for "up" markers. * @json_ignore */ nextPedalMarker: SustainPedalMarker | null; /** * The previous pedal marker for linking the related markers together to a "down -> hold -> up" or "down -> up" sequence. * Always null for "down" markers. * @json_ignore */ previousPedalMarker: SustainPedalMarker | null; } /** * A bar is a single block within a track, also known as Measure. * @json * @json_strict */ declare class Bar { private static _globalBarId; /** * Gets or sets the unique id of this bar. */ id: number; /** * Gets or sets the zero-based index of this bar within the staff. * @json_ignore */ index: number; /** * Gets or sets the next bar that comes after this bar. * @json_ignore */ nextBar: Bar | null; /** * Gets or sets the previous bar that comes before this bar. * @json_ignore */ previousBar: Bar | null; /** * Gets or sets the clef on this bar. */ clef: Clef; /** * Gets or sets the ottava applied to the clef. */ clefOttava: Ottavia; /** * Gets or sets the reference to the parent staff. * @json_ignore */ staff: Staff; /** * Gets or sets the list of voices contained in this bar. * @json_add addVoice */ voices: Voice[]; /** * Gets or sets the simile mark on this bar. */ simileMark: SimileMark; /** * Gets a value indicating whether this bar contains multiple voices with notes. * @json_ignore */ isMultiVoice: boolean; /** * A relative scale for the size of the bar when displayed. The scale is relative * within a single line (system). The sum of all scales in one line make the total width, * and then this individual scale gives the relative size. */ displayScale: number; /** * An absolute width of the bar to use when displaying in single track display scenarios. */ displayWidth: number; /** * The sustain pedal markers within this bar. */ sustainPedals: SustainPedalMarker[]; get masterBar(): MasterBar; get isEmpty(): boolean; addVoice(voice: Voice): void; finish(settings: Settings, sharedDataBag?: Map<string, unknown> | null): void; calculateDuration(): number; } /** * Represents the lyrics of a song. */ declare class Lyrics { private static readonly CharCodeLF; private static readonly CharCodeTab; private static readonly CharCodeCR; private static readonly CharCodeSpace; private static readonly CharCodeBrackedClose; private static readonly CharCodeBrackedOpen; private static readonly CharCodeDash; /** * Gets or sets he start bar on which the lyrics should begin. */ startBar: number; /** * Gets or sets the raw lyrics text in Guitar Pro format. * (spaces split word syllables, plus merge syllables, [..] are comments) */ text: string; /** * Gets or sets the prepared chunks of the lyrics to apply to beats. */ chunks: string[]; finish(skipEmptyEntries?: boolean): void; private parse; private addChunk; private prepareChunk; } /** * This public class stores the midi specific information of a track needed * for playback. * @json * @json_strict */ declare class PlaybackInformation { /** * Gets or sets the volume (0-16) */ volume: number; /** * Gets or sets the balance (0-16; 8=center) */ balance: number; /** * Gets or sets the midi port to use. */ port: number; /** * Gets or sets the midi program to use. */ program: number; /** * Gets or sets the primary channel for all normal midi events. */ primaryChannel: number; /** * Gets or sets the secondary channel for special midi events. */ secondaryChannel: number; /** * Gets or sets whether the track is muted. */ isMute: boolean; /** * Gets or sets whether the track is playing alone. */ isSolo: boolean; } /** * Lists all music font symbols used within aibandTab. The names * and values are aligned with the SMuFL standard. */ declare enum MusicFontSymbol { None = -1, Brace = 57344, BracketTop = 57347, BracketBottom = 57348, SystemDivider = 57351, GClef = 57424, CClef = 57436, FClef = 57442, UnpitchedPercussionClef1 = 57449, SixStringTabClef = 57453, FourStringTabClef = 57454, TimeSig0 = 57472, TimeSig1 = 57473, TimeSig2 = 57474, TimeSig3 = 57475, TimeSig4 = 57476, TimeSig5 = 57477, TimeSig6 = 57478, TimeSig7 = 57479, TimeSig8 = 57480, TimeSig9 = 57481, TimeSigCommon = 57482, TimeSigCutCommon = 57483, NoteheadDoubleWholeSquare = 57505, NoteheadDoubleWhole = 57504, NoteheadWhole = 57506, NoteheadHalf = 57507, NoteheadBlack = 57508, NoteheadNull = 57509, NoteheadXOrnate = 57514, NoteheadTriangleUpWhole = 57531, NoteheadTriangleUpHalf = 57532, NoteheadTriangleUpBlack = 57534, NoteheadDiamondBlackWide = 57564, NoteheadDiamondWhite = 57565, NoteheadDiamondWhiteWide = 57566, NoteheadCircleX = 57523, NoteheadXWhole = 57511, NoteheadXHalf = 57512, NoteheadXBlack = 57513, NoteheadParenthesis = 57550, NoteheadSlashedBlack2 = 57552, NoteheadCircleSlash = 57591, NoteheadHeavyX = 57592, NoteheadHeavyXHat = 57593, NoteheadSlashVerticalEnds = 57600, NoteheadSlashWhiteWhole = 57602, NoteheadSlashWhiteHalf = 57603, NoteQuarterUp = 57813, NoteEighthUp = 57815, Tremolo3 = 57890, Tremolo2 = 57889, Tremolo1 = 57888, FlagEighthUp = 57920, FlagEighthDown = 57921, FlagSixteenthUp = 57922, FlagSixteenthDown = 57923, FlagThirtySecondUp = 57924, FlagThirtySecondDown = 57925, FlagSixtyFourthUp = 57926, FlagSixtyFourthDown = 57927, FlagOneHundredTwentyEighthUp = 57928, FlagOneHundredTwentyEighthDown = 57929, FlagTwoHundredFiftySixthUp = 57930, FlagTwoHundredFiftySixthDown = 57931, AccidentalFlat = 57952, AccidentalNatural = 57953, AccidentalSharp = 57954, AccidentalDoubleSharp = 57955, AccidentalDoubleFlat = 57956, AccidentalQuarterToneFlatArrowUp = 57968, AccidentalQuarterToneSharpArrowUp = 57972, AccidentalQuarterToneNaturalArrowUp = 57970, ArticAccentAbove = 58528, ArticAccentBelow = 58529, ArticStaccatoAbove = 58530, ArticStaccatoBelow = 58531, ArticTenutoAbove = 58532, ArticTenutoBelow = 58533, ArticMarcatoAbove = 58540, ArticMarcatoBelow = 58541, FermataAbove = 58560, FermataShortAbove = 58564, FermataLongAbove = 58566, RestLonga = 58593, RestDoubleWhole = 58594, RestWhole = 58595, RestHalf = 58596, RestQuarter = 58597, RestEighth = 58598, RestSixteenth = 58599, RestThirtySecond = 58600, RestSixtyFourth = 58601, RestOneHundredTwentyEighth = 58602, RestTwoHundredFiftySixth = 58603, Repeat