@coderline/alphatab 1.3.0-alpha.162 → 1.3.0-alpha.172

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.
@@ -1131,653 +1131,380 @@ declare class MidiFile {
1131
1131
  }
1132
1132
 
1133
1133
  /**
1134
- * Represents a range of the song that should be played.
1134
+ * This public enumeration lists all types of automations.
1135
1135
  */
1136
- declare class PlaybackRange {
1136
+ declare enum AutomationType {
1137
1137
  /**
1138
- * The position in midi ticks from where the song should start.
1138
+ * Tempo change.
1139
1139
  */
1140
- startTick: number;
1140
+ Tempo = 0,
1141
1141
  /**
1142
- * The position in midi ticks to where the song should be played.
1142
+ * Colume change.
1143
1143
  */
1144
- endTick: number;
1145
- }
1146
-
1147
- /**
1148
- * Lists the different states of the player
1149
- */
1150
- declare enum PlayerState {
1144
+ Volume = 1,
1151
1145
  /**
1152
- * Player is paused
1146
+ * Instrument change.
1153
1147
  */
1154
- Paused = 0,
1148
+ Instrument = 2,
1155
1149
  /**
1156
- * Player is playing
1150
+ * Balance change.
1157
1151
  */
1158
- Playing = 1
1159
- }
1160
-
1152
+ Balance = 3
1153
+ }
1161
1154
  /**
1162
- * Represents the info when the player state changes.
1155
+ * Automations are used to change the behaviour of a song.
1156
+ * @cloneable
1157
+ * @json
1158
+ * @json_strict
1163
1159
  */
1164
- declare class PlayerStateChangedEventArgs {
1160
+ declare class Automation {
1165
1161
  /**
1166
- * The new state of the player.
1162
+ * Gets or sets whether the automation is applied linear.
1167
1163
  */
1168
- readonly state: PlayerState;
1164
+ isLinear: boolean;
1169
1165
  /**
1170
- * Gets a value indicating whether the playback was stopped or only paused.
1171
- * @returns true if the playback was stopped, false if the playback was started or paused
1166
+ * Gets or sets the type of the automation.
1172
1167
  */
1173
- readonly stopped: boolean;
1168
+ type: AutomationType;
1174
1169
  /**
1175
- * Initializes a new instance of the {@link PlayerStateChangedEventArgs} class.
1176
- * @param state The state.
1170
+ * Gets or sets the target value of the automation.
1177
1171
  */
1178
- constructor(state: PlayerState, stopped: boolean);
1172
+ value: number;
1173
+ /**
1174
+ * Gets or sets the relative position of of the automation.
1175
+ */
1176
+ ratioPosition: number;
1177
+ /**
1178
+ * Gets or sets the additional text of the automation.
1179
+ */
1180
+ text: string;
1181
+ static buildTempoAutomation(isLinear: boolean, ratioPosition: number, value: number, reference: number): Automation;
1182
+ static buildInstrumentAutomation(isLinear: boolean, ratioPosition: number, value: number): Automation;
1179
1183
  }
1180
1184
 
1181
1185
  /**
1182
- * Represents the info when the time in the synthesizer changes.
1186
+ * A single point of a bending graph. Used to
1187
+ * describe WhammyBar and String Bending effects.
1188
+ * @cloneable
1189
+ * @json
1190
+ * @json_strict
1183
1191
  */
1184
- declare class PositionChangedEventArgs {
1192
+ declare class BendPoint {
1193
+ static readonly MaxPosition: number;
1194
+ static readonly MaxValue: number;
1185
1195
  /**
1186
- * Gets a value indicating whether the position changed because of time seeking.
1196
+ * Gets or sets offset of the point relative to the note duration (0-60)
1187
1197
  */
1188
- isSeek: boolean;
1198
+ offset: number;
1189
1199
  /**
1190
- * Gets the current time in milliseconds.
1200
+ * Gets or sets the 1/4 note value offsets for the bend.
1191
1201
  */
1192
- readonly currentTime: number;
1202
+ value: number;
1193
1203
  /**
1194
- * Gets the length of the played song in milliseconds.
1204
+ * Initializes a new instance of the {@link BendPoint} class.
1205
+ * @param offset The offset.
1206
+ * @param value The value.
1195
1207
  */
1196
- readonly endTime: number;
1208
+ constructor(offset?: number, value?: number);
1209
+ }
1210
+
1211
+ /**
1212
+ * Lists the different bend styles
1213
+ */
1214
+ declare enum BendStyle {
1197
1215
  /**
1198
- * Gets the current time in midi ticks.
1216
+ * The bends are as described by the bend points
1199
1217
  */
1200
- readonly currentTick: number;
1218
+ Default = 0,
1201
1219
  /**
1202
- * Gets the length of the played song in midi ticks.
1220
+ * The bends are gradual over the beat duration.
1203
1221
  */
1204
- readonly endTick: number;
1222
+ Gradual = 1,
1205
1223
  /**
1206
- * Initializes a new instance of the {@link PositionChangedEventArgs} class.
1207
- * @param currentTime The current time.
1208
- * @param endTime The end time.
1209
- * @param currentTick The current tick.
1210
- * @param endTick The end tick.
1211
- * @param isSeek Whether the time was seeked.
1224
+ * The bends are done fast before the next note.
1212
1225
  */
1213
- constructor(currentTime: number, endTime: number, currentTick: number, endTick: number, isSeek: boolean);
1214
- }
1215
-
1216
- interface IEventEmitter {
1217
- on(value: () => void): void;
1218
- off(value: () => void): void;
1219
- }
1220
- /**
1221
- * @partial
1222
- */
1223
- interface IEventEmitterOfT<T> {
1224
- on(value: (arg: T) => void): void;
1225
- off(value: (arg: T) => void): void;
1226
+ Fast = 2
1226
1227
  }
1227
1228
 
1228
1229
  /**
1229
- * Represents the info when the synthesizer played certain midi events.
1230
+ * Lists all types of how to brush multiple notes on a beat.
1230
1231
  */
1231
- declare class MidiEventsPlayedEventArgs {
1232
+ declare enum BrushType {
1232
1233
  /**
1233
- * Gets the events which were played.
1234
+ * No brush.
1234
1235
  */
1235
- readonly events: MidiEvent[];
1236
+ None = 0,
1236
1237
  /**
1237
- * Initializes a new instance of the {@link MidiEventsPlayedEventArgs} class.
1238
- * @param events The events which were played.
1238
+ * Normal brush up.
1239
1239
  */
1240
- constructor(events: MidiEvent[]);
1240
+ BrushUp = 1,
1241
+ /**
1242
+ * Normal brush down.
1243
+ */
1244
+ BrushDown = 2,
1245
+ /**
1246
+ * Arpeggio up.
1247
+ */
1248
+ ArpeggioUp = 3,
1249
+ /**
1250
+ * Arpeggio down.
1251
+ */
1252
+ ArpeggioDown = 4
1241
1253
  }
1242
1254
 
1243
1255
  /**
1244
- * The public API interface for interacting with the synthesizer.
1256
+ * This public enumeration lists all supported Clefs.
1245
1257
  */
1246
- interface IAlphaSynth {
1258
+ declare enum Clef {
1247
1259
  /**
1248
- * Gets or sets whether the synthesizer is ready for interaction. (output and worker are initialized)
1260
+ * Neutral clef.
1249
1261
  */
1250
- readonly isReady: boolean;
1262
+ Neutral = 0,
1251
1263
  /**
1252
- * Gets or sets whether the synthesizer is ready for playback. (output, worker are initialized, soundfont and midi are loaded)
1264
+ * C3 clef
1253
1265
  */
1254
- readonly isReadyForPlayback: boolean;
1266
+ C3 = 1,
1255
1267
  /**
1256
- * Gets the current player state.
1268
+ * C4 clef
1257
1269
  */
1258
- readonly state: PlayerState;
1270
+ C4 = 2,
1259
1271
  /**
1260
- * Gets or sets the loging level.
1272
+ * F4 clef
1261
1273
  */
1262
- logLevel: LogLevel;
1274
+ F4 = 3,
1263
1275
  /**
1264
- * Gets or sets the current master volume as percentage. (range: 0.0-3.0, default 1.0)
1276
+ * G2 clef
1265
1277
  */
1266
- masterVolume: number;
1278
+ G2 = 4
1279
+ }
1280
+
1281
+ /**
1282
+ * Lists all types of fermatas
1283
+ */
1284
+ declare enum FermataType {
1267
1285
  /**
1268
- * Gets or sets the metronome volume. (range: 0.0-3.0, default 0.0)
1286
+ * A short fermata (triangle symbol)
1269
1287
  */
1270
- metronomeVolume: number;
1288
+ Short = 0,
1271
1289
  /**
1272
- * Gets or sets the current playback speed as percentage. (range: 0.125-8.0, default: 1.0)
1290
+ * A medium fermata (round symbol)
1273
1291
  */
1274
- playbackSpeed: number;
1292
+ Medium = 1,
1275
1293
  /**
1276
- * Gets or sets the position within the song in midi ticks.
1294
+ * A long fermata (rectangular symbol)
1277
1295
  */
1278
- tickPosition: number;
1296
+ Long = 2
1297
+ }
1298
+ /**
1299
+ * Represents a fermata.
1300
+ * @json
1301
+ * @json_strict
1302
+ */
1303
+ declare class Fermata {
1279
1304
  /**
1280
- * Gets or sets the position within the song in milliseconds.
1305
+ * Gets or sets the type of fermata.
1281
1306
  */
1282
- timePosition: number;
1307
+ type: FermataType;
1283
1308
  /**
1284
- * Gets or sets the range of the song that should be played. Set this to null
1285
- * to play the whole song.
1309
+ * Gets or sets the actual lenght of the fermata.
1286
1310
  */
1287
- playbackRange: PlaybackRange | null;
1311
+ length: number;
1312
+ }
1313
+
1314
+ /**
1315
+ * This public enumeration lists all available key signatures
1316
+ */
1317
+ declare enum KeySignature {
1288
1318
  /**
1289
- * Gets or sets whether the playback should automatically restart after it finished.
1319
+ * Cb (7 flats)
1290
1320
  */
1291
- isLooping: boolean;
1321
+ Cb = -7,
1292
1322
  /**
1293
- * Gets or sets volume of the metronome during count-in. (range: 0.0-3.0, default 0.0 - no count in)
1323
+ * Gb (6 flats)
1294
1324
  */
1295
- countInVolume: number;
1325
+ Gb = -6,
1296
1326
  /**
1297
- * Gets or sets the midi events which will trigger the `midiEventsPlayed` event.
1298
- * To subscribe to Metronome events use the `SystemExclusiveEvent2` event type and check against `event.isMetronome`
1327
+ * Db (5 flats)
1299
1328
  */
1300
- midiEventsPlayedFilter: MidiEventType[];
1329
+ Db = -5,
1301
1330
  /**
1302
- * Destroys the synthesizer and all related components
1331
+ * Ab (4 flats)
1303
1332
  */
1304
- destroy(): void;
1333
+ Ab = -4,
1305
1334
  /**
1306
- * Starts the playback if possible
1307
- * @returns true if the playback was started, otherwise false. Reasons for not starting can be that the player is not ready or already playing.
1335
+ * Eb (3 flats)
1308
1336
  */
1309
- play(): boolean;
1337
+ Eb = -3,
1310
1338
  /**
1311
- * Pauses the playback if was running
1339
+ * Bb (2 flats)
1312
1340
  */
1313
- pause(): void;
1341
+ Bb = -2,
1314
1342
  /**
1315
- * Starts the playback if possible, pauses the playback if was running
1343
+ * F (1 flat)
1316
1344
  */
1317
- playPause(): void;
1345
+ F = -1,
1318
1346
  /**
1319
- * Stopps the playback
1347
+ * C (no signs)
1320
1348
  */
1321
- stop(): void;
1349
+ C = 0,
1322
1350
  /**
1323
- * Stops any ongoing playback and plays the given midi file instead.
1324
- * @param midi The midi file to play
1351
+ * G (1 sharp)
1325
1352
  */
1326
- playOneTimeMidiFile(midi: MidiFile): void;
1353
+ G = 1,
1327
1354
  /**
1328
- * Loads a soundfont from the given data
1329
- * @param data a byte array to load the data from
1330
- * @param append Whether to fully replace or append the data from the given soundfont.
1355
+ * D (2 sharp)
1331
1356
  */
1332
- loadSoundFont(data: Uint8Array, append: boolean): void;
1357
+ D = 2,
1333
1358
  /**
1334
- * Resets all loaded soundfonts as if they were not loaded.
1359
+ * A (3 sharp)
1335
1360
  */
1336
- resetSoundFonts(): void;
1337
- /**
1338
- * Loads the given midi file structure.
1339
- * @param midi
1340
- */
1341
- loadMidiFile(midi: MidiFile): void;
1342
- /**
1343
- * Sets the mute state of a channel.
1344
- * @param channel The channel number
1345
- * @param mute true if the channel should be muted, otherwise false.
1346
- */
1347
- setChannelMute(channel: number, mute: boolean): void;
1348
- /**
1349
- * Resets the mute/solo state of all channels
1350
- */
1351
- resetChannelStates(): void;
1352
- /**
1353
- * Gets the solo state of a channel.
1354
- * @param channel The channel number
1355
- * @param solo true if the channel should be played solo, otherwise false.
1356
- */
1357
- setChannelSolo(channel: number, solo: boolean): void;
1358
- /**
1359
- * Gets or sets the current and initial volume of the given channel.
1360
- * @param channel The channel number.
1361
- * @param volume The volume of of the channel (0.0-1.0)
1362
- */
1363
- setChannelVolume(channel: number, volume: number): void;
1364
- /**
1365
- * This event is fired when the player is ready to be interacted with.
1366
- */
1367
- readonly ready: IEventEmitter;
1368
- /**
1369
- * This event is fired when all required data for playback is loaded and ready.
1370
- */
1371
- readonly readyForPlayback: IEventEmitter;
1372
- /**
1373
- * This event is fired when the playback of the whole song finished.
1374
- */
1375
- readonly finished: IEventEmitter;
1376
- /**
1377
- * This event is fired when the SoundFont needed for playback was loaded.
1378
- */
1379
- readonly soundFontLoaded: IEventEmitter;
1380
- /**
1381
- * This event is fired when the loading of the SoundFont failed.
1382
- */
1383
- readonly soundFontLoadFailed: IEventEmitterOfT<Error>;
1384
- /**
1385
- * This event is fired when the Midi file needed for playback was loaded.
1386
- */
1387
- readonly midiLoaded: IEventEmitterOfT<PositionChangedEventArgs>;
1361
+ A = 3,
1388
1362
  /**
1389
- * This event is fired when the loading of the Midi file failed.
1363
+ * E (4 sharp)
1390
1364
  */
1391
- readonly midiLoadFailed: IEventEmitterOfT<Error>;
1365
+ E = 4,
1392
1366
  /**
1393
- * This event is fired when the playback state changed.
1367
+ * B (5 sharp)
1394
1368
  */
1395
- readonly stateChanged: IEventEmitterOfT<PlayerStateChangedEventArgs>;
1369
+ B = 5,
1396
1370
  /**
1397
- * This event is fired when the current playback position of/ the song changed.
1371
+ * F# (6 sharp)
1398
1372
  */
1399
- readonly positionChanged: IEventEmitterOfT<PositionChangedEventArgs>;
1373
+ FSharp = 6,
1400
1374
  /**
1401
- * The event is fired when certain midi events were sent to the audio output device for playback.
1375
+ * C# (8 sharp)
1402
1376
  */
1403
- readonly midiEventsPlayed: IEventEmitterOfT<MidiEventsPlayedEventArgs>;
1377
+ CSharp = 7
1404
1378
  }
1405
1379
 
1406
1380
  /**
1407
- * This public enumeration lists all types of automations.
1381
+ * This public enumeration lists all available types of KeySignatures
1408
1382
  */
1409
- declare enum AutomationType {
1410
- /**
1411
- * Tempo change.
1412
- */
1413
- Tempo = 0,
1414
- /**
1415
- * Colume change.
1416
- */
1417
- Volume = 1,
1383
+ declare enum KeySignatureType {
1418
1384
  /**
1419
- * Instrument change.
1385
+ * Major
1420
1386
  */
1421
- Instrument = 2,
1387
+ Major = 0,
1422
1388
  /**
1423
- * Balance change.
1389
+ * Minor
1424
1390
  */
1425
- Balance = 3
1426
- }
1391
+ Minor = 1
1392
+ }
1393
+
1427
1394
  /**
1428
- * Automations are used to change the behaviour of a song.
1429
- * @cloneable
1430
- * @json
1431
- * @json_strict
1395
+ * This public class can store the information about a group of measures which are repeated
1432
1396
  */
1433
- declare class Automation {
1397
+ declare class RepeatGroup {
1434
1398
  /**
1435
- * Gets or sets whether the automation is applied linear.
1399
+ * All masterbars repeated within this group
1436
1400
  */
1437
- isLinear: boolean;
1401
+ masterBars: MasterBar[];
1438
1402
  /**
1439
- * Gets or sets the type of the automation.
1403
+ * a list of masterbars which open the group.
1440
1404
  */
1441
- type: AutomationType;
1405
+ openings: MasterBar[];
1442
1406
  /**
1443
- * Gets or sets the target value of the automation.
1407
+ * a list of masterbars which close the group.
1444
1408
  */
1445
- value: number;
1409
+ closings: MasterBar[];
1446
1410
  /**
1447
- * Gets or sets the relative position of of the automation.
1411
+ * true if the repeat group was opened well
1448
1412
  */
1449
- ratioPosition: number;
1413
+ isOpened: boolean;
1450
1414
  /**
1451
- * Gets or sets the additional text of the automation.
1415
+ * true if the repeat group was closed well
1452
1416
  */
1453
- text: string;
1454
- static buildTempoAutomation(isLinear: boolean, ratioPosition: number, value: number, reference: number): Automation;
1455
- static buildInstrumentAutomation(isLinear: boolean, ratioPosition: number, value: number): Automation;
1417
+ isClosed: boolean;
1418
+ addMasterBar(masterBar: MasterBar): void;
1456
1419
  }
1457
1420
 
1458
1421
  /**
1459
- * A single point of a bending graph. Used to
1460
- * describe WhammyBar and String Bending effects.
1461
- * @cloneable
1422
+ * This class represents the rendering stylesheet.
1423
+ * It contains settings which control the display of the score when rendered.
1462
1424
  * @json
1463
1425
  * @json_strict
1464
1426
  */
1465
- declare class BendPoint {
1466
- static readonly MaxPosition: number;
1467
- static readonly MaxValue: number;
1468
- /**
1469
- * Gets or sets offset of the point relative to the note duration (0-60)
1470
- */
1471
- offset: number;
1472
- /**
1473
- * Gets or sets the 1/4 note value offsets for the bend.
1474
- */
1475
- value: number;
1427
+ declare class RenderStylesheet {
1476
1428
  /**
1477
- * Initializes a new instance of the {@link BendPoint} class.
1478
- * @param offset The offset.
1479
- * @param value The value.
1429
+ * Gets or sets whether dynamics are hidden.
1480
1430
  */
1481
- constructor(offset?: number, value?: number);
1431
+ hideDynamics: boolean;
1482
1432
  }
1483
1433
 
1484
1434
  /**
1485
- * Lists the different bend styles
1435
+ * Represents the lyrics of a song.
1486
1436
  */
1487
- declare enum BendStyle {
1437
+ declare class Lyrics {
1438
+ private static readonly CharCodeLF;
1439
+ private static readonly CharCodeTab;
1440
+ private static readonly CharCodeCR;
1441
+ private static readonly CharCodeSpace;
1442
+ private static readonly CharCodeBrackedClose;
1443
+ private static readonly CharCodeBrackedOpen;
1444
+ private static readonly CharCodeDash;
1488
1445
  /**
1489
- * The bends are as described by the bend points
1446
+ * Gets or sets he start bar on which the lyrics should begin.
1490
1447
  */
1491
- Default = 0,
1448
+ startBar: number;
1492
1449
  /**
1493
- * The bends are gradual over the beat duration.
1450
+ * Gets or sets the raw lyrics text in Guitar Pro format.
1451
+ * (spaces split word syllables, plus merge syllables, [..] are comments)
1494
1452
  */
1495
- Gradual = 1,
1453
+ text: string;
1496
1454
  /**
1497
- * The bends are done fast before the next note.
1455
+ * Gets or sets the prepared chunks of the lyrics to apply to beats.
1498
1456
  */
1499
- Fast = 2
1457
+ chunks: string[];
1458
+ finish(skipEmptyEntries?: boolean): void;
1459
+ private parse;
1460
+ private addChunk;
1461
+ private prepareChunk;
1500
1462
  }
1501
1463
 
1502
1464
  /**
1503
- * Lists all types of how to brush multiple notes on a beat.
1465
+ * This public class stores the midi specific information of a track needed
1466
+ * for playback.
1467
+ * @json
1468
+ * @json_strict
1504
1469
  */
1505
- declare enum BrushType {
1506
- /**
1507
- * No brush.
1508
- */
1509
- None = 0,
1510
- /**
1511
- * Normal brush up.
1512
- */
1513
- BrushUp = 1,
1470
+ declare class PlaybackInformation {
1514
1471
  /**
1515
- * Normal brush down.
1472
+ * Gets or sets the volume (0-16)
1516
1473
  */
1517
- BrushDown = 2,
1474
+ volume: number;
1518
1475
  /**
1519
- * Arpeggio up.
1476
+ * Gets or sets the balance (0-16; 8=center)
1520
1477
  */
1521
- ArpeggioUp = 3,
1478
+ balance: number;
1522
1479
  /**
1523
- * Arpeggio down.
1480
+ * Gets or sets the midi port to use.
1524
1481
  */
1525
- ArpeggioDown = 4
1526
- }
1527
-
1528
- /**
1529
- * This public enumeration lists all supported Clefs.
1530
- */
1531
- declare enum Clef {
1482
+ port: number;
1532
1483
  /**
1533
- * Neutral clef.
1484
+ * Gets or sets the midi program to use.
1534
1485
  */
1535
- Neutral = 0,
1486
+ program: number;
1536
1487
  /**
1537
- * C3 clef
1488
+ * Gets or sets the primary channel for all normal midi events.
1538
1489
  */
1539
- C3 = 1,
1490
+ primaryChannel: number;
1540
1491
  /**
1541
- * C4 clef
1492
+ * Gets or sets the secondary channel for special midi events.
1542
1493
  */
1543
- C4 = 2,
1494
+ secondaryChannel: number;
1544
1495
  /**
1545
- * F4 clef
1496
+ * Gets or sets whether the track is muted.
1546
1497
  */
1547
- F4 = 3,
1498
+ isMute: boolean;
1548
1499
  /**
1549
- * G2 clef
1500
+ * Gets or sets whether the track is playing alone.
1550
1501
  */
1551
- G2 = 4
1502
+ isSolo: boolean;
1552
1503
  }
1553
1504
 
1554
1505
  /**
1555
- * Lists all types of fermatas
1556
- */
1557
- declare enum FermataType {
1558
- /**
1559
- * A short fermata (triangle symbol)
1560
- */
1561
- Short = 0,
1562
- /**
1563
- * A medium fermata (round symbol)
1564
- */
1565
- Medium = 1,
1566
- /**
1567
- * A long fermata (rectangular symbol)
1568
- */
1569
- Long = 2
1570
- }
1571
- /**
1572
- * Represents a fermata.
1573
- * @json
1574
- * @json_strict
1575
- */
1576
- declare class Fermata {
1577
- /**
1578
- * Gets or sets the type of fermata.
1579
- */
1580
- type: FermataType;
1581
- /**
1582
- * Gets or sets the actual lenght of the fermata.
1583
- */
1584
- length: number;
1585
- }
1586
-
1587
- /**
1588
- * This public enumeration lists all available key signatures
1589
- */
1590
- declare enum KeySignature {
1591
- /**
1592
- * Cb (7 flats)
1593
- */
1594
- Cb = -7,
1595
- /**
1596
- * Gb (6 flats)
1597
- */
1598
- Gb = -6,
1599
- /**
1600
- * Db (5 flats)
1601
- */
1602
- Db = -5,
1603
- /**
1604
- * Ab (4 flats)
1605
- */
1606
- Ab = -4,
1607
- /**
1608
- * Eb (3 flats)
1609
- */
1610
- Eb = -3,
1611
- /**
1612
- * Bb (2 flats)
1613
- */
1614
- Bb = -2,
1615
- /**
1616
- * F (1 flat)
1617
- */
1618
- F = -1,
1619
- /**
1620
- * C (no signs)
1621
- */
1622
- C = 0,
1623
- /**
1624
- * G (1 sharp)
1625
- */
1626
- G = 1,
1627
- /**
1628
- * D (2 sharp)
1629
- */
1630
- D = 2,
1631
- /**
1632
- * A (3 sharp)
1633
- */
1634
- A = 3,
1635
- /**
1636
- * E (4 sharp)
1637
- */
1638
- E = 4,
1639
- /**
1640
- * B (5 sharp)
1641
- */
1642
- B = 5,
1643
- /**
1644
- * F# (6 sharp)
1645
- */
1646
- FSharp = 6,
1647
- /**
1648
- * C# (8 sharp)
1649
- */
1650
- CSharp = 7
1651
- }
1652
-
1653
- /**
1654
- * This public enumeration lists all available types of KeySignatures
1655
- */
1656
- declare enum KeySignatureType {
1657
- /**
1658
- * Major
1659
- */
1660
- Major = 0,
1661
- /**
1662
- * Minor
1663
- */
1664
- Minor = 1
1665
- }
1666
-
1667
- /**
1668
- * This public class can store the information about a group of measures which are repeated
1669
- */
1670
- declare class RepeatGroup {
1671
- /**
1672
- * All masterbars repeated within this group
1673
- */
1674
- masterBars: MasterBar[];
1675
- /**
1676
- * a list of masterbars which open the group.
1677
- */
1678
- openings: MasterBar[];
1679
- /**
1680
- * a list of masterbars which close the group.
1681
- */
1682
- closings: MasterBar[];
1683
- /**
1684
- * true if the repeat group was opened well
1685
- */
1686
- isOpened: boolean;
1687
- /**
1688
- * true if the repeat group was closed well
1689
- */
1690
- isClosed: boolean;
1691
- addMasterBar(masterBar: MasterBar): void;
1692
- }
1693
-
1694
- /**
1695
- * This class represents the rendering stylesheet.
1696
- * It contains settings which control the display of the score when rendered.
1697
- * @json
1698
- * @json_strict
1699
- */
1700
- declare class RenderStylesheet {
1701
- /**
1702
- * Gets or sets whether dynamics are hidden.
1703
- */
1704
- hideDynamics: boolean;
1705
- }
1706
-
1707
- /**
1708
- * Represents the lyrics of a song.
1709
- */
1710
- declare class Lyrics {
1711
- private static readonly CharCodeLF;
1712
- private static readonly CharCodeTab;
1713
- private static readonly CharCodeCR;
1714
- private static readonly CharCodeSpace;
1715
- private static readonly CharCodeBrackedClose;
1716
- private static readonly CharCodeBrackedOpen;
1717
- private static readonly CharCodeDash;
1718
- /**
1719
- * Gets or sets he start bar on which the lyrics should begin.
1720
- */
1721
- startBar: number;
1722
- /**
1723
- * Gets or sets the raw lyrics text in Guitar Pro format.
1724
- * (spaces split word syllables, plus merge syllables, [..] are comments)
1725
- */
1726
- text: string;
1727
- /**
1728
- * Gets or sets the prepared chunks of the lyrics to apply to beats.
1729
- */
1730
- chunks: string[];
1731
- finish(skipEmptyEntries?: boolean): void;
1732
- private parse;
1733
- private addChunk;
1734
- private prepareChunk;
1735
- }
1736
-
1737
- /**
1738
- * This public class stores the midi specific information of a track needed
1739
- * for playback.
1740
- * @json
1741
- * @json_strict
1742
- */
1743
- declare class PlaybackInformation {
1744
- /**
1745
- * Gets or sets the volume (0-16)
1746
- */
1747
- volume: number;
1748
- /**
1749
- * Gets or sets the balance (0-16; 8=center)
1750
- */
1751
- balance: number;
1752
- /**
1753
- * Gets or sets the midi port to use.
1754
- */
1755
- port: number;
1756
- /**
1757
- * Gets or sets the midi program to use.
1758
- */
1759
- program: number;
1760
- /**
1761
- * Gets or sets the primary channel for all normal midi events.
1762
- */
1763
- primaryChannel: number;
1764
- /**
1765
- * Gets or sets the secondary channel for special midi events.
1766
- */
1767
- secondaryChannel: number;
1768
- /**
1769
- * Gets or sets whether the track is muted.
1770
- */
1771
- isMute: boolean;
1772
- /**
1773
- * Gets or sets whether the track is playing alone.
1774
- */
1775
- isSolo: boolean;
1776
- }
1777
-
1778
- /**
1779
- * Lists all music font symbols used within alphaTab. The names
1780
- * and values are aligned with the SMuFL standard.
1506
+ * Lists all music font symbols used within alphaTab. The names
1507
+ * and values are aligned with the SMuFL standard.
1781
1508
  */
1782
1509
  declare enum MusicFontSymbol {
1783
1510
  None = -1,
@@ -3186,681 +2913,1119 @@ declare class Note {
3186
2913
  * - 126 Ride (middle)
3187
2914
  * - 127 Ride (bell)
3188
2915
  */
3189
- percussionArticulation: number;
2916
+ percussionArticulation: number;
2917
+ /**
2918
+ * Gets or sets whether this note is visible on the music sheet.
2919
+ */
2920
+ isVisible: boolean;
2921
+ /**
2922
+ * Gets a value indicating whether the note is left hand tapped.
2923
+ */
2924
+ isLeftHandTapped: boolean;
2925
+ /**
2926
+ * Gets or sets whether this note starts a hammeron or pulloff.
2927
+ */
2928
+ isHammerPullOrigin: boolean;
2929
+ get isHammerPullDestination(): boolean;
2930
+ /**
2931
+ * Gets the origin of the hammeron/pulloff of this note.
2932
+ * @clone_ignore
2933
+ * @json_ignore
2934
+ */
2935
+ hammerPullOrigin: Note | null;
2936
+ /**
2937
+ * Gets the destination for the hammeron/pullof started by this note.
2938
+ * @clone_ignore
2939
+ * @json_ignore
2940
+ */
2941
+ hammerPullDestination: Note | null;
2942
+ get isSlurOrigin(): boolean;
2943
+ /**
2944
+ * Gets or sets whether this note finishes a slur.
2945
+ */
2946
+ isSlurDestination: boolean;
2947
+ /**
2948
+ * Gets or sets the note where the slur of this note starts.
2949
+ * @clone_ignore
2950
+ * @json_ignore
2951
+ */
2952
+ slurOrigin: Note | null;
2953
+ /**
2954
+ * Gets or sets the note where the slur of this note ends.
2955
+ * @clone_ignore
2956
+ * @json_ignore
2957
+ */
2958
+ slurDestination: Note | null;
2959
+ get isHarmonic(): boolean;
2960
+ /**
2961
+ * Gets or sets the harmonic type applied to this note.
2962
+ */
2963
+ harmonicType: HarmonicType;
2964
+ /**
2965
+ * Gets or sets the value defining the harmonic pitch.
2966
+ */
2967
+ harmonicValue: number;
2968
+ /**
2969
+ * Gets or sets whether the note is a ghost note and shown in parenthesis. Also this will make the note a bit more silent.
2970
+ */
2971
+ isGhost: boolean;
2972
+ /**
2973
+ * Gets or sets whether this note has a let-ring effect.
2974
+ */
2975
+ isLetRing: boolean;
2976
+ /**
2977
+ * Gets or sets the destination note for the let-ring effect.
2978
+ * @clone_ignore
2979
+ * @json_ignore
2980
+ */
2981
+ letRingDestination: Note | null;
2982
+ /**
2983
+ * Gets or sets whether this note has a palm-mute effect.
2984
+ */
2985
+ isPalmMute: boolean;
2986
+ /**
2987
+ * Gets or sets the destination note for the palm-mute effect.
2988
+ * @clone_ignore
2989
+ * @json_ignore
2990
+ */
2991
+ palmMuteDestination: Note | null;
2992
+ /**
2993
+ * Gets or sets whether the note is shown and played as dead note.
2994
+ */
2995
+ isDead: boolean;
2996
+ /**
2997
+ * Gets or sets whether the note is played as staccato.
2998
+ */
2999
+ isStaccato: boolean;
3000
+ /**
3001
+ * Gets or sets the slide-in type this note is played with.
3002
+ */
3003
+ slideInType: SlideInType;
3004
+ /**
3005
+ * Gets or sets the slide-out type this note is played with.
3006
+ */
3007
+ slideOutType: SlideOutType;
3008
+ /**
3009
+ * Gets or sets the target note for several slide types.
3010
+ * @clone_ignore
3011
+ * @json_ignore
3012
+ */
3013
+ slideTarget: Note | null;
3014
+ /**
3015
+ * Gets or sets the source note for several slide types.
3016
+ * @clone_ignore
3017
+ * @json_ignore
3018
+ */
3019
+ slideOrigin: Note | null;
3020
+ /**
3021
+ * Gets or sets whether a vibrato is played on the note.
3022
+ */
3023
+ vibrato: VibratoType;
3024
+ /**
3025
+ * Gets the origin of the tied if this note is tied.
3026
+ * @clone_ignore
3027
+ * @json_ignore
3028
+ */
3029
+ tieOrigin: Note | null;
3030
+ /**
3031
+ * Gets the desination of the tie.
3032
+ * @clone_ignore
3033
+ * @json_ignore
3034
+ */
3035
+ tieDestination: Note | null;
3036
+ /**
3037
+ * Gets or sets whether this note is ends a tied note.
3038
+ */
3039
+ isTieDestination: boolean;
3040
+ get isTieOrigin(): boolean;
3041
+ /**
3042
+ * Gets or sets the fingers used for this note on the left hand.
3043
+ */
3044
+ leftHandFinger: Fingers;
3045
+ /**
3046
+ * Gets or sets the fingers used for this note on the right hand.
3047
+ */
3048
+ rightHandFinger: Fingers;
3049
+ /**
3050
+ * Gets or sets whether this note has fingering defined.
3051
+ */
3052
+ isFingering: boolean;
3053
+ /**
3054
+ * Gets or sets the target note value for the trill effect.
3055
+ */
3056
+ trillValue: number;
3057
+ get trillFret(): number;
3058
+ get isTrill(): boolean;
3059
+ /**
3060
+ * Gets or sets the speed of the trill effect.
3061
+ */
3062
+ trillSpeed: Duration;
3063
+ /**
3064
+ * Gets or sets the percentual duration of the note relative to the overall beat duration .
3065
+ */
3066
+ durationPercent: number;
3067
+ /**
3068
+ * Gets or sets how accidetnals for this note should be handled.
3069
+ */
3070
+ accidentalMode: NoteAccidentalMode;
3071
+ /**
3072
+ * Gets or sets the reference to the parent beat to which this note belongs to.
3073
+ * @clone_ignore
3074
+ * @json_ignore
3075
+ */
3076
+ beat: Beat;
3077
+ /**
3078
+ * Gets or sets the dynamics for this note.
3079
+ */
3080
+ dynamics: DynamicValue;
3081
+ /**
3082
+ * @clone_ignore
3083
+ * @json_ignore
3084
+ */
3085
+ isEffectSlurOrigin: boolean;
3086
+ /**
3087
+ * @clone_ignore
3088
+ * @json_ignore
3089
+ */
3090
+ hasEffectSlur: boolean;
3091
+ get isEffectSlurDestination(): boolean;
3092
+ /**
3093
+ * @clone_ignore
3094
+ * @json_ignore
3095
+ */
3096
+ effectSlurOrigin: Note | null;
3097
+ /**
3098
+ * @clone_ignore
3099
+ * @json_ignore
3100
+ */
3101
+ effectSlurDestination: Note | null;
3102
+ get stringTuning(): number;
3103
+ static getStringTuning(staff: Staff, noteString: number): number;
3104
+ get realValue(): number;
3105
+ get realValueWithoutHarmonic(): number;
3106
+ get harmonicPitch(): number;
3107
+ get initialBendValue(): number;
3108
+ get displayValue(): number;
3109
+ get displayValueWithoutBend(): number;
3110
+ get hasQuarterToneOffset(): boolean;
3111
+ addBendPoint(point: BendPoint): void;
3112
+ finish(settings: Settings, sharedDataBag: Map<string, unknown>): void;
3113
+ private static readonly MaxOffsetForSameLineSearch;
3114
+ static nextNoteOnSameLine(note: Note): Note | null;
3115
+ static findHammerPullDestination(note: Note): Note | null;
3116
+ static findTieOrigin(note: Note): Note | null;
3117
+ private static NoteIdLookupKey;
3118
+ private _noteIdBag;
3119
+ chain(sharedDataBag: Map<string, unknown>): void;
3120
+ /**
3121
+ * @internal
3122
+ */
3123
+ toJson(o: Map<string, unknown>): void;
3124
+ /**
3125
+ * @internal
3126
+ */
3127
+ setProperty(property: string, v: unknown): boolean;
3128
+ }
3129
+
3130
+ /**
3131
+ * Lists all types of pick strokes.
3132
+ */
3133
+ declare enum PickStroke {
3134
+ /**
3135
+ * No pickstroke used.
3136
+ */
3137
+ None = 0,
3138
+ /**
3139
+ * Pickstroke up.
3140
+ */
3141
+ Up = 1,
3142
+ /**
3143
+ * Pickstroke down
3144
+ */
3145
+ Down = 2
3146
+ }
3147
+
3148
+ /**
3149
+ * Represents a list of beats that are grouped within the same tuplet.
3150
+ */
3151
+ declare class TupletGroup {
3152
+ private static readonly HalfTicks;
3153
+ private static readonly QuarterTicks;
3154
+ private static readonly EighthTicks;
3155
+ private static readonly SixteenthTicks;
3156
+ private static readonly ThirtySecondTicks;
3157
+ private static readonly SixtyFourthTicks;
3158
+ private static readonly OneHundredTwentyEighthTicks;
3159
+ private static readonly TwoHundredFiftySixthTicks;
3160
+ private static AllTicks;
3161
+ private _isEqualLengthTuplet;
3162
+ totalDuration: number;
3163
+ /**
3164
+ * Gets or sets the list of beats contained in this group.
3165
+ */
3166
+ beats: Beat[];
3167
+ /**
3168
+ * Gets or sets the voice this group belongs to.
3169
+ */
3170
+ voice: Voice;
3171
+ /**
3172
+ * Gets a value indicating whether the tuplet group is fully filled.
3173
+ */
3174
+ isFull: boolean;
3175
+ /**
3176
+ * Initializes a new instance of the {@link TupletGroup} class.
3177
+ * @param voice The voice this group belongs to.
3178
+ */
3179
+ constructor(voice: Voice);
3180
+ check(beat: Beat): boolean;
3181
+ }
3182
+
3183
+ /**
3184
+ * Lists all types of whammy bars
3185
+ */
3186
+ declare enum WhammyType {
3187
+ /**
3188
+ * No whammy at all
3189
+ */
3190
+ None = 0,
3191
+ /**
3192
+ * Individual points define the whammy in a flexible manner.
3193
+ * This system was mainly used in Guitar Pro 3-5
3194
+ */
3195
+ Custom = 1,
3196
+ /**
3197
+ * Simple dive to a lower or higher note.
3198
+ */
3199
+ Dive = 2,
3200
+ /**
3201
+ * A dive to a lower or higher note and releasing it back to normal.
3202
+ */
3203
+ Dip = 3,
3204
+ /**
3205
+ * Continue to hold the whammy at the position from a previous whammy.
3206
+ */
3207
+ Hold = 4,
3208
+ /**
3209
+ * Dive to a lower or higher note before playing it.
3210
+ */
3211
+ Predive = 5,
3212
+ /**
3213
+ * Dive to a lower or higher note before playing it, then change to another
3214
+ * note.
3215
+ */
3216
+ PrediveDive = 6
3217
+ }
3218
+
3219
+ declare enum BeamDirection {
3220
+ Up = 0,
3221
+ Down = 1
3222
+ }
3223
+
3224
+ /**
3225
+ * Represents a group of grace beats that belong together
3226
+ */
3227
+ declare class GraceGroup {
3228
+ /**
3229
+ * All beats within this group.
3230
+ */
3231
+ beats: Beat[];
3232
+ /**
3233
+ * Gets a unique ID for this grace group.
3234
+ */
3235
+ id: string;
3236
+ /**
3237
+ * true if the grace beat are followed by a normal beat within the same
3238
+ * bar.
3239
+ */
3240
+ isComplete: boolean;
3241
+ /**
3242
+ * Adds a new beat to this group
3243
+ * @param beat The beat to add
3244
+ */
3245
+ addBeat(beat: Beat): void;
3246
+ finish(): void;
3247
+ }
3248
+
3249
+ /**
3250
+ * Lists the different modes on how beaming for a beat should be done.
3251
+ */
3252
+ declare enum BeatBeamingMode {
3253
+ /**
3254
+ * Automatic beaming based on the timing rules.
3255
+ */
3256
+ Auto = 0,
3257
+ /**
3258
+ * Force a split to the next beat.
3259
+ */
3260
+ ForceSplitToNext = 1,
3261
+ /**
3262
+ * Force a merge with the next beat.
3263
+ */
3264
+ ForceMergeWithNext = 2
3265
+ }
3266
+ /**
3267
+ * A beat is a single block within a bar. A beat is a combination
3268
+ * of several notes played at the same time.
3269
+ * @json
3270
+ * @json_strict
3271
+ * @cloneable
3272
+ */
3273
+ declare class Beat {
3274
+ private static _globalBeatId;
3275
+ /**
3276
+ * Gets or sets the unique id of this beat.
3277
+ * @clone_ignore
3278
+ */
3279
+ id: number;
3280
+ /**
3281
+ * Gets or sets the zero-based index of this beat within the voice.
3282
+ * @json_ignore
3283
+ */
3284
+ index: number;
3285
+ /**
3286
+ * Gets or sets the previous beat within the whole song.
3287
+ * @json_ignore
3288
+ * @clone_ignore
3289
+ */
3290
+ previousBeat: Beat | null;
3291
+ /**
3292
+ * Gets or sets the next beat within the whole song.
3293
+ * @json_ignore
3294
+ * @clone_ignore
3295
+ */
3296
+ nextBeat: Beat | null;
3297
+ get isLastOfVoice(): boolean;
3190
3298
  /**
3191
- * Gets or sets whether this note is visible on the music sheet.
3299
+ * Gets or sets the reference to the parent voice this beat belongs to.
3300
+ * @json_ignore
3301
+ * @clone_ignore
3192
3302
  */
3193
- isVisible: boolean;
3303
+ voice: Voice;
3194
3304
  /**
3195
- * Gets a value indicating whether the note is left hand tapped.
3305
+ * Gets or sets the list of notes contained in this beat.
3306
+ * @json_add addNote
3307
+ * @clone_add addNote
3196
3308
  */
3197
- isLeftHandTapped: boolean;
3309
+ notes: Note[];
3198
3310
  /**
3199
- * Gets or sets whether this note starts a hammeron or pulloff.
3311
+ * Gets the lookup where the notes per string are registered.
3312
+ * If this staff contains string based notes this lookup allows fast access.
3313
+ * @json_ignore
3200
3314
  */
3201
- isHammerPullOrigin: boolean;
3202
- get isHammerPullDestination(): boolean;
3315
+ readonly noteStringLookup: Map<number, Note>;
3203
3316
  /**
3204
- * Gets the origin of the hammeron/pulloff of this note.
3205
- * @clone_ignore
3317
+ * Gets the lookup where the notes per value are registered.
3318
+ * If this staff contains string based notes this lookup allows fast access.
3206
3319
  * @json_ignore
3207
3320
  */
3208
- hammerPullOrigin: Note | null;
3321
+ readonly noteValueLookup: Map<number, Note>;
3209
3322
  /**
3210
- * Gets the destination for the hammeron/pullof started by this note.
3323
+ * Gets or sets a value indicating whether this beat is considered empty.
3324
+ */
3325
+ isEmpty: boolean;
3326
+ /**
3327
+ * Gets or sets which whammy bar style should be used for this bar.
3328
+ */
3329
+ whammyStyle: BendStyle;
3330
+ /**
3331
+ * Gets or sets the ottava applied to this beat.
3332
+ */
3333
+ ottava: Ottavia;
3334
+ /**
3335
+ * Gets or sets the fermata applied to this beat.
3211
3336
  * @clone_ignore
3212
3337
  * @json_ignore
3213
3338
  */
3214
- hammerPullDestination: Note | null;
3215
- get isSlurOrigin(): boolean;
3339
+ fermata: Fermata | null;
3216
3340
  /**
3217
- * Gets or sets whether this note finishes a slur.
3341
+ * Gets a value indicating whether this beat starts a legato slur.
3218
3342
  */
3219
- isSlurDestination: boolean;
3343
+ isLegatoOrigin: boolean;
3344
+ get isLegatoDestination(): boolean;
3220
3345
  /**
3221
- * Gets or sets the note where the slur of this note starts.
3222
- * @clone_ignore
3346
+ * Gets or sets the note with the lowest pitch in this beat. Only visible notes are considered.
3223
3347
  * @json_ignore
3348
+ * @clone_ignore
3224
3349
  */
3225
- slurOrigin: Note | null;
3350
+ minNote: Note | null;
3226
3351
  /**
3227
- * Gets or sets the note where the slur of this note ends.
3352
+ * Gets or sets the note with the highest pitch in this beat. Only visible notes are considered.
3353
+ * @json_ignore
3228
3354
  * @clone_ignore
3355
+ */
3356
+ maxNote: Note | null;
3357
+ /**
3358
+ * Gets or sets the note with the highest string number in this beat. Only visible notes are considered.
3229
3359
  * @json_ignore
3360
+ * @clone_ignore
3230
3361
  */
3231
- slurDestination: Note | null;
3232
- get isHarmonic(): boolean;
3362
+ maxStringNote: Note | null;
3233
3363
  /**
3234
- * Gets or sets the harmonic type applied to this note.
3364
+ * Gets or sets the note with the lowest string number in this beat. Only visible notes are considered.
3365
+ * @json_ignore
3366
+ * @clone_ignore
3235
3367
  */
3236
- harmonicType: HarmonicType;
3368
+ minStringNote: Note | null;
3237
3369
  /**
3238
- * Gets or sets the value defining the harmonic pitch.
3370
+ * Gets or sets the duration of this beat.
3239
3371
  */
3240
- harmonicValue: number;
3372
+ duration: Duration;
3373
+ get isRest(): boolean;
3241
3374
  /**
3242
- * Gets or sets whether the note is a ghost note and shown in parenthesis. Also this will make the note a bit more silent.
3375
+ * Gets a value indicating whether this beat is a full bar rest.
3243
3376
  */
3244
- isGhost: boolean;
3377
+ get isFullBarRest(): boolean;
3245
3378
  /**
3246
- * Gets or sets whether this note has a let-ring effect.
3379
+ * Gets or sets whether any note in this beat has a let-ring applied.
3380
+ * @json_ignore
3247
3381
  */
3248
3382
  isLetRing: boolean;
3249
3383
  /**
3250
- * Gets or sets the destination note for the let-ring effect.
3251
- * @clone_ignore
3384
+ * Gets or sets whether any note in this beat has a palm-mute paplied.
3252
3385
  * @json_ignore
3253
3386
  */
3254
- letRingDestination: Note | null;
3387
+ isPalmMute: boolean;
3255
3388
  /**
3256
- * Gets or sets whether this note has a palm-mute effect.
3389
+ * Gets or sets a list of all automations on this beat.
3257
3390
  */
3258
- isPalmMute: boolean;
3391
+ automations: Automation[];
3259
3392
  /**
3260
- * Gets or sets the destination note for the palm-mute effect.
3261
- * @clone_ignore
3262
- * @json_ignore
3393
+ * Gets or sets the number of dots applied to the duration of this beat.
3263
3394
  */
3264
- palmMuteDestination: Note | null;
3395
+ dots: number;
3265
3396
  /**
3266
- * Gets or sets whether the note is shown and played as dead note.
3397
+ * Gets or sets a value indicating whether this beat is fade-in.
3267
3398
  */
3268
- isDead: boolean;
3399
+ fadeIn: boolean;
3269
3400
  /**
3270
- * Gets or sets whether the note is played as staccato.
3401
+ * Gets or sets the lyrics shown on this beat.
3271
3402
  */
3272
- isStaccato: boolean;
3403
+ lyrics: string[] | null;
3273
3404
  /**
3274
- * Gets or sets the slide-in type this note is played with.
3405
+ * Gets or sets a value indicating whether the beat is played in rasgueado style.
3275
3406
  */
3276
- slideInType: SlideInType;
3407
+ hasRasgueado: boolean;
3277
3408
  /**
3278
- * Gets or sets the slide-out type this note is played with.
3409
+ * Gets or sets a value indicating whether the notes on this beat are played with a pop-style (bass).
3279
3410
  */
3280
- slideOutType: SlideOutType;
3411
+ pop: boolean;
3412
+ /**
3413
+ * Gets or sets a value indicating whether the notes on this beat are played with a slap-style (bass).
3414
+ */
3415
+ slap: boolean;
3416
+ /**
3417
+ * Gets or sets a value indicating whether the notes on this beat are played with a tap-style (bass).
3418
+ */
3419
+ tap: boolean;
3420
+ /**
3421
+ * Gets or sets the text annotation shown on this beat.
3422
+ */
3423
+ text: string | null;
3424
+ /**
3425
+ * Gets or sets the brush type applied to the notes of this beat.
3426
+ */
3427
+ brushType: BrushType;
3428
+ /**
3429
+ * Gets or sets the duration of the brush between the notes in midi ticks.
3430
+ */
3431
+ brushDuration: number;
3432
+ /**
3433
+ * Gets or sets the tuplet denominator.
3434
+ */
3435
+ tupletDenominator: number;
3436
+ /**
3437
+ * Gets or sets the tuplet numerator.
3438
+ */
3439
+ tupletNumerator: number;
3440
+ get hasTuplet(): boolean;
3281
3441
  /**
3282
- * Gets or sets the target note for several slide types.
3283
3442
  * @clone_ignore
3284
3443
  * @json_ignore
3285
3444
  */
3286
- slideTarget: Note | null;
3445
+ tupletGroup: TupletGroup | null;
3287
3446
  /**
3288
- * Gets or sets the source note for several slide types.
3447
+ * Gets or sets whether this beat continues a whammy effect.
3448
+ */
3449
+ isContinuedWhammy: boolean;
3450
+ /**
3451
+ * Gets or sets the whammy bar style of this beat.
3452
+ */
3453
+ whammyBarType: WhammyType;
3454
+ /**
3455
+ * Gets or sets the points defining the whammy bar usage.
3456
+ * @json_add addWhammyBarPoint
3457
+ * @clone_add addWhammyBarPoint
3458
+ */
3459
+ whammyBarPoints: BendPoint[] | null;
3460
+ /**
3461
+ * Gets or sets the highest point with for the highest whammy bar value.
3462
+ * @json_ignore
3289
3463
  * @clone_ignore
3464
+ */
3465
+ maxWhammyPoint: BendPoint | null;
3466
+ /**
3467
+ * Gets or sets the highest point with for the lowest whammy bar value.
3290
3468
  * @json_ignore
3469
+ * @clone_ignore
3291
3470
  */
3292
- slideOrigin: Note | null;
3471
+ minWhammyPoint: BendPoint | null;
3472
+ get hasWhammyBar(): boolean;
3293
3473
  /**
3294
- * Gets or sets whether a vibrato is played on the note.
3474
+ * Gets or sets the vibrato effect used on this beat.
3295
3475
  */
3296
3476
  vibrato: VibratoType;
3297
3477
  /**
3298
- * Gets the origin of the tied if this note is tied.
3299
- * @clone_ignore
3300
- * @json_ignore
3478
+ * Gets or sets the ID of the chord used on this beat.
3301
3479
  */
3302
- tieOrigin: Note | null;
3480
+ chordId: string | null;
3481
+ get hasChord(): boolean;
3482
+ get chord(): Chord | null;
3303
3483
  /**
3304
- * Gets the desination of the tie.
3305
- * @clone_ignore
3306
- * @json_ignore
3484
+ * Gets or sets the grace style of this beat.
3307
3485
  */
3308
- tieDestination: Note | null;
3486
+ graceType: GraceType;
3309
3487
  /**
3310
- * Gets or sets whether this note is ends a tied note.
3488
+ * Gets or sets the grace group this beat belongs to.
3489
+ * If this beat is not a grace note, it holds the group which belongs to this beat.
3490
+ * @json_ignore
3491
+ * @clone_ignore
3311
3492
  */
3312
- isTieDestination: boolean;
3313
- get isTieOrigin(): boolean;
3493
+ graceGroup: GraceGroup | null;
3314
3494
  /**
3315
- * Gets or sets the fingers used for this note on the left hand.
3495
+ * Gets or sets the index of this beat within the grace group if
3496
+ * this is a grace beat.
3497
+ * @json_ignore
3498
+ * @clone_ignore
3316
3499
  */
3317
- leftHandFinger: Fingers;
3500
+ graceIndex: number;
3318
3501
  /**
3319
- * Gets or sets the fingers used for this note on the right hand.
3502
+ * Gets or sets the pickstroke applied on this beat.
3320
3503
  */
3321
- rightHandFinger: Fingers;
3504
+ pickStroke: PickStroke;
3505
+ get isTremolo(): boolean;
3322
3506
  /**
3323
- * Gets or sets whether this note has fingering defined.
3507
+ * Gets or sets the speed of the tremolo effect.
3324
3508
  */
3325
- isFingering: boolean;
3509
+ tremoloSpeed: Duration | null;
3326
3510
  /**
3327
- * Gets or sets the target note value for the trill effect.
3511
+ * Gets or sets whether a crescendo/decrescendo is applied on this beat.
3328
3512
  */
3329
- trillValue: number;
3330
- get trillFret(): number;
3331
- get isTrill(): boolean;
3513
+ crescendo: CrescendoType;
3332
3514
  /**
3333
- * Gets or sets the speed of the trill effect.
3515
+ * The timeline position of the voice within the current bar as it is displayed. (unit: midi ticks)
3516
+ * This might differ from the actual playback time due to special grace types.
3334
3517
  */
3335
- trillSpeed: Duration;
3518
+ displayStart: number;
3336
3519
  /**
3337
- * Gets or sets the percentual duration of the note relative to the overall beat duration .
3520
+ * The timeline position of the voice within the current bar as it is played. (unit: midi ticks)
3521
+ * This might differ from the actual playback time due to special grace types.
3338
3522
  */
3339
- durationPercent: number;
3523
+ playbackStart: number;
3340
3524
  /**
3341
- * Gets or sets how accidetnals for this note should be handled.
3525
+ * Gets or sets the duration that is used for the display of this beat. It defines the size/width of the beat in
3526
+ * the music sheet. (unit: midi ticks).
3342
3527
  */
3343
- accidentalMode: NoteAccidentalMode;
3528
+ displayDuration: number;
3344
3529
  /**
3345
- * Gets or sets the reference to the parent beat to which this note belongs to.
3346
- * @clone_ignore
3347
- * @json_ignore
3530
+ * Gets or sets the duration that the note is played during the audio generation.
3348
3531
  */
3349
- beat: Beat;
3532
+ playbackDuration: number;
3533
+ get absoluteDisplayStart(): number;
3534
+ get absolutePlaybackStart(): number;
3350
3535
  /**
3351
- * Gets or sets the dynamics for this note.
3536
+ * Gets or sets the dynamics applied to this beat.
3352
3537
  */
3353
3538
  dynamics: DynamicValue;
3354
3539
  /**
3355
- * @clone_ignore
3356
- * @json_ignore
3540
+ * Gets or sets a value indicating whether the beam direction should be inverted.
3357
3541
  */
3358
- isEffectSlurOrigin: boolean;
3542
+ invertBeamDirection: boolean;
3543
+ /**
3544
+ * Gets or sets the preferred beam direction as specified in the input source.
3545
+ */
3546
+ preferredBeamDirection: BeamDirection | null;
3359
3547
  /**
3360
- * @clone_ignore
3361
3548
  * @json_ignore
3362
3549
  */
3363
- hasEffectSlur: boolean;
3550
+ isEffectSlurOrigin: boolean;
3364
3551
  get isEffectSlurDestination(): boolean;
3365
3552
  /**
3366
3553
  * @clone_ignore
3367
3554
  * @json_ignore
3368
3555
  */
3369
- effectSlurOrigin: Note | null;
3556
+ effectSlurOrigin: Beat | null;
3370
3557
  /**
3371
3558
  * @clone_ignore
3372
3559
  * @json_ignore
3373
3560
  */
3374
- effectSlurDestination: Note | null;
3375
- get stringTuning(): number;
3376
- static getStringTuning(staff: Staff, noteString: number): number;
3377
- get realValue(): number;
3378
- get realValueWithoutHarmonic(): number;
3379
- get harmonicPitch(): number;
3380
- get initialBendValue(): number;
3381
- get displayValue(): number;
3382
- get displayValueWithoutBend(): number;
3383
- get hasQuarterToneOffset(): boolean;
3384
- addBendPoint(point: BendPoint): void;
3561
+ effectSlurDestination: Beat | null;
3562
+ /**
3563
+ * Gets or sets how the beaming should be done for this beat.
3564
+ */
3565
+ beamingMode: BeatBeamingMode;
3566
+ addWhammyBarPoint(point: BendPoint): void;
3567
+ removeWhammyBarPoint(index: number): void;
3568
+ addNote(note: Note): void;
3569
+ removeNote(note: Note): void;
3570
+ getAutomation(type: AutomationType): Automation | null;
3571
+ getNoteOnString(noteString: number): Note | null;
3572
+ private calculateDuration;
3573
+ updateDurations(): void;
3574
+ finishTuplet(): void;
3385
3575
  finish(settings: Settings, sharedDataBag: Map<string, unknown>): void;
3386
- private static readonly MaxOffsetForSameLineSearch;
3387
- static nextNoteOnSameLine(note: Note): Note | null;
3388
- static findHammerPullDestination(note: Note): Note | null;
3389
- static findTieOrigin(note: Note): Note | null;
3390
- private static NoteIdLookupKey;
3391
- private _noteIdBag;
3392
- chain(sharedDataBag: Map<string, unknown>): void;
3393
3576
  /**
3394
- * @internal
3577
+ * Checks whether the current beat is timewise before the given beat.
3578
+ * @param beat
3579
+ * @returns
3395
3580
  */
3396
- toJson(o: Map<string, unknown>): void;
3581
+ isBefore(beat: Beat): boolean;
3397
3582
  /**
3398
- * @internal
3583
+ * Checks whether the current beat is timewise after the given beat.
3584
+ * @param beat
3585
+ * @returns
3399
3586
  */
3400
- setProperty(property: string, v: unknown): boolean;
3587
+ isAfter(beat: Beat): boolean;
3588
+ hasNoteOnString(noteString: number): boolean;
3589
+ getNoteWithRealValue(noteRealValue: number): Note | null;
3590
+ chain(sharedDataBag: Map<string, unknown>): void;
3401
3591
  }
3402
3592
 
3403
3593
  /**
3404
- * Lists all types of pick strokes.
3594
+ * Represents the time period, for which all bars of a {@link MasterBar} are played.
3405
3595
  */
3406
- declare enum PickStroke {
3596
+ declare class MasterBarTickLookup {
3407
3597
  /**
3408
- * No pickstroke used.
3598
+ * Gets or sets the start time in midi ticks at which the MasterBar is played.
3409
3599
  */
3410
- None = 0,
3600
+ start: number;
3411
3601
  /**
3412
- * Pickstroke up.
3602
+ * Gets or sets the end time in midi ticks at which the MasterBar is played.
3413
3603
  */
3414
- Up = 1,
3604
+ end: number;
3415
3605
  /**
3416
- * Pickstroke down
3606
+ * Gets or sets the current tempo when the MasterBar is played.
3417
3607
  */
3418
- Down = 2
3419
- }
3420
-
3421
- /**
3422
- * Represents a list of beats that are grouped within the same tuplet.
3423
- */
3424
- declare class TupletGroup {
3425
- private static readonly HalfTicks;
3426
- private static readonly QuarterTicks;
3427
- private static readonly EighthTicks;
3428
- private static readonly SixteenthTicks;
3429
- private static readonly ThirtySecondTicks;
3430
- private static readonly SixtyFourthTicks;
3431
- private static readonly OneHundredTwentyEighthTicks;
3432
- private static readonly TwoHundredFiftySixthTicks;
3433
- private static AllTicks;
3434
- private _isEqualLengthTuplet;
3435
- totalDuration: number;
3608
+ tempo: number;
3436
3609
  /**
3437
- * Gets or sets the list of beats contained in this group.
3610
+ * Gets or sets the MasterBar which is played.
3438
3611
  */
3439
- beats: Beat[];
3612
+ masterBar: MasterBar;
3440
3613
  /**
3441
- * Gets or sets the voice this group belongs to.
3614
+ * Gets or sets the list of {@link BeatTickLookup} object which define the durations
3615
+ * for all {@link Beats} played within the period of this MasterBar.
3442
3616
  */
3443
- voice: Voice;
3617
+ beats: BeatTickLookup[];
3444
3618
  /**
3445
- * Gets a value indicating whether the tuplet group is fully filled.
3619
+ * Gets or sets the {@link MasterBarTickLookup} of the next masterbar in the {@link Score}
3446
3620
  */
3447
- isFull: boolean;
3621
+ nextMasterBar: MasterBarTickLookup | null;
3448
3622
  /**
3449
- * Initializes a new instance of the {@link TupletGroup} class.
3450
- * @param voice The voice this group belongs to.
3623
+ * Performs the neccessary finalization steps after all information was written.
3451
3624
  */
3452
- constructor(voice: Voice);
3453
- check(beat: Beat): boolean;
3625
+ finish(): void;
3626
+ /**
3627
+ * Adds a new {@link BeatTickLookup} to the list of played beats during this MasterBar period.
3628
+ * @param beat
3629
+ */
3630
+ addBeat(beat: BeatTickLookup): void;
3454
3631
  }
3455
3632
 
3456
3633
  /**
3457
- * Lists all types of whammy bars
3634
+ * Represents the time period, for which a {@link Beat} is played.
3458
3635
  */
3459
- declare enum WhammyType {
3636
+ declare class BeatTickLookup {
3637
+ private _highlightedBeats;
3460
3638
  /**
3461
- * No whammy at all
3639
+ * Gets or sets the index of the lookup within the parent MasterBarTickLookup.
3462
3640
  */
3463
- None = 0,
3641
+ index: number;
3464
3642
  /**
3465
- * Individual points define the whammy in a flexible manner.
3466
- * This system was mainly used in Guitar Pro 3-5
3643
+ * Gets or sets the parent MasterBarTickLookup to which this beat lookup belongs to.
3467
3644
  */
3468
- Custom = 1,
3645
+ masterBar: MasterBarTickLookup;
3469
3646
  /**
3470
- * Simple dive to a lower or higher note.
3647
+ * Gets or sets the start time in midi ticks at which the given beat is played.
3471
3648
  */
3472
- Dive = 2,
3649
+ start: number;
3473
3650
  /**
3474
- * A dive to a lower or higher note and releasing it back to normal.
3651
+ * Gets or sets the end time in midi ticks at which the given beat is played.
3475
3652
  */
3476
- Dip = 3,
3653
+ end: number;
3477
3654
  /**
3478
- * Continue to hold the whammy at the position from a previous whammy.
3655
+ * Gets or sets the beat which is played.
3479
3656
  */
3480
- Hold = 4,
3657
+ beat: Beat;
3481
3658
  /**
3482
- * Dive to a lower or higher note before playing it.
3659
+ * Gets or sets whether the beat is the placeholder beat for an empty bar.
3483
3660
  */
3484
- Predive = 5,
3661
+ isEmptyBar: boolean;
3485
3662
  /**
3486
- * Dive to a lower or higher note before playing it, then change to another
3487
- * note.
3663
+ * Gets or sets a list of all beats that should be highlighted when
3664
+ * the beat of this lookup starts playing.
3488
3665
  */
3489
- PrediveDive = 6
3490
- }
3491
-
3492
- declare enum BeamDirection {
3493
- Up = 0,
3494
- Down = 1
3666
+ beatsToHighlight: Beat[];
3667
+ highlightBeat(beat: Beat): void;
3495
3668
  }
3496
3669
 
3497
3670
  /**
3498
- * Represents a group of grace beats that belong together
3671
+ * Represents the results of searching the currently played beat.
3672
+ * @see MidiTickLookup.FindBeat
3499
3673
  */
3500
- declare class GraceGroup {
3501
- /**
3502
- * All beats within this group.
3503
- */
3504
- beats: Beat[];
3674
+ declare class MidiTickLookupFindBeatResult {
3505
3675
  /**
3506
- * Gets a unique ID for this grace group.
3676
+ * Gets or sets the beat that is currently played.
3507
3677
  */
3508
- id: string;
3678
+ get currentBeat(): Beat;
3509
3679
  /**
3510
- * true if the grace beat are followed by a normal beat within the same
3511
- * bar.
3680
+ * Gets or sets the beat that will be played next.
3512
3681
  */
3513
- isComplete: boolean;
3682
+ get nextBeat(): Beat | null;
3514
3683
  /**
3515
- * Adds a new beat to this group
3516
- * @param beat The beat to add
3684
+ * Gets or sets the duration in milliseconds how long this beat is playing.
3517
3685
  */
3518
- addBeat(beat: Beat): void;
3519
- finish(): void;
3520
- }
3521
-
3522
- /**
3523
- * Lists the different modes on how beaming for a beat should be done.
3524
- */
3525
- declare enum BeatBeamingMode {
3686
+ duration: number;
3526
3687
  /**
3527
- * Automatic beaming based on the timing rules.
3688
+ * Gets or sets the beats ot highlight along the current beat.
3528
3689
  */
3529
- Auto = 0,
3690
+ beatsToHighlight: Beat[];
3530
3691
  /**
3531
- * Force a split to the next beat.
3692
+ * Gets or sets the underlying beat lookup which
3693
+ * was used for building this MidiTickLookupFindBeatResult.
3532
3694
  */
3533
- ForceSplitToNext = 1,
3695
+ currentBeatLookup: BeatTickLookup;
3534
3696
  /**
3535
- * Force a merge with the next beat.
3697
+ * Gets or sets the beat lookup for the next beat.
3536
3698
  */
3537
- ForceMergeWithNext = 2
3699
+ nextBeatLookup: BeatTickLookup | null;
3538
3700
  }
3539
3701
  /**
3540
- * A beat is a single block within a bar. A beat is a combination
3541
- * of several notes played at the same time.
3542
- * @json
3543
- * @json_strict
3544
- * @cloneable
3702
+ * This class holds all information about when {@link MasterBar}s and {@link Beat}s are played.
3545
3703
  */
3546
- declare class Beat {
3547
- private static _globalBeatId;
3548
- /**
3549
- * Gets or sets the unique id of this beat.
3550
- * @clone_ignore
3551
- */
3552
- id: number;
3553
- /**
3554
- * Gets or sets the zero-based index of this beat within the voice.
3555
- * @json_ignore
3556
- */
3557
- index: number;
3704
+ declare class MidiTickLookup {
3705
+ private _currentMasterBar;
3558
3706
  /**
3559
- * Gets or sets the previous beat within the whole song.
3560
- * @json_ignore
3561
- * @clone_ignore
3707
+ * Gets a dictionary of all master bars played. The index is the index equals to {@link MasterBar.index}.
3708
+ * This lookup only contains the first time a MasterBar is played. For a whole sequence of the song refer to {@link MasterBars}.
3709
+ * @internal
3562
3710
  */
3563
- previousBeat: Beat | null;
3711
+ readonly masterBarLookup: Map<number, MasterBarTickLookup>;
3564
3712
  /**
3565
- * Gets or sets the next beat within the whole song.
3566
- * @json_ignore
3567
- * @clone_ignore
3713
+ * Gets a list of all {@link MasterBarTickLookup} sorted by time.
3714
+ * @internal
3568
3715
  */
3569
- nextBeat: Beat | null;
3570
- get isLastOfVoice(): boolean;
3716
+ readonly masterBars: MasterBarTickLookup[];
3571
3717
  /**
3572
- * Gets or sets the reference to the parent voice this beat belongs to.
3573
- * @json_ignore
3574
- * @clone_ignore
3718
+ * Performs the neccessary finalization steps after all information was written.
3719
+ * @internal
3575
3720
  */
3576
- voice: Voice;
3721
+ finish(): void;
3577
3722
  /**
3578
- * Gets or sets the list of notes contained in this beat.
3579
- * @json_add addNote
3580
- * @clone_add addNote
3723
+ * Finds the currently played beat given a list of tracks and the current time.
3724
+ * @param tracks The tracks in which to search the played beat for.
3725
+ * @param tick The current time in midi ticks.
3726
+ * @returns The information about the current beat or null if no beat could be found.
3581
3727
  */
3582
- notes: Note[];
3728
+ findBeat(tracks: Track[], tick: number, currentBeatHint?: MidiTickLookupFindBeatResult | null): MidiTickLookupFindBeatResult | null;
3729
+ private findBeatFast;
3730
+ private findBeatSlow;
3731
+ private createResult;
3732
+ private findNextBeat;
3733
+ private findMasterBar;
3583
3734
  /**
3584
- * Gets the lookup where the notes per string are registered.
3585
- * If this staff contains string based notes this lookup allows fast access.
3586
- * @json_ignore
3735
+ * Gets the {@link MasterBarTickLookup} for a given masterbar at which the masterbar is played the first time.
3736
+ * @param bar The masterbar to find the time period for.
3737
+ * @returns A {@link MasterBarTickLookup} containing the details about the first time the {@link MasterBar} is played.
3587
3738
  */
3588
- readonly noteStringLookup: Map<number, Note>;
3739
+ getMasterBar(bar: MasterBar): MasterBarTickLookup;
3589
3740
  /**
3590
- * Gets the lookup where the notes per value are registered.
3591
- * If this staff contains string based notes this lookup allows fast access.
3592
- * @json_ignore
3741
+ * Gets the start time in midi ticks for a given masterbar at which the masterbar is played the first time.
3742
+ * @param bar The masterbar to find the time period for.
3743
+ * @returns The time in midi ticks at which the masterbar is played the first time or 0 if the masterbar is not contained
3593
3744
  */
3594
- readonly noteValueLookup: Map<number, Note>;
3745
+ getMasterBarStart(bar: MasterBar): number;
3595
3746
  /**
3596
- * Gets or sets a value indicating whether this beat is considered empty.
3747
+ * Adds a new {@link MasterBarTickLookup} to the lookup table.
3748
+ * @param masterBar The item to add.
3597
3749
  */
3598
- isEmpty: boolean;
3750
+ addMasterBar(masterBar: MasterBarTickLookup): void;
3599
3751
  /**
3600
- * Gets or sets which whammy bar style should be used for this bar.
3752
+ * Adds the given {@link BeatTickLookup} to the current {@link MidiTickLookup}.
3753
+ * @param beat The lookup to add.
3601
3754
  */
3602
- whammyStyle: BendStyle;
3755
+ addBeat(beat: BeatTickLookup): void;
3756
+ }
3757
+
3758
+ /**
3759
+ * Represents a range of the song that should be played.
3760
+ */
3761
+ declare class PlaybackRange {
3603
3762
  /**
3604
- * Gets or sets the ottava applied to this beat.
3763
+ * The position in midi ticks from where the song should start.
3605
3764
  */
3606
- ottava: Ottavia;
3765
+ startTick: number;
3607
3766
  /**
3608
- * Gets or sets the fermata applied to this beat.
3609
- * @clone_ignore
3610
- * @json_ignore
3767
+ * The position in midi ticks to where the song should be played.
3611
3768
  */
3612
- fermata: Fermata | null;
3769
+ endTick: number;
3770
+ }
3771
+
3772
+ /**
3773
+ * Lists the different states of the player
3774
+ */
3775
+ declare enum PlayerState {
3613
3776
  /**
3614
- * Gets a value indicating whether this beat starts a legato slur.
3777
+ * Player is paused
3615
3778
  */
3616
- isLegatoOrigin: boolean;
3617
- get isLegatoDestination(): boolean;
3779
+ Paused = 0,
3618
3780
  /**
3619
- * Gets or sets the note with the lowest pitch in this beat. Only visible notes are considered.
3620
- * @json_ignore
3621
- * @clone_ignore
3781
+ * Player is playing
3622
3782
  */
3623
- minNote: Note | null;
3783
+ Playing = 1
3784
+ }
3785
+
3786
+ /**
3787
+ * Represents the info when the player state changes.
3788
+ */
3789
+ declare class PlayerStateChangedEventArgs {
3624
3790
  /**
3625
- * Gets or sets the note with the highest pitch in this beat. Only visible notes are considered.
3626
- * @json_ignore
3627
- * @clone_ignore
3791
+ * The new state of the player.
3628
3792
  */
3629
- maxNote: Note | null;
3793
+ readonly state: PlayerState;
3630
3794
  /**
3631
- * Gets or sets the note with the highest string number in this beat. Only visible notes are considered.
3632
- * @json_ignore
3633
- * @clone_ignore
3795
+ * Gets a value indicating whether the playback was stopped or only paused.
3796
+ * @returns true if the playback was stopped, false if the playback was started or paused
3634
3797
  */
3635
- maxStringNote: Note | null;
3798
+ readonly stopped: boolean;
3636
3799
  /**
3637
- * Gets or sets the note with the lowest string number in this beat. Only visible notes are considered.
3638
- * @json_ignore
3639
- * @clone_ignore
3800
+ * Initializes a new instance of the {@link PlayerStateChangedEventArgs} class.
3801
+ * @param state The state.
3640
3802
  */
3641
- minStringNote: Note | null;
3803
+ constructor(state: PlayerState, stopped: boolean);
3804
+ }
3805
+
3806
+ /**
3807
+ * Represents the info when the time in the synthesizer changes.
3808
+ */
3809
+ declare class PositionChangedEventArgs {
3642
3810
  /**
3643
- * Gets or sets the duration of this beat.
3811
+ * Gets a value indicating whether the position changed because of time seeking.
3644
3812
  */
3645
- duration: Duration;
3646
- get isRest(): boolean;
3813
+ isSeek: boolean;
3647
3814
  /**
3648
- * Gets a value indicating whether this beat is a full bar rest.
3815
+ * Gets the current time in milliseconds.
3649
3816
  */
3650
- get isFullBarRest(): boolean;
3817
+ readonly currentTime: number;
3651
3818
  /**
3652
- * Gets or sets whether any note in this beat has a let-ring applied.
3653
- * @json_ignore
3819
+ * Gets the length of the played song in milliseconds.
3654
3820
  */
3655
- isLetRing: boolean;
3821
+ readonly endTime: number;
3656
3822
  /**
3657
- * Gets or sets whether any note in this beat has a palm-mute paplied.
3658
- * @json_ignore
3823
+ * Gets the current time in midi ticks.
3659
3824
  */
3660
- isPalmMute: boolean;
3825
+ readonly currentTick: number;
3661
3826
  /**
3662
- * Gets or sets a list of all automations on this beat.
3827
+ * Gets the length of the played song in midi ticks.
3663
3828
  */
3664
- automations: Automation[];
3829
+ readonly endTick: number;
3665
3830
  /**
3666
- * Gets or sets the number of dots applied to the duration of this beat.
3831
+ * Initializes a new instance of the {@link PositionChangedEventArgs} class.
3832
+ * @param currentTime The current time.
3833
+ * @param endTime The end time.
3834
+ * @param currentTick The current tick.
3835
+ * @param endTick The end tick.
3836
+ * @param isSeek Whether the time was seeked.
3667
3837
  */
3668
- dots: number;
3838
+ constructor(currentTime: number, endTime: number, currentTick: number, endTick: number, isSeek: boolean);
3839
+ }
3840
+
3841
+ interface IEventEmitter {
3842
+ on(value: () => void): void;
3843
+ off(value: () => void): void;
3844
+ }
3845
+ /**
3846
+ * @partial
3847
+ */
3848
+ interface IEventEmitterOfT<T> {
3849
+ on(value: (arg: T) => void): void;
3850
+ off(value: (arg: T) => void): void;
3851
+ }
3852
+
3853
+ /**
3854
+ * Represents the info when the synthesizer played certain midi events.
3855
+ */
3856
+ declare class MidiEventsPlayedEventArgs {
3669
3857
  /**
3670
- * Gets or sets a value indicating whether this beat is fade-in.
3858
+ * Gets the events which were played.
3671
3859
  */
3672
- fadeIn: boolean;
3860
+ readonly events: MidiEvent[];
3673
3861
  /**
3674
- * Gets or sets the lyrics shown on this beat.
3862
+ * Initializes a new instance of the {@link MidiEventsPlayedEventArgs} class.
3863
+ * @param events The events which were played.
3675
3864
  */
3676
- lyrics: string[] | null;
3865
+ constructor(events: MidiEvent[]);
3866
+ }
3867
+
3868
+ /**
3869
+ * The public API interface for interacting with the synthesizer.
3870
+ */
3871
+ interface IAlphaSynth {
3677
3872
  /**
3678
- * Gets or sets a value indicating whether the beat is played in rasgueado style.
3873
+ * Gets or sets whether the synthesizer is ready for interaction. (output and worker are initialized)
3679
3874
  */
3680
- hasRasgueado: boolean;
3875
+ readonly isReady: boolean;
3681
3876
  /**
3682
- * Gets or sets a value indicating whether the notes on this beat are played with a pop-style (bass).
3877
+ * Gets or sets whether the synthesizer is ready for playback. (output, worker are initialized, soundfont and midi are loaded)
3683
3878
  */
3684
- pop: boolean;
3879
+ readonly isReadyForPlayback: boolean;
3685
3880
  /**
3686
- * Gets or sets a value indicating whether the notes on this beat are played with a slap-style (bass).
3881
+ * Gets the current player state.
3687
3882
  */
3688
- slap: boolean;
3883
+ readonly state: PlayerState;
3689
3884
  /**
3690
- * Gets or sets a value indicating whether the notes on this beat are played with a tap-style (bass).
3885
+ * Gets or sets the loging level.
3691
3886
  */
3692
- tap: boolean;
3887
+ logLevel: LogLevel;
3693
3888
  /**
3694
- * Gets or sets the text annotation shown on this beat.
3889
+ * Gets or sets the current master volume as percentage. (range: 0.0-3.0, default 1.0)
3695
3890
  */
3696
- text: string | null;
3891
+ masterVolume: number;
3697
3892
  /**
3698
- * Gets or sets the brush type applied to the notes of this beat.
3893
+ * Gets or sets the metronome volume. (range: 0.0-3.0, default 0.0)
3699
3894
  */
3700
- brushType: BrushType;
3895
+ metronomeVolume: number;
3701
3896
  /**
3702
- * Gets or sets the duration of the brush between the notes in midi ticks.
3897
+ * Gets or sets the current playback speed as percentage. (range: 0.125-8.0, default: 1.0)
3703
3898
  */
3704
- brushDuration: number;
3899
+ playbackSpeed: number;
3705
3900
  /**
3706
- * Gets or sets the tuplet denominator.
3901
+ * Gets or sets the position within the song in midi ticks.
3707
3902
  */
3708
- tupletDenominator: number;
3903
+ tickPosition: number;
3709
3904
  /**
3710
- * Gets or sets the tuplet numerator.
3905
+ * Gets or sets the position within the song in milliseconds.
3711
3906
  */
3712
- tupletNumerator: number;
3713
- get hasTuplet(): boolean;
3907
+ timePosition: number;
3714
3908
  /**
3715
- * @clone_ignore
3716
- * @json_ignore
3909
+ * Gets or sets the range of the song that should be played. Set this to null
3910
+ * to play the whole song.
3717
3911
  */
3718
- tupletGroup: TupletGroup | null;
3912
+ playbackRange: PlaybackRange | null;
3719
3913
  /**
3720
- * Gets or sets whether this beat continues a whammy effect.
3914
+ * Gets or sets whether the playback should automatically restart after it finished.
3721
3915
  */
3722
- isContinuedWhammy: boolean;
3916
+ isLooping: boolean;
3723
3917
  /**
3724
- * Gets or sets the whammy bar style of this beat.
3918
+ * Gets or sets volume of the metronome during count-in. (range: 0.0-3.0, default 0.0 - no count in)
3725
3919
  */
3726
- whammyBarType: WhammyType;
3920
+ countInVolume: number;
3727
3921
  /**
3728
- * Gets or sets the points defining the whammy bar usage.
3729
- * @json_add addWhammyBarPoint
3730
- * @clone_add addWhammyBarPoint
3922
+ * Gets or sets the midi events which will trigger the `midiEventsPlayed` event.
3923
+ * To subscribe to Metronome events use the `SystemExclusiveEvent2` event type and check against `event.isMetronome`
3731
3924
  */
3732
- whammyBarPoints: BendPoint[] | null;
3925
+ midiEventsPlayedFilter: MidiEventType[];
3733
3926
  /**
3734
- * Gets or sets the highest point with for the highest whammy bar value.
3735
- * @json_ignore
3736
- * @clone_ignore
3927
+ * Destroys the synthesizer and all related components
3737
3928
  */
3738
- maxWhammyPoint: BendPoint | null;
3929
+ destroy(): void;
3739
3930
  /**
3740
- * Gets or sets the highest point with for the lowest whammy bar value.
3741
- * @json_ignore
3742
- * @clone_ignore
3931
+ * Starts the playback if possible
3932
+ * @returns true if the playback was started, otherwise false. Reasons for not starting can be that the player is not ready or already playing.
3743
3933
  */
3744
- minWhammyPoint: BendPoint | null;
3745
- get hasWhammyBar(): boolean;
3934
+ play(): boolean;
3746
3935
  /**
3747
- * Gets or sets the vibrato effect used on this beat.
3936
+ * Pauses the playback if was running
3748
3937
  */
3749
- vibrato: VibratoType;
3938
+ pause(): void;
3750
3939
  /**
3751
- * Gets or sets the ID of the chord used on this beat.
3940
+ * Starts the playback if possible, pauses the playback if was running
3752
3941
  */
3753
- chordId: string | null;
3754
- get hasChord(): boolean;
3755
- get chord(): Chord | null;
3942
+ playPause(): void;
3756
3943
  /**
3757
- * Gets or sets the grace style of this beat.
3944
+ * Stopps the playback
3758
3945
  */
3759
- graceType: GraceType;
3946
+ stop(): void;
3760
3947
  /**
3761
- * Gets or sets the grace group this beat belongs to.
3762
- * If this beat is not a grace note, it holds the group which belongs to this beat.
3763
- * @json_ignore
3764
- * @clone_ignore
3948
+ * Stops any ongoing playback and plays the given midi file instead.
3949
+ * @param midi The midi file to play
3765
3950
  */
3766
- graceGroup: GraceGroup | null;
3951
+ playOneTimeMidiFile(midi: MidiFile): void;
3767
3952
  /**
3768
- * Gets or sets the index of this beat within the grace group if
3769
- * this is a grace beat.
3770
- * @json_ignore
3771
- * @clone_ignore
3953
+ * Loads a soundfont from the given data
3954
+ * @param data a byte array to load the data from
3955
+ * @param append Whether to fully replace or append the data from the given soundfont.
3772
3956
  */
3773
- graceIndex: number;
3957
+ loadSoundFont(data: Uint8Array, append: boolean): void;
3774
3958
  /**
3775
- * Gets or sets the pickstroke applied on this beat.
3959
+ * Resets all loaded soundfonts as if they were not loaded.
3776
3960
  */
3777
- pickStroke: PickStroke;
3778
- get isTremolo(): boolean;
3961
+ resetSoundFonts(): void;
3779
3962
  /**
3780
- * Gets or sets the speed of the tremolo effect.
3963
+ * Loads the given midi file structure.
3964
+ * @param midi
3781
3965
  */
3782
- tremoloSpeed: Duration | null;
3966
+ loadMidiFile(midi: MidiFile): void;
3783
3967
  /**
3784
- * Gets or sets whether a crescendo/decrescendo is applied on this beat.
3968
+ * Sets the mute state of a channel.
3969
+ * @param channel The channel number
3970
+ * @param mute true if the channel should be muted, otherwise false.
3785
3971
  */
3786
- crescendo: CrescendoType;
3972
+ setChannelMute(channel: number, mute: boolean): void;
3787
3973
  /**
3788
- * The timeline position of the voice within the current bar as it is displayed. (unit: midi ticks)
3789
- * This might differ from the actual playback time due to special grace types.
3974
+ * Resets the mute/solo state of all channels
3790
3975
  */
3791
- displayStart: number;
3976
+ resetChannelStates(): void;
3792
3977
  /**
3793
- * The timeline position of the voice within the current bar as it is played. (unit: midi ticks)
3794
- * This might differ from the actual playback time due to special grace types.
3978
+ * Gets the solo state of a channel.
3979
+ * @param channel The channel number
3980
+ * @param solo true if the channel should be played solo, otherwise false.
3795
3981
  */
3796
- playbackStart: number;
3982
+ setChannelSolo(channel: number, solo: boolean): void;
3797
3983
  /**
3798
- * Gets or sets the duration that is used for the display of this beat. It defines the size/width of the beat in
3799
- * the music sheet. (unit: midi ticks).
3984
+ * Gets or sets the current and initial volume of the given channel.
3985
+ * @param channel The channel number.
3986
+ * @param volume The volume of of the channel (0.0-1.0)
3800
3987
  */
3801
- displayDuration: number;
3988
+ setChannelVolume(channel: number, volume: number): void;
3802
3989
  /**
3803
- * Gets or sets the duration that the note is played during the audio generation.
3990
+ * This event is fired when the player is ready to be interacted with.
3804
3991
  */
3805
- playbackDuration: number;
3806
- get absoluteDisplayStart(): number;
3807
- get absolutePlaybackStart(): number;
3992
+ readonly ready: IEventEmitter;
3808
3993
  /**
3809
- * Gets or sets the dynamics applied to this beat.
3994
+ * This event is fired when all required data for playback is loaded and ready.
3810
3995
  */
3811
- dynamics: DynamicValue;
3996
+ readonly readyForPlayback: IEventEmitter;
3812
3997
  /**
3813
- * Gets or sets a value indicating whether the beam direction should be inverted.
3998
+ * This event is fired when the playback of the whole song finished.
3814
3999
  */
3815
- invertBeamDirection: boolean;
4000
+ readonly finished: IEventEmitter;
3816
4001
  /**
3817
- * Gets or sets the preferred beam direction as specified in the input source.
4002
+ * This event is fired when the SoundFont needed for playback was loaded.
3818
4003
  */
3819
- preferredBeamDirection: BeamDirection | null;
4004
+ readonly soundFontLoaded: IEventEmitter;
3820
4005
  /**
3821
- * @json_ignore
4006
+ * This event is fired when the loading of the SoundFont failed.
3822
4007
  */
3823
- isEffectSlurOrigin: boolean;
3824
- get isEffectSlurDestination(): boolean;
4008
+ readonly soundFontLoadFailed: IEventEmitterOfT<Error>;
3825
4009
  /**
3826
- * @clone_ignore
3827
- * @json_ignore
4010
+ * This event is fired when the Midi file needed for playback was loaded.
3828
4011
  */
3829
- effectSlurOrigin: Beat | null;
4012
+ readonly midiLoaded: IEventEmitterOfT<PositionChangedEventArgs>;
3830
4013
  /**
3831
- * @clone_ignore
3832
- * @json_ignore
4014
+ * This event is fired when the loading of the Midi file failed.
3833
4015
  */
3834
- effectSlurDestination: Beat | null;
4016
+ readonly midiLoadFailed: IEventEmitterOfT<Error>;
3835
4017
  /**
3836
- * Gets or sets how the beaming should be done for this beat.
4018
+ * This event is fired when the playback state changed.
3837
4019
  */
3838
- beamingMode: BeatBeamingMode;
3839
- addWhammyBarPoint(point: BendPoint): void;
3840
- removeWhammyBarPoint(index: number): void;
3841
- addNote(note: Note): void;
3842
- removeNote(note: Note): void;
3843
- getAutomation(type: AutomationType): Automation | null;
3844
- getNoteOnString(noteString: number): Note | null;
3845
- private calculateDuration;
3846
- updateDurations(): void;
3847
- finishTuplet(): void;
3848
- finish(settings: Settings, sharedDataBag: Map<string, unknown>): void;
4020
+ readonly stateChanged: IEventEmitterOfT<PlayerStateChangedEventArgs>;
3849
4021
  /**
3850
- * Checks whether the current beat is timewise before the given beat.
3851
- * @param beat
3852
- * @returns
4022
+ * This event is fired when the current playback position of/ the song changed.
3853
4023
  */
3854
- isBefore(beat: Beat): boolean;
4024
+ readonly positionChanged: IEventEmitterOfT<PositionChangedEventArgs>;
3855
4025
  /**
3856
- * Checks whether the current beat is timewise after the given beat.
3857
- * @param beat
3858
- * @returns
4026
+ * The event is fired when certain midi events were sent to the audio output device for playback.
3859
4027
  */
3860
- isAfter(beat: Beat): boolean;
3861
- hasNoteOnString(noteString: number): boolean;
3862
- getNoteWithRealValue(noteRealValue: number): Note | null;
3863
- chain(sharedDataBag: Map<string, unknown>): void;
4028
+ readonly midiEventsPlayed: IEventEmitterOfT<MidiEventsPlayedEventArgs>;
3864
4029
  }
3865
4030
 
3866
4031
  /**
@@ -4650,6 +4815,10 @@ declare class AlphaTabApiBase<TSettings> {
4650
4815
  */
4651
4816
  render(): void;
4652
4817
  private _tickCache;
4818
+ /**
4819
+ * Gets the tick cache related to the current score.
4820
+ */
4821
+ get tickCache(): MidiTickLookup | null;
4653
4822
  /**
4654
4823
  * Gets the alphaSynth player used for playback. This is the low-level API to the Midi synthesizer used for playback.
4655
4824
  */
@@ -4970,168 +5139,6 @@ declare namespace index_d$4 {
4970
5139
  };
4971
5140
  }
4972
5141
 
4973
- /**
4974
- * Represents the time period, for which all bars of a {@link MasterBar} are played.
4975
- */
4976
- declare class MasterBarTickLookup {
4977
- /**
4978
- * Gets or sets the start time in midi ticks at which the MasterBar is played.
4979
- */
4980
- start: number;
4981
- /**
4982
- * Gets or sets the end time in midi ticks at which the MasterBar is played.
4983
- */
4984
- end: number;
4985
- /**
4986
- * Gets or sets the current tempo when the MasterBar is played.
4987
- */
4988
- tempo: number;
4989
- /**
4990
- * Gets or sets the MasterBar which is played.
4991
- */
4992
- masterBar: MasterBar;
4993
- /**
4994
- * Gets or sets the list of {@link BeatTickLookup} object which define the durations
4995
- * for all {@link Beats} played within the period of this MasterBar.
4996
- */
4997
- beats: BeatTickLookup[];
4998
- /**
4999
- * Gets or sets the {@link MasterBarTickLookup} of the next masterbar in the {@link Score}
5000
- */
5001
- nextMasterBar: MasterBarTickLookup | null;
5002
- /**
5003
- * Performs the neccessary finalization steps after all information was written.
5004
- */
5005
- finish(): void;
5006
- /**
5007
- * Adds a new {@link BeatTickLookup} to the list of played beats during this MasterBar period.
5008
- * @param beat
5009
- */
5010
- addBeat(beat: BeatTickLookup): void;
5011
- }
5012
-
5013
- /**
5014
- * Represents the time period, for which a {@link Beat} is played.
5015
- */
5016
- declare class BeatTickLookup {
5017
- private _highlightedBeats;
5018
- /**
5019
- * Gets or sets the index of the lookup within the parent MasterBarTickLookup.
5020
- */
5021
- index: number;
5022
- /**
5023
- * Gets or sets the parent MasterBarTickLookup to which this beat lookup belongs to.
5024
- */
5025
- masterBar: MasterBarTickLookup;
5026
- /**
5027
- * Gets or sets the start time in midi ticks at which the given beat is played.
5028
- */
5029
- start: number;
5030
- /**
5031
- * Gets or sets the end time in midi ticks at which the given beat is played.
5032
- */
5033
- end: number;
5034
- /**
5035
- * Gets or sets the beat which is played.
5036
- */
5037
- beat: Beat;
5038
- /**
5039
- * Gets or sets whether the beat is the placeholder beat for an empty bar.
5040
- */
5041
- isEmptyBar: boolean;
5042
- /**
5043
- * Gets or sets a list of all beats that should be highlighted when
5044
- * the beat of this lookup starts playing.
5045
- */
5046
- beatsToHighlight: Beat[];
5047
- highlightBeat(beat: Beat): void;
5048
- }
5049
-
5050
- /**
5051
- * Represents the results of searching the currently played beat.
5052
- * @see MidiTickLookup.FindBeat
5053
- */
5054
- declare class MidiTickLookupFindBeatResult {
5055
- /**
5056
- * Gets or sets the beat that is currently played.
5057
- */
5058
- get currentBeat(): Beat;
5059
- /**
5060
- * Gets or sets the beat that will be played next.
5061
- */
5062
- get nextBeat(): Beat | null;
5063
- /**
5064
- * Gets or sets the duration in milliseconds how long this beat is playing.
5065
- */
5066
- duration: number;
5067
- /**
5068
- * Gets or sets the beats ot highlight along the current beat.
5069
- */
5070
- beatsToHighlight: Beat[];
5071
- /**
5072
- * Gets or sets the underlying beat lookup which
5073
- * was used for building this MidiTickLookupFindBeatResult.
5074
- */
5075
- currentBeatLookup: BeatTickLookup;
5076
- /**
5077
- * Gets or sets the beat lookup for the next beat.
5078
- */
5079
- nextBeatLookup: BeatTickLookup | null;
5080
- }
5081
- /**
5082
- * This class holds all information about when {@link MasterBar}s and {@link Beat}s are played.
5083
- */
5084
- declare class MidiTickLookup {
5085
- private _currentMasterBar;
5086
- /**
5087
- * Gets a dictionary of all master bars played. The index is the index equals to {@link MasterBar.index}.
5088
- * This lookup only contains the first time a MasterBar is played. For a whole sequence of the song refer to {@link MasterBars}.
5089
- */
5090
- readonly masterBarLookup: Map<number, MasterBarTickLookup>;
5091
- /**
5092
- * Gets a list of all {@link MasterBarTickLookup} sorted by time.
5093
- */
5094
- readonly masterBars: MasterBarTickLookup[];
5095
- /**
5096
- * Performs the neccessary finalization steps after all information was written.
5097
- */
5098
- finish(): void;
5099
- /**
5100
- * Finds the currently played beat given a list of tracks and the current time.
5101
- * @param tracks The tracks in which to search the played beat for.
5102
- * @param tick The current time in midi ticks.
5103
- * @returns The information about the current beat or null if no beat could be found.
5104
- */
5105
- findBeat(tracks: Track[], tick: number, currentBeatHint?: MidiTickLookupFindBeatResult | null): MidiTickLookupFindBeatResult | null;
5106
- private findBeatFast;
5107
- private findBeatSlow;
5108
- private createResult;
5109
- private findNextBeat;
5110
- private findMasterBar;
5111
- /**
5112
- * Gets the {@link MasterBarTickLookup} for a given masterbar at which the masterbar is played the first time.
5113
- * @param bar The masterbar to find the time period for.
5114
- * @returns A {@link MasterBarTickLookup} containing the details about the first time the {@link MasterBar} is played.
5115
- */
5116
- getMasterBar(bar: MasterBar): MasterBarTickLookup;
5117
- /**
5118
- * Gets the start time in midi ticks for a given masterbar at which the masterbar is played the first time.
5119
- * @param bar The masterbar to find the time period for.
5120
- * @returns The time in midi ticks at which the masterbar is played the first time or 0 if the masterbar is not contained
5121
- */
5122
- getMasterBarStart(bar: MasterBar): number;
5123
- /**
5124
- * Adds a new {@link MasterBarTickLookup} to the lookup table.
5125
- * @param masterBar The item to add.
5126
- */
5127
- addMasterBar(masterBar: MasterBarTickLookup): void;
5128
- /**
5129
- * Adds the given {@link BeatTickLookup} to the current {@link MidiTickLookup}.
5130
- * @param beat The lookup to add.
5131
- */
5132
- addBeat(beat: BeatTickLookup): void;
5133
- }
5134
-
5135
5142
  /**
5136
5143
  * Lists all midi controllers.
5137
5144
  */