Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 70 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Band.js - Music Composer
piano.note('quarter', 'E4');
piano.note('quarter', 'F4');
```

7. Tell the `conductor` everything is done: `var player = conductor.finish();`. It will return you the player instance to use for playing, pausing, muting, stopping, and seeking.
8. Start playing the music: `player.play()`

Expand All @@ -30,6 +30,75 @@ Band.js - Music Composer
* [Zelda Main Theme](http://plnkr.co/edit/jFnos1?p=preview) - Created by [legosjedi](http://www.reddit.com/user/legosjedi)
* [Frog's Theme - Chrono Trigger](http://plnkr.co/edit/vVrFxg?p=preview) - Created by Me & Jarred Mack

***

### Procedural Latino Notation

1. **Notation**:

```javascript
Instrument(Rhythm, Note);
```

**Instrument**: In the library there are 4 oscillators and 5 noises.

**Rhythm**: Value from 1 to 16.
Example: 1 = sixteenth; 4 = quarter; 16 = whole. See image: http://i.imgur.com/IQURaxM.png

**Note**: First digit is octave, second digit is note, third digit if 0 is flat or 1 is sharp.
Example: 01 = C0; 011 = c#0; 02 = D0; 020 = Db0; 77 = B7

2. **Do Re Mi Fa example**:

```javascript

var conductor = new BandJS();
conductor.setTimeSignature(4,4);
conductor.setTempo(120);

conductor.constructor('equalProcedural', 'latino');

var piano = conductor.createInstrument('sine', 'oscillators'),
p = piano.note,
r = piano.rest;

p(2, 41)
p(2, 42)
p(2, 43)
p(2, 44)
r(2)
p(2, 44)
p(2, 44)
r(2)
p(2, 41)
p(2, 42)
p(2, 41)
p(2, 42)
r(2)
p(2, 42)
p(2, 42)
r(2)
p(2, 41)
p(2, 45)
p(2, 44)
p(2, 43)
r(2)
p(2, 43)
p(2, 43)
r(2)
p(2, 41)
p(2, 42)
p(2, 43)
p(2, 44)
r(2)
p(2, 44)
p(2, 44);

var player = conductor.finish();

player.play();
```

#### In The News

* [Retro Game Music using Web Audio API and Band.js](http://modernweb.com/2013/09/09/retro-game-music-using-web-audio-and-band-js/)
Expand Down
194 changes: 190 additions & 4 deletions dist/band.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ function Instrument(name, pack, conductor) {
articulationGap = tie ? 0 : duration * articulationGapPercentage;

if (pitch) {
var z = "";
pitch = z + pitch;
pitch = pitch.split(',');
var index = -1;
while (++ index < pitch.length) {
Expand Down Expand Up @@ -713,9 +715,11 @@ module.exports.loadPack('instrument', 'noises', _dereq_('./instrument-packs/nois
module.exports.loadPack('instrument', 'oscillators', _dereq_('./instrument-packs/oscillators.js'));
module.exports.loadPack('rhythm', 'northAmerican', _dereq_('./rhythm-packs/north-american.js'));
module.exports.loadPack('rhythm', 'european', _dereq_('./rhythm-packs/european.js'));
module.exports.loadPack('rhythm', 'latino', _dereq_('./rhythm-packs/latino-american.js'));
module.exports.loadPack('tuning', 'equalTemperament', _dereq_('./tuning-packs/equal-temperament.js'));
module.exports.loadPack('tuning', 'equalProcedural', _dereq_('./tuning-packs/equal-procedural.js'));

},{"./conductor.js":2,"./instrument-packs/noises.js":3,"./instrument-packs/oscillators.js":4,"./rhythm-packs/european.js":8,"./rhythm-packs/north-american.js":9,"./tuning-packs/equal-temperament.js":10}],7:[function(_dereq_,module,exports){
},{"./conductor.js":2,"./instrument-packs/noises.js":3,"./instrument-packs/oscillators.js":4,"./rhythm-packs/european.js":8,"./rhythm-packs/north-american.js":9,"./rhythm-packs/latino-american.js":10,"./tuning-packs/equal-temperament.js":11,"./tuning-packs/equal-procedural.js":12}],7:[function(_dereq_,module,exports){
/**
* Band.js - Music Composer
* An interface for the Web Audio API that supports rhythms, multiple instruments, repeating sections, and complex
Expand Down Expand Up @@ -1183,6 +1187,37 @@ module.exports = {
* @author Cody Lundquist (http://github.com/meenie) - 2014
*/

/**
* Latino American Rhythm Pack - Image reference: http://i.imgur.com/IQURaxM.png
*/
module.exports = {
1: 0.0625,
2: 0.125,
3: 0.1875,
4: 0.25,
5: 0.3125,
6: 0.375,
7: 0.4375,
8: 0.5,
9: 0.5625,
10: 0.625,
11: 0.6875,
12: 0.75,
13: 0.8125,
14: 0.875,
15: 0.9375,
16: 1
};

},{}],11:[function(_dereq_,module,exports){
/**
* Band.js - Music Composer
* An interface for the Web Audio API that supports rhythms, multiple instruments, repeating sections, and complex
* time signatures.
*
* @author Cody Lundquist (http://github.com/meenie) - 2014
*/

/**
* Equal Temperament Tuning
* Source: http://www.phy.mtu.edu/~suits/notefreqs.html
Expand Down Expand Up @@ -1327,6 +1362,157 @@ module.exports = {
'C8': 4186.01
};

},{}]},{},[6])
(6)
});
},{}],12:[function(_dereq_,module,exports){
/**
* Band.js - Music Composer
* An interface for the Web Audio API that supports rhythms, multiple instruments, repeating sections, and complex
* time signatures.
*
* @author Cody Lundquist (http://github.com/meenie) - 2014
*/

/**
* Equal Temperament Tuning - Procedural Notation
* Source: http://www.phy.mtu.edu/~suits/notefreqs.html
*/
module.exports = {
01: 16.35,
011: 17.32,
020: 17.32,
02: 18.35,
021: 19.45,
030: 19.45,
03: 20.60,
04: 21.83,
041: 23.12,
050: 23.12,
05: 24.50,
051: 25.96,
060: 25.96,
06: 27.50,
061: 29.14,
070: 29.14,
07: 30.87,
11: 32.70,
111: 34.65,
120: 34.65,
12: 36.71,
121: 38.89,
130: 38.89,
13: 41.20,
14: 43.65,
141: 46.25,
150: 46.25,
15: 49.00,
151: 51.91,
160: 51.91,
16: 55.00,
161: 58.27,
170: 58.27,
17: 61.74,
21: 65.41,
211: 69.30,
220: 69.30,
22: 73.42,
221: 77.78,
230: 77.78,
23: 82.41,
24: 87.31,
241: 92.50,
250: 92.50,
25: 98.00,
251: 103.83,
260: 103.83,
26: 110.00,
261: 116.54,
270: 116.54,
27: 123.47,
31: 130.81,
311: 138.59,
320: 138.59,
32: 146.83,
321: 155.56,
330: 155.56,
33: 164.81,
34: 174.61,
341: 185.00,
350: 185.00,
35: 196.00,
351: 207.65,
360: 207.65,
36: 220.00,
361: 233.08,
370: 233.08,
37: 246.94,
41: 261.63,
411: 277.18,
420: 277.18,
42: 293.66,
421: 311.13,
430: 311.13,
43: 329.63,
44: 349.23,
441: 369.99,
450: 369.99,
45: 392.00,
451: 415.30,
460: 415.30,
46: 440.00,
461: 466.16,
470: 466.16,
47: 493.88,
51: 523.25,
511: 554.37,
520: 554.37,
52: 587.33,
521: 622.25,
530: 622.25,
53: 659.26,
54: 698.46,
541: 739.99,
550: 739.99,
55: 783.99,
551: 830.61,
560: 830.61,
56: 880.00,
561: 932.33,
570: 932.33,
57: 987.77,
61: 1046.50,
611: 1108.73,
620: 1108.73,
62: 1174.66,
621: 1244.51,
630: 1244.51,
63: 1318.51,
64: 1396.91,
641: 1479.98,
650: 1479.98,
65: 1567.98,
651: 1661.22,
660: 1661.22,
66: 1760.00,
661: 1864.66,
670: 1864.66,
67: 1975.53,
71: 2093.00,
711: 2217.46,
720: 2217.46,
72: 2349.32,
721: 2489.02,
730: 2489.02,
73: 2637.02,
74: 2793.83,
741: 2959.96,
750: 2959.96,
75: 3135.96,
751: 3322.44,
760: 3322.44,
76: 3520.00,
761: 3729.31,
770: 3729.31,
77: 3951.07,
81: 4186.01
};

},{}]},{},[6])(6)});
Loading