pxt-common-packages 10.4.4 → 10.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/common-sim.d.ts +14 -0
- package/built/common-sim.js +98 -0
- package/libs/azureiot/built/debug/binary.js +461 -461
- package/libs/color/built/debug/binary.js +8 -8
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/get-tile.md +3 -3
- package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/get-tiles-by-type.md +65 -0
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/on-hit-tile.md +4 -4
- package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/place-on-random-tile.md +61 -0
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/place.md +2 -6
- package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/set-tile-at.md +61 -0
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/set-tile-map.md +3 -3
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/set-tile.md +1 -1
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/tile-map.md +2 -2
- package/libs/{game/docs/types → color-coded-tilemap/docs/reference/color-coded-tilemap}/tile.md +9 -5
- package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap.md +32 -0
- package/libs/color-coded-tilemap/tilemap.ts +7 -7
- package/libs/color-sensor/built/debug/binary.js +8 -8
- package/libs/controller/built/debug/binary.js +7117 -7117
- package/libs/controller---none/built/debug/binary.js +7097 -7097
- package/libs/datalogger/built/debug/binary.js +63 -63
- package/libs/edge-connector/built/debug/binary.js +8 -8
- package/libs/edge-connector/docs/reference/edge-connector.md +5 -0
- package/libs/esp32/built/debug/binary.js +462 -462
- package/libs/feather/docs/reference/feather.md +11 -0
- package/libs/game/built/debug/binary.js +7036 -7036
- package/libs/lcd/built/debug/binary.js +8 -8
- package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
- package/libs/lora/built/debug/binary.js +8 -8
- package/libs/matrix-keypad/built/debug/binary.js +8 -8
- package/libs/mixer/instrument.ts +28 -9
- package/libs/mixer/melody.cpp +43 -0
- package/libs/mixer/sequencer.ts +116 -0
- package/libs/mixer/sim/music.ts +102 -0
- package/libs/mqtt/built/debug/binary.js +176 -176
- package/libs/net/built/debug/binary.js +176 -176
- package/libs/net-game/built/debug/binary.js +8625 -8625
- package/libs/palette/built/debug/binary.js +7035 -7035
- package/libs/pixel/built/debug/binary.js +8 -8
- package/libs/power/built/debug/binary.js +8 -8
- package/libs/proximity/built/debug/binary.js +8 -8
- package/libs/radio/built/debug/binary.js +8 -8
- package/libs/radio-broadcast/built/debug/binary.js +8 -8
- package/libs/rotary-encoder/built/debug/binary.js +8 -8
- package/libs/screen/built/debug/binary.js +50 -50
- package/libs/servo/built/debug/binary.js +8 -8
- package/libs/sprite-scaling/_locales/sprite-scaling-jsdoc-strings.json +18 -1
- package/libs/sprite-scaling/_locales/sprite-scaling-strings.json +1 -0
- package/libs/sprite-scaling/built/debug/binary.js +7035 -7035
- package/libs/sprite-scaling/docs/reference/sprite-scaling.md +23 -0
- package/libs/sprite-scaling/docs/reference/sprites/scaling/scale-by-pixels.md +1 -1
- package/libs/sprite-scaling/docs/reference/sprites/scaling/scale-to-pixels.md +1 -1
- package/libs/sprite-scaling/scaling.ts +24 -0
- package/libs/storyboard/built/debug/binary.js +7035 -7035
- package/package.json +2 -2
package/built/common-sim.d.ts
CHANGED
|
@@ -947,6 +947,20 @@ declare namespace pxsim.music {
|
|
|
947
947
|
function queuePlayInstructions(when: number, b: RefBuffer): void;
|
|
948
948
|
function stopPlaying(): void;
|
|
949
949
|
function forceOutput(mode: number): void;
|
|
950
|
+
const SEQUENCER_STOP_MESSAGE = 3243;
|
|
951
|
+
const SEQUENCER_TICK_MESSAGE = 3244;
|
|
952
|
+
const SEQUENCER_STATE_CHANGE_MESSAGE = 3245;
|
|
953
|
+
const SEQUENCER_LOOPED_MESSAGE = 3246;
|
|
954
|
+
function _createSequencer(): Promise<number>;
|
|
955
|
+
function _sequencerState(id: number): string;
|
|
956
|
+
function _sequencerCurrentTick(id: number): number;
|
|
957
|
+
function _sequencerPlaySong(id: number, song: RefBuffer, loop: boolean): void;
|
|
958
|
+
function _sequencerStop(id: number): void;
|
|
959
|
+
function _sequencerSetVolume(id: number, volume: number): void;
|
|
960
|
+
function _sequencerSetVolumeForAll(volume: number): void;
|
|
961
|
+
function _sequencerSetTrackVolume(id: number, trackIndex: number, volume: number): void;
|
|
962
|
+
function _sequencerSetDrumTrackVolume(id: number, trackIndex: number, drumIndex: number, volume: number): void;
|
|
963
|
+
function _sequencerDispose(id: number): void;
|
|
950
964
|
}
|
|
951
965
|
declare namespace pxsim.mouse {
|
|
952
966
|
function setButton(button: number, down: boolean): void;
|
package/built/common-sim.js
CHANGED
|
@@ -3200,10 +3200,108 @@ var pxsim;
|
|
|
3200
3200
|
music.queuePlayInstructions = queuePlayInstructions;
|
|
3201
3201
|
function stopPlaying() {
|
|
3202
3202
|
pxsim.AudioContextManager.muteAllChannels();
|
|
3203
|
+
if (sequencers) {
|
|
3204
|
+
for (const seq of sequencers) {
|
|
3205
|
+
seq.sequencer.stop();
|
|
3206
|
+
seq.sequencer.dispose();
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3203
3209
|
}
|
|
3204
3210
|
music.stopPlaying = stopPlaying;
|
|
3205
3211
|
function forceOutput(mode) { }
|
|
3206
3212
|
music.forceOutput = forceOutput;
|
|
3213
|
+
music.SEQUENCER_STOP_MESSAGE = 3243;
|
|
3214
|
+
music.SEQUENCER_TICK_MESSAGE = 3244;
|
|
3215
|
+
music.SEQUENCER_STATE_CHANGE_MESSAGE = 3245;
|
|
3216
|
+
music.SEQUENCER_LOOPED_MESSAGE = 3246;
|
|
3217
|
+
let sequencers;
|
|
3218
|
+
let nextSequencerId = 0;
|
|
3219
|
+
async function _createSequencer() {
|
|
3220
|
+
if (!sequencers) {
|
|
3221
|
+
pxsim.AudioContextManager.onStopAll(() => {
|
|
3222
|
+
for (const seq of sequencers) {
|
|
3223
|
+
seq.sequencer.stop();
|
|
3224
|
+
seq.sequencer.dispose();
|
|
3225
|
+
}
|
|
3226
|
+
sequencers = [];
|
|
3227
|
+
});
|
|
3228
|
+
sequencers = [];
|
|
3229
|
+
}
|
|
3230
|
+
const res = {
|
|
3231
|
+
id: nextSequencerId++,
|
|
3232
|
+
sequencer: new music.Sequencer()
|
|
3233
|
+
};
|
|
3234
|
+
sequencers.push(res);
|
|
3235
|
+
await res.sequencer.initAsync();
|
|
3236
|
+
res.sequencer.addEventListener("stop", () => {
|
|
3237
|
+
pxsim.board().bus.queue(music.SEQUENCER_STOP_MESSAGE, this.id);
|
|
3238
|
+
});
|
|
3239
|
+
res.sequencer.addEventListener("state-change", () => {
|
|
3240
|
+
pxsim.board().bus.queue(music.SEQUENCER_STATE_CHANGE_MESSAGE, this.id);
|
|
3241
|
+
});
|
|
3242
|
+
res.sequencer.addEventListener("looped", () => {
|
|
3243
|
+
pxsim.board().bus.queue(music.SEQUENCER_LOOPED_MESSAGE, this.id);
|
|
3244
|
+
});
|
|
3245
|
+
res.sequencer.addEventListener("tick", () => {
|
|
3246
|
+
pxsim.board().bus.queue(music.SEQUENCER_TICK_MESSAGE, this.id);
|
|
3247
|
+
});
|
|
3248
|
+
return res.id;
|
|
3249
|
+
}
|
|
3250
|
+
music._createSequencer = _createSequencer;
|
|
3251
|
+
function _sequencerState(id) {
|
|
3252
|
+
var _a;
|
|
3253
|
+
return (_a = lookupSequencer(id)) === null || _a === void 0 ? void 0 : _a.state();
|
|
3254
|
+
}
|
|
3255
|
+
music._sequencerState = _sequencerState;
|
|
3256
|
+
function _sequencerCurrentTick(id) {
|
|
3257
|
+
var _a;
|
|
3258
|
+
return (_a = lookupSequencer(id)) === null || _a === void 0 ? void 0 : _a.currentTick();
|
|
3259
|
+
}
|
|
3260
|
+
music._sequencerCurrentTick = _sequencerCurrentTick;
|
|
3261
|
+
function _sequencerPlaySong(id, song, loop) {
|
|
3262
|
+
var _a;
|
|
3263
|
+
const decoded = music.decodeSong(song.data);
|
|
3264
|
+
(_a = lookupSequencer(id)) === null || _a === void 0 ? void 0 : _a.start(decoded, loop);
|
|
3265
|
+
}
|
|
3266
|
+
music._sequencerPlaySong = _sequencerPlaySong;
|
|
3267
|
+
function _sequencerStop(id) {
|
|
3268
|
+
var _a;
|
|
3269
|
+
(_a = lookupSequencer(id)) === null || _a === void 0 ? void 0 : _a.stop();
|
|
3270
|
+
}
|
|
3271
|
+
music._sequencerStop = _sequencerStop;
|
|
3272
|
+
function _sequencerSetVolume(id, volume) {
|
|
3273
|
+
var _a;
|
|
3274
|
+
(_a = lookupSequencer(id)) === null || _a === void 0 ? void 0 : _a.setVolume(volume);
|
|
3275
|
+
}
|
|
3276
|
+
music._sequencerSetVolume = _sequencerSetVolume;
|
|
3277
|
+
function _sequencerSetVolumeForAll(volume) {
|
|
3278
|
+
for (const seq of sequencers) {
|
|
3279
|
+
seq.sequencer.setVolume(volume);
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
music._sequencerSetVolumeForAll = _sequencerSetVolumeForAll;
|
|
3283
|
+
function _sequencerSetTrackVolume(id, trackIndex, volume) {
|
|
3284
|
+
var _a;
|
|
3285
|
+
(_a = lookupSequencer(id)) === null || _a === void 0 ? void 0 : _a.setTrackVolume(trackIndex, volume);
|
|
3286
|
+
}
|
|
3287
|
+
music._sequencerSetTrackVolume = _sequencerSetTrackVolume;
|
|
3288
|
+
function _sequencerSetDrumTrackVolume(id, trackIndex, drumIndex, volume) {
|
|
3289
|
+
var _a;
|
|
3290
|
+
(_a = lookupSequencer(id)) === null || _a === void 0 ? void 0 : _a.setDrumTrackVolume(trackIndex, drumIndex, volume);
|
|
3291
|
+
}
|
|
3292
|
+
music._sequencerSetDrumTrackVolume = _sequencerSetDrumTrackVolume;
|
|
3293
|
+
function _sequencerDispose(id) {
|
|
3294
|
+
var _a;
|
|
3295
|
+
(_a = lookupSequencer(id)) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
3296
|
+
sequencers = sequencers.filter(s => s.id !== id);
|
|
3297
|
+
}
|
|
3298
|
+
music._sequencerDispose = _sequencerDispose;
|
|
3299
|
+
function lookupSequencer(id) {
|
|
3300
|
+
for (const seq of sequencers)
|
|
3301
|
+
if (seq.id === id)
|
|
3302
|
+
return seq.sequencer;
|
|
3303
|
+
return undefined;
|
|
3304
|
+
}
|
|
3207
3305
|
})(music = pxsim.music || (pxsim.music = {}));
|
|
3208
3306
|
})(pxsim || (pxsim = {}));
|
|
3209
3307
|
var pxsim;
|