Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. // here's the MIDI notes for the sequence
  2. // const NOTES = [36, 40, 43, 47, 48, 47, 43, 40];
  3. // web audio oscillators want frequency values, tho, so here's the frequencies:
  4. const NOTES = [65.4063913251, 82.4068892282, 97.9988589954, 123.4708253140, 130.8127826503, 123.4708253140, 97.9988589954, 82.4068892282];
  5.  
  6. let current = 0;
  7. setInterval(() => {
  8. postMessage(NOTES[current]);
  9. current = current < NOTES.length - 1 ? current + 1 : 0;
  10. }, 200);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement