mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 16:48:00 +00:00
checks if part is array
This commit is contained in:
parent
a01dbb8518
commit
2016778123
1 changed files with 14 additions and 10 deletions
|
@ -132,6 +132,7 @@ define(["Tone/core/Tone", "Tone/core/Transport"], function(Tone){
|
|||
var notes = [];
|
||||
for (var inst in score){
|
||||
var part = score[inst];
|
||||
if (Array.isArray(part)){
|
||||
for (var i = 0; i < part.length; i++){
|
||||
var noteDescription = part[i];
|
||||
var note;
|
||||
|
@ -144,6 +145,9 @@ define(["Tone/core/Tone", "Tone/core/Transport"], function(Tone){
|
|||
}
|
||||
notes.push(note);
|
||||
}
|
||||
} else {
|
||||
throw new TypeError("score parts must be Arrays");
|
||||
}
|
||||
}
|
||||
return notes;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue