mercury-engine 1.0.5 → 1.0.6

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/README.md CHANGED
@@ -13,15 +13,16 @@ Mercury currently has 2 versions:
13
13
 
14
14
  [**🚀 Start Sketching Online!** (recommended for beginners)](https://mercury.timohoogland.com/)
15
15
 
16
- **👾 Or code with the latest full version in Max8:**
17
-
16
+ <!-- **👾 Or code with the latest full version in Max8:** -->
18
17
  <!-- [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/tmhglnd/mercury)](https://github.com/tmhglnd/mercury/releases)
19
18
 
20
19
  [**📟 Build a local app from the browser version with Electron**](https://github.com/tmhglnd/mercury-app) -->
21
20
 
22
- [**🙏 Support Mercury by becoming a Patron**](https://www.patreon.com/bePatron?u=9649817)
21
+ <!-- [**💬 Join the Mercury Community on Discord**](https://discord.gg/vt59NYU) -->
23
22
 
24
- [**💬 Join the Mercury Community on Discord**](https://discord.gg/vt59NYU)
23
+ [![](https://img.shields.io/static/v1?label=Join%20the%20Discord&message=%E2%9D%A4&logo=Discord)](https://discord.gg/vt59NYU)
24
+ [![](https://img.shields.io/static/v1?label=Support%20on%20Ko-Fi&message=%E2%9D%A4&logo=Kofi)](https://ko-fi.com/I2I3SV7FX)
25
+ [![](https://img.shields.io/static/v1?label=Support%20on%20Patreon&message=%E2%9D%A4&logo=Patreon)](https://www.patreon.com/bePatron?u=9649817)
25
26
 
26
27
  <!-- ![The Mercury playground in the browser](media/screenshot.png) -->
27
28
 
package/dist/mercury.js CHANGED
@@ -16064,11 +16064,10 @@ class MonoSample extends Instrument {
16064
16064
  // get the start position
16065
16065
  let o = dur * Util.getParam(this._pos, c);
16066
16066
 
16067
- // when sample is loaded, start
16068
- // this.sample.start(time, o, e);
16069
- this.sample.start(time, o);
16070
- // if (this.sample.loaded){
16071
- // }
16067
+ // when sample is loaded allow playback to start
16068
+ if (this.sample.loaded){
16069
+ this.sample.start(time, o);
16070
+ }
16072
16071
  }
16073
16072
 
16074
16073
  sound(s){
@@ -17281,7 +17280,9 @@ class MercuryInterpreter {
17281
17280
  'silence' : (mute) => {
17282
17281
  if (mute){
17283
17282
  // engine.silence();
17284
- this.silence();
17283
+ if (this.silence()){
17284
+ return;
17285
+ }
17285
17286
  }
17286
17287
  },
17287
17288
  'scale' : (args) => {
@@ -17555,7 +17556,7 @@ class Mercury extends MercuryInterpreter {
17555
17556
  Tone.Transport.timeSignature = [4, 4];
17556
17557
  // a bit latency on start for safety
17557
17558
  Tone.Transport.start('+0.1');
17558
- console.log('Resumed Transport');
17559
+ // console.log('Resumed Transport');
17559
17560
  }
17560
17561
  } catch {
17561
17562
  console.error('Error starting Transport');
@@ -17568,10 +17569,12 @@ class Mercury extends MercuryInterpreter {
17568
17569
  // fade out and remove code after 100ms
17569
17570
  this.removeSounds(this.sounds, 0.1);
17570
17571
  // Stops instead of pause so restarts at 0
17571
- Tone.Transport.stop();
17572
- console.log('Stopped Transport');
17572
+ Tone.Transport.stop(Tone.now()+0.1);
17573
+ // console.log('Stopped Transport');
17574
+ return true;
17573
17575
  } catch {
17574
17576
  console.error('Error stopping Transport');
17577
+ return false;
17575
17578
  }
17576
17579
  }
17577
17580