Skip to content
This repository was archived by the owner on Jun 9, 2019. It is now read-only.

Commit

Permalink
Merge pull request #37 from mohayonao/v14.11.25
Browse files Browse the repository at this point in the history
v14.11.25
  • Loading branch information
mohayonao committed Nov 26, 2014
2 parents 086ada6 + b6eeb0d commit 04c3f85
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ T("sin", {freq:880, mul:0.5}).play();
MIT

## ChangeLog ##
**14.11.25** (356.27KB)
* Merge: [#33](https://github.com/mohayonao/timbre.js/pull/33) update of the note duration formula to handle more 3 dots
* Merge: [#36](https://github.com/mohayonao/timbre.js/pull/36) use latest Web Audio API interfaces

**14.10.12** (356.28KB)
* Fixed: Decoding wav file
* Fixed: Envelope release
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timbre",
"version": "14.10.12",
"version": "14.11.25",
"description": "JavaScript library for objective sound programming",
"author": "nao yonamine <[email protected]>",
"repository": {
Expand All @@ -15,16 +15,16 @@
}
],
"dependencies": {
"readable-stream": "^1.0.33-1",
"readable-stream": "^1.0.33",
"speaker": "^0.2.1"
},
"devDependencies": {
"chai": "^1.9.2",
"chai": "^1.10.0",
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "^0.6.0",
"grunt-contrib-watch": "^0.6.1",
"mocha": "^1.21.5"
"mocha": "^2.0.1"
}
}
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
}
if ((m = /L(\d+)?(\.*)$/i.exec(str))) {
ms = 60 / getbpm(str) * (4 / (m[1]||4)) * 1000;
ms *= [1, 1.5, 1.75, 1.875][(m[2]||"").length] || 1;
ms *= 2 - (1 / Math.pow(2, (m[2]||"").length));
return ms;
}
if ((m = /^(\d+(?:\.\d+)?|\.(?:\d+))(min|sec|m)s?$/i.exec(str))) {
Expand Down
4 changes: 2 additions & 2 deletions src/extras/webaudioapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
_.bufferR = new fn.SignalArray(BUFFERSIZE << 2);
_.buffermask = _.bufferL.length - 1;
_.node = null;
_.script = context.createJavaScriptNode(BUFFERSIZE, 2, 2);
_.script = context.createScriptProcessor(BUFFERSIZE, 2, 2);
_.writeIndex = 0;
_.readIndex = 0;
_.totalRead = 0;
Expand Down Expand Up @@ -58,7 +58,7 @@
var _ = this._;
_.mode = "recv";
_.script.onaudioprocess = make_recv_process(this);
_.gain = context.createGainNode();
_.gain = context.createGain();
_.gain.gain.value = 0;
_.script.connect(_.gain);
}
Expand Down
4 changes: 2 additions & 2 deletions src/objects/mediastream.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
listen: function() {
var _ = this._;
var context = fn._audioContext;
_.gain = context.createGainNode();
_.gain = context.createGain();
_.gain.gain.value = 0;
_.node = context.createJavaScriptNode(1024, 2, 2);
_.node = context.createScriptProcessorNode(1024, 2, 2);
_.node.onaudioprocess = onaudioprocess(this);
_.src.connect(_.node);
_.node.connect(_.gain);
Expand Down
4 changes: 2 additions & 2 deletions src/objects/mml.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
dot = cmd.dot || status.dot;
}
duration = (60 / tempo) * (4 / len) * 1000;
duration *= [1, 1.5, 1.75, 1.875][dot] || 1;
duration *= 2 - (1 / Math.pow(2, dot));

vel = status.v << 3;
if (status.tie) {
Expand Down Expand Up @@ -315,7 +315,7 @@
}
if (len > 0) {
duration = (60 / tempo) * (4 / len) * 1000;
duration *= [1, 1.5, 1.75, 1.875][dot] || 1;
duration *= 2 - (1 / Math.pow(2, dot));
queueTime += duration;
}
break;
Expand Down
12 changes: 6 additions & 6 deletions timbre.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
var ACCEPT_SAMPLERATES = [8000,11025,12000,16000,22050,24000,32000,44100,48000];
var ACCEPT_CELLSIZES = [32,64,128,256];

var _ver = "14.10.12";
var _ver = "14.11.25";
var _sys = null;
var _constructors = {};
var _factories = {};
Expand Down Expand Up @@ -237,7 +237,7 @@
}
if ((m = /L(\d+)?(\.*)$/i.exec(str))) {
ms = 60 / getbpm(str) * (4 / (m[1]||4)) * 1000;
ms *= [1, 1.5, 1.75, 1.875][(m[2]||"").length] || 1;
ms *= 2 - (1 / Math.pow(2, (m[2]||"").length));
return ms;
}
if ((m = /^(\d+(?:\.\d+)?|\.(?:\d+))(min|sec|m)s?$/i.exec(str))) {
Expand Down Expand Up @@ -8209,9 +8209,9 @@
listen: function() {
var _ = this._;
var context = fn._audioContext;
_.gain = context.createGainNode();
_.gain = context.createGain();
_.gain.gain.value = 0;
_.node = context.createJavaScriptNode(1024, 2, 2);
_.node = context.createScriptProcessorNode(1024, 2, 2);
_.node.onaudioprocess = onaudioprocess(this);
_.src.connect(_.node);
_.node.connect(_.gain);
Expand Down Expand Up @@ -8835,7 +8835,7 @@
dot = cmd.dot || status.dot;
}
duration = (60 / tempo) * (4 / len) * 1000;
duration *= [1, 1.5, 1.75, 1.875][dot] || 1;
duration *= 2 - (1 / Math.pow(2, dot));

vel = status.v << 3;
if (status.tie) {
Expand Down Expand Up @@ -8882,7 +8882,7 @@
}
if (len > 0) {
duration = (60 / tempo) * (4 / len) * 1000;
duration *= [1, 1.5, 1.75, 1.875][dot] || 1;
duration *= 2 - (1 / Math.pow(2, dot));
queueTime += duration;
}
break;
Expand Down

0 comments on commit 04c3f85

Please sign in to comment.