Volume and motion

I wrote a code where the amplitude of a audio input is mapped to the amplitude of a sin function. Right now is just controlling the position of ellipse on a screen but i want this motion to be applied to a drawing machine using an Arduino, possibly a servo motor.
does any one have an example of how to convert this to using a motor?

import processing.sound.*;
Amplitude amp;
AudioIn in;

float s;//s is a map of the analyzer
float c;
float p;
float e;//speed
float range;
float v; //vertical movement

void setup(){
  size(1000,1000);
   amp = new Amplitude(this);
   in = new AudioIn(this, 0);
   in.start();
  amp.input(in);
  colorMode(HSB,360,100,100);

  s=0;
  e=0;
  v=0;
   background(c,100,100);
   noStroke();

}

void draw(){
  range=map(amp.analyze(),0,1,500,1500);
  e=e+1;
  p=map(sin(e),0,1,500,range);
  //c=map(amp.analyze(),0,.5,0,360);
  ellipse(p,v,5,5);
 // s=map(amp.analyze(),0,1,100,800); 
  v=v+.1;
  
  
  
}

Welcome to the forums!

What exactly is your question?

Hi! thanks,
I am asking if someone knows or have an example on how to convert this to using a motor?

I’d suggest looking at specific servo setups – it is much better to decide what hardware you want to target, specifically, before trying to get it to do what you want.

https://discourse.processing.org/search?q=servo

Are you sure that what you want is arduino? As opposed to a PC-connected AxiDraw, etc.?