xxxxxxxxxx
let currentNote = "";
let radius = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
// Enable Input Device 1 (see console)
enableMidi(0);
}
function draw() {
background(0);
stroke(255);
noFill();
circle(width/2, height/2, radius);
fill(255);
textAlign(CENTER, CENTER);
textSize(150);
text(currentNote, width/2, height/2);
}
function noteOn(e) {
print("noteOn", e.note);
currentNote = e.note.name + e.note.octave;
}
function noteOff(e) {
print("noteOff", e.note);
currentNote = "";
}
function pitchBend(e) {
print("PitchBend", e);
//currentNote = "";
}
function controlChange(e) {
print("ControlChange", e.rawValue);
radius = e.rawValue;
}