#include "jokermusikk.h" int hastighet; uint8_t *skala; int *c; int *f; int *g; int member = 3; int note_length = 50; int n = 0; int octave = 1; int akkord = 0; unsigned long seconds = 0; unsigned long prev = 0; void setup() { // put your setup code here, to run once: skala = SKALA[1]; c = treklang[0]; f = treklang[3]; g = treklang[4]; } void loop() { // put your main code here, to run repeatedly: note_length = random(30,70); octave = random(3,7); seconds = millis(); seconds = seconds/1000; if (prev != seconds) akkord = random(0,3); prev = seconds; member = random(3); switch (akkord) { case 0: // cm n = skala[c[member]]; break; case 1: // f n = skala[f[member]]; break; case 2: // g n = skala[g[member]]; break; } note(n,octave); delay(note_length); }