• Practice Recordings
  • SD01
  • Stable Diffusion Galleries
  • Upcoming Events
  • Practice Recordings
  • SD01
  • Stable Diffusion Galleries
  • Upcoming Events
The.VUVU Jah Day?
  • Practice Recordings
  • SD01
  • Stable Diffusion Galleries
  • Upcoming Events
Written by dj@argos.vu on December 3, 2022

Ultrasonic

Uncategorized

#include “Ultrasonic.h”
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE(); 

Ultrasonic ultrasonic(8, 7); 

int midiMapped = 0; 
int lastmidiMapped = 0; 

void setup()

{

   Serial.begin(115200); 
}

void loop()

{
float x = ultrasonic.read(CM); 
delay (50); 
midiMapped = map(constrain(x, 5, 35), 5, 35, 48, 60); 
if (lastmidiMapped != midiMapped) { 
MIDI.sendNoteOff(lastmidiMapped, 0, 1);  
MIDI.sendNoteOn(midiMapped, 127, 1);

lastmidiMapped = midiMapped; 
delay(50); 
}
}



Archives

  • March 2025
  • October 2023
  • September 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • June 2019
  • March 2016

Calendar

July 2025
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Mar    

Categories

  • Practice_Vids
  • Uncategorized

Copyright The.VU 2025 | Theme by ThemeinProgress | Proudly powered by WordPress