123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- this.clickEventMethod = function() {
- this.synth.triggerAttackRelease(['C4'], ['8n'], null, 0.3);
- }
- this.doButtonTriggerdownAction = function(buttonID){
- let transportNode = this.find('//' + 'globalTransport')[0];
- if(this.playButton.displayName == "playButton"){
-
- this.globalBeat = this.globalBeat? false : true;
- if(this.globalBeat){
- this.playButton.baseColor = 'red';
- this.playButton.textNode.value = 'Stop'
- if(!transportNode.playing)
- transportNode.play()
- } else {
- this.playButton.baseColor = 'green';
- this.playButton.textNode.value = 'Play'
- }
- }
- }
- this.initialize = function(){
- this.playButton.init();
- }
- this.onGlobalBeat = function (obj) {
-
- let transportNode = this.find('//' + obj.name)[0];
- let rate = transportNode.animationRate;
- let tps = transportNode.animationTPS;
-
- let end = this.transportLine.end;
- if(obj.beat == 0)
- this.transportLine.translateTo([end, 0, 0], rate - 0.1);
- if(obj.beat == tps - 1)
- this.transportLine.translateTo([0, 0, 0]);
- }
|