pxt-microbit 4.1.17 → 4.1.20

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/sim.d.ts CHANGED
@@ -586,124 +586,9 @@ declare namespace pxsim.serial {
586
586
  function readBuffer(length: number): RefBuffer;
587
587
  function setBaudRate(rate: number): void;
588
588
  }
589
- /**
590
- * Adapted from lancaster-university/codal-microbit-v2
591
- * https://github.com/lancaster-university/codal-microbit-v2/blob/master/source/SoundEmojiSynthesizer.cpp
592
- */
593
- declare namespace pxsim.music {
594
- const EMOJI_SYNTHESIZER_SAMPLE_RATE = 44100;
595
- const EMOJI_SYNTHESIZER_TONE_WIDTH_F = 1024;
596
- const EMOJI_SYNTHESIZER_TONE_WIDTH = 1024;
597
- const EMOJI_SYNTHESIZER_BUFFER_SIZE = 512;
598
- const EMOJI_SYNTHESIZER_TONE_EFFECT_PARAMETERS = 2;
599
- const EMOJI_SYNTHESIZER_TONE_EFFECTS = 3;
600
- const EMOJI_SYNTHESIZER_STATUS_ACTIVE = 1;
601
- const EMOJI_SYNTHESIZER_STATUS_OUTPUT_SILENCE_AS_EMPTY = 2;
602
- const EMOJI_SYNTHESIZER_STATUS_STOPPING = 4;
603
- class SoundEmojiSynthesizer {
604
- bufferSize: number;
605
- buffer: number[];
606
- sampleRate: number;
607
- sampleRange: number;
608
- samplesPerStep: number[];
609
- samplesToWrite: number;
610
- samplesWritten: number;
611
- orMask: number;
612
- frequency: number;
613
- volume: number;
614
- position: number;
615
- status: number;
616
- effectPointer: number;
617
- effectBuffer: SoundEffect[];
618
- get effect(): SoundEffect;
619
- constructor(id: number, sampleRate?: number);
620
- play(sound: SoundEffect[]): void;
621
- nextSoundEffect(): boolean;
622
- pull(): number[];
623
- determineSampleCount(playoutTime: number): number;
624
- totalDuration(): number;
625
- }
626
- }
627
- /**
628
- * Adapted from lancaster-university/codal-microbit-v2
629
- * https://github.com/lancaster-university/codal-microbit-v2/blob/master/source/SoundExpressions.cpp#L286
630
- */
631
- declare namespace pxsim.music.builtin {
632
- function lookupBuiltIn(sound: string): string;
633
- }
634
- /**
635
- * Adapted from lancaster-university/codal-core
636
- * https://github.com/lancaster-university/codal-core/blob/master/source/streams/Synthesizer.cpp#L54
637
- */
638
- declare namespace pxsim.music.Synthesizer {
639
- function SineTone(arg: number[], position: number): number;
640
- function SawtoothTone(arg: number[], position: number): number;
641
- function TriangleTone(arg: number[], position: number): number;
642
- function NoiseTone(arg: number[], position: number): number;
643
- function SquareWaveTone(arg: number[], position: number): 0 | 1023;
644
- }
645
- /**
646
- * Adapted from lancaster-university/codal-microbit-v2
647
- * https://github.com/lancaster-university/codal-microbit-v2/blob/master/source/SoundSynthesizerEffects.cpp
648
- */
649
- declare namespace pxsim.music.SoundSynthesizerEffects {
650
- /**
651
- * Root Frequency Interpolation Effect Functions
652
- */
653
- function noInterpolation(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
654
- function linearInterpolation(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
655
- function logarithmicInterpolation(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
656
- function curveInterpolation(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
657
- function slowVibratoInterpolation(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
658
- function warbleInterpolation(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
659
- function vibratoInterpolation(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
660
- function exponentialRisingInterpolation(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
661
- function exponentialFallingInterpolation(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
662
- function appregrioAscending(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
663
- function appregrioDescending(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
664
- /**
665
- * Frequency Delta effects
666
- */
667
- function frequencyVibratoEffect(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
668
- function volumeVibratoEffect(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
669
- /**
670
- * Volume Delta effects
671
- */
672
- /** Simple ADSR enveleope effect.
673
- * parameter[0]: Centre volume
674
- * parameter[1]: End volume
675
- * effect.volume: start volume
676
- */
677
- function adsrVolumeEffect(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
678
- /**
679
- * Simple volume ramp effect
680
- * parameter[0]: End volume
681
- * effect.volume: start volume
682
- */
683
- function volumeRampEffect(synth: SoundEmojiSynthesizer, context: ToneEffect): void;
684
- }
685
589
  declare namespace pxsim.music {
686
590
  function __playSoundExpression(notes: string, waitTillDone: boolean): void;
687
591
  function __stopSoundExpressions(): void;
688
- interface TonePrint {
689
- tonePrint: (arg: number[], position: number) => number;
690
- parameter: number[];
691
- }
692
- interface ToneEffect {
693
- effect: (synth: SoundEmojiSynthesizer, context: ToneEffect) => void;
694
- step: number;
695
- steps: number;
696
- parameter: number[];
697
- parameter_p: Progression[];
698
- }
699
- interface SoundEffect {
700
- frequency: number;
701
- volume: number;
702
- duration: number;
703
- tone: TonePrint;
704
- effects: ToneEffect[];
705
- }
706
- function parseSoundExpression(soundChars: string, fx: SoundEffect): boolean;
707
592
  }
708
593
  declare namespace pxsim {
709
594
  class ThermometerState {
@@ -994,7 +879,7 @@ declare namespace pxsim {
994
879
  mode: number;
995
880
  width: number;
996
881
  get length(): number;
997
- get stride(): 4 | 3;
882
+ get stride(): 3 | 4;
998
883
  pixelColor(pixel: number): number[];
999
884
  }
1000
885
  interface CommonNeoPixelStateConstructor {