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 +5 -4
- package/dist/mercury.js +12 -9
- package/dist/mercury.min.es5.js +1 -1
- package/dist/mercury.min.js +1 -1
- package/examples/basic/index.html +1 -1
- package/examples/errors/index.html +78 -0
- package/examples/midi/index.html +1 -1
- package/index.js +2 -0
- package/package.json +1 -1
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
|
<!-- [](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
|
-
[
|
|
21
|
+
<!-- [**💬 Join the Mercury Community on Discord**](https://discord.gg/vt59NYU) -->
|
|
23
22
|
|
|
24
|
-
[
|
|
23
|
+
[](https://discord.gg/vt59NYU)
|
|
24
|
+
[](https://ko-fi.com/I2I3SV7FX)
|
|
25
|
+
[](https://www.patreon.com/bePatron?u=9649817)
|
|
25
26
|
|
|
26
27
|
<!--  -->
|
|
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
|
|
16068
|
-
|
|
16069
|
-
|
|
16070
|
-
|
|
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
|
|