12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- this.initialize = function(){
-
- }
- this.fromhitstartEventMethod = function(value){
- let synth = this.parent.synth;
-
- let scene = this.getScene();
- let notes = value.map(el=>{
- let node = scene.findNodeByID(el);
- node.synth = synth.id;
-
-
- return {
- freq: node.note.note,
- velocity: node.radius,
- duration: node.height
- }
- })
- if(notes.length == 1){
- let note = notes[0];
-
- synth.triggerAttackRelease([note.freq], [note.duration], null, note.velocity);
- } else if (notes.length > 0){
- let chord = notes.map(el=>{
- return el.freq
- })
- let durations = notes.map(el=>{
- return el.duration
- })
- let velocity = notes[0].velocity;
- synth.triggerAttackRelease(chord, durations, null, velocity);
-
- }
-
- }
- this.fromhitendEventMethod = function(value){
-
- }
|