Open mahmutakyol opened 7 years ago
ext.runTone = function(pin, tone, beat) { runPackage(34, 8, short2array(typeof tone == "number" ? tone : tones[tone]), short2array(typeof beat == "number" ? beat : beats[beat])); };
=> readBuffer(7) = 0, readBuffer(8) = 0
I get the value of readBuffer when I give a constant value instead of short2array in this code, but when I use short2array function, the value is zero.
ext.runTone = function(pin, tone, beat) { runPackage(34, 8, 262, 500); };
=> readBuffer(7) = 262, readBuffer(8) = 500
extension.js => console.log(args) => C4, Half
console.log(args)
my tones array => var tones = { "C4": 262, "D4": 294, "E4": 330, "F4": 349, "G4": 392, "A4": 440, "B4": 494 };
var tones = { "C4": 262, "D4": 294, "E4": 330, "F4": 349, "G4": 392, "A4": 440, "B4": 494 };
my beats array => var beats = { "Half": 500, "Quarter": 250, "Eighth": 125, "Whole": 1000, "Double": 2000, "Zero": 0 };
var beats = { "Half": 500, "Quarter": 250, "Eighth": 125, "Whole": 1000, "Double": 2000, "Zero": 0 };
ext.runTone = function(pin, tone, beat) { runPackage(34, 8, short2array(typeof tone == "number" ? tone : tones[tone]), short2array(typeof beat == "number" ? beat : beats[beat])); };
=> readBuffer(7) = 0, readBuffer(8) = 0
I get the value of readBuffer when I give a constant value instead of short2array in this code, but when I use short2array function, the value is zero.
ext.runTone = function(pin, tone, beat) { runPackage(34, 8, 262, 500); };
=> readBuffer(7) = 262, readBuffer(8) = 500
extension.js =>
console.log(args)
=> C4, Halfmy tones array =>
var tones = { "C4": 262, "D4": 294, "E4": 330, "F4": 349, "G4": 392, "A4": 440, "B4": 494 };
my beats array =>
var beats = { "Half": 500, "Quarter": 250, "Eighth": 125, "Whole": 1000, "Double": 2000, "Zero": 0 };