-
• #2
Actually just any multi-track music would be great. You could do something like this:
var track1 = "..."; var track2 = "..."; function note(ch) { if (ch in pitches) { var f = 4000*pitches[ch]/1500; if (!w.running) w.startOutput(B0, f); else if (!w2.running) w2.startOutput(B0, f); else if (!w3.running) w3.startOutput(B0, f); else if (!w4.running) w4.startOutput(B0, f); } } function step() { var ch1 = track1[pos]; var ch2 = track2[pos]; if (ch1 !== undefined) pos++; else pos=0; note(ch1); note(ch2); }
As you might have guessed by now I'm not very musical :)
-
• #3
Hi,
The video here https://www.kickstarter.com/projects/gfw/puckjs-the-ground-breaking-bluetooth-beacon between about 35 secs and 45 secs shows that when user press puck button music is played on user android phone.So, could you please help me to achieve the similar functionality.
Regards
-
• #4
See here: http://www.espruino.com/Puck.js+Keyboard
var controls = require("ble_hid_controls"); NRF.setServices(undefined, { hid : controls.report }); setWatch(function() { // Play/stop music controls.playpause(); }, BTN, {repeat:true,edge:"rising",debounce:50});
Should do it.
Hi, I was just messing around, and realised I'd added the ability to play more than one Waveform at once on the same output a while back, but had never shown it in use.
So...
Tetris music - not hi-fi quality, but it sounds pretty old-school :)
You might want to change
pinMode(B0, "af_opendrain");
if you're not using a Pico (it was running on the FET output to get a bit of volume).It'd be great if someone wanted to add another track so it actually was properly polyphonic. At the moment it's just playing overlapping waveforms (rather than actual different notes).