Skip to content

Commit

Permalink
added makeNote
Browse files Browse the repository at this point in the history
  • Loading branch information
colxi committed Aug 18, 2017
1 parent 42204fb commit 1d7fe0e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions js-harmony.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Project Name: JSHarmony
Version: 1.3 (03/08/2017)
Version: (see package.json)
Author: colxi
Author URI: http://www.colxi.info/
Description: JSHarmony library is a set of musical related fuctions and definitions
Expand Down Expand Up @@ -71,7 +71,7 @@
*/

'#': 0.5,
'b': -0.5
'b': -0.5 // ♭
},
intervals: {
/*
Expand Down Expand Up @@ -285,7 +285,17 @@
/*
/ GENERATORS
*/

makeNote : function(name){
var parts = name.split('');
var n = new Note();
n.name = parts[0];
for(var i =1 ; i<parts.length;i++){
if( isNaN( parts[i] ) ) n.accidentals.push( parts[i] );
else n.octave = parseInt(parts[i]);
}
n.duration = 1;
return n;
},
makeScale: function(mode,name,root){
/*
/ Generate asending and descending notes for requested scale. Returns an Array of notes.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "js-harmony",
"version": "1.3",
"version": "1.4.0",
"private": false,
"description": "Set of musical related methods and definitions dessigned to generate Chords, Notes, Intervals, Scales...",
"author": "colxi",
"license": "ISC",
"license": "GPL",
"main": "js-harmony.js",
"dependencies": {

Expand Down

0 comments on commit 1d7fe0e

Please sign in to comment.