Gigantic Pitch Bender and some maths…

What could be easier than building a huge lever that the singer can bend notes, open filters, start samples or sequences with? Well, it wasn’t that easy in the end but Gig Performer helped me make it.

Of course no one needs stuff like that, but it’s fun for showing off. To me it’s important that things like these are no fake but actually work.

Building the lever wasn’t too hard: a broom stick, a potentiometer, a spring, and an Arduino. Specific models can pretend to be a USB MIDI interface so you can use them directly in Gig Performer.

Unfortunately the used Arduino library doesn’t support pitch bend but only CC messages with their 7 bit resolution. 128 steps are not enough for smooth transitions,
but how to make use of the Arduino ADC’s 1024 possible values (10 bit) then?

I had to find some maths to encode the sensor values into two different CCs - one coarse value and one fine value. The maths are like this (Arduino code):

ScaledValCoarse = ScaledVal/64;
ScaledValFine = ScaledVal % ScaledValFine;

Thanks to a scriptlet, I can combine these two messages back into one higher resolution pitch bend message in Gig Performer. It will output the positive half of the pitch bend range, so it’s starting in the center:

var
    PitchCoarse, PitchFine : Integer = 0

On ControlChangeEvent(c : ControlChangeMessage) Matching 14,15
    If GetCCValue(c) == 14 then
        PitchCoarse = GetCCValue(c)
    Else
        PitchFine = GetCCValue(c)
    End
    SendNow(MakePitchBendMessage(PitchCoarse*64+PitchFine+8192))
End

The result: It’s accurate, smooth, and fun… :wink:

By the way: Since I’m running a hot backup, in my case the Arduino is not connected to the Mac directly, but to a rackmount iConnectivity MIDI interface that can attach to my two hosts simultaneously. Apart from that, I don’t trust the Arduino’s micro USB connection on stage, of course. I’m really happy with cheap USB-to-RJ45 adapters so I can use a regular LAN cable between the lever and my rack.

12 Likes

Crazy!! We want a live video demo of this!! :nerd_face: :+1:

2 Likes

1 Like

Very well done … I thought the Arduino was not capable of doing USB MIDI. In the past I have played with DIN5 MIDI, but never made something further than proof of concept.

1 Like

The Arduino Nano or the Pro Micro, for example, can do this.
It’s so easy to convert an external source to MIDI or - the other way round - turn things on and off with MIDI using this 5 € piece.

This is the library I learned how to use:

3 Likes

Thank you very much for this info … I still have Nano’s around I think … now find the time to play with it again :slight_smile:

An excellent Arduino library for building midi controllers is

Makes it almost too simple!

2 Likes

Nice!

Hm, that baffles me. In my mind there’s this notion that you can send any 2 or 3 byte message. I have to look that up. Somewhere I’ve an old nano.

We’d love to see a live video of this.

2 Likes

Just FYI: I checked it out. There is the MIDIUSB library (not to be confused with the USBMIDI library). That one is capable of doing pitch bend:

#include <MIDIUSB.h>

void pitch()
{
  midiEventPacket_t pitchBend = {0x0b, 0xe0 | 0, 0x00, 0x40};
  MidiUSB.sendMIDI(pitchBend);
}

void setup() 
{

}

void loop() 
{
  delay(1000);
  pitch();
  MidiUSB.flush();
}

The nano I have is not capable of doing USB MIDI, so I tried it with a Trinket (M0 SAMD21):

afbeelding

1 Like

As @aharry said. That surface library has pitch bend function.

I used it to built a Bluetooth whammy bar

2 Likes

@npudar & @David-san - I finally had someone film it! :sweat_smile:

(My left hand is not controlling the pitch but the rotation of the camera image on the screen. Since it worked well, I might just as well link that to the pitch bender widget!)
:metal:

8 Likes

Really funny :+1:

1 Like

Tell that someone to record more than 10 seconds!!! :slight_smile:
I like this music. Any chance to release something on YouTube?

LAUSBUAM - Niemals in New York

Und nach dem Abendessen sagte er
Lass mich noch eben Zigaretten holen geh′n
Sie rief ihm nach nimm Dir die Schlüssel mit
Ich werd inzwischen nach der Kleinen seh’n

Er zog die Tür zu, ging stumm hinaus
Ins neon-helle Treppenhaus
Es roch nach Bohnerwachs und Spießigkeit.
Und auf der Treppe dachte er, wie wenn das jetzt ein Aufbruch wär
Ich müsste einfach geh′n für alle Zeit
Für alle Zeit…

Ich war noch niemals in New York, ich war noch niemals auf Hawaii
Ging nie durch San Francisco in zerriss’nen Jeans
Ich war noch niemals in New York, ich war noch niemals richtig frei
Einmal verrückt sein und aus allen Zwängen flieh’n.

Und als er draußen auf der Straße stand
Da fiel ihm ein, dass er fast alles bei sich trug
Den Paß, die Euroschecks und etwas Geld
Vielleicht ging heute abend noch ein Flug.

Er könnt′ ein Taxi nehmen dort am Eck oder Autostop und einfach weg
Die Sehnsucht in ihm wurde wieder wach
Noch einmal voll von Träumen sein, sich aus der Enge hier befrei′n
Er dachte über seinen Aufbruch nach, seinen Aufbruch nach…

Ich war noch niemals in New York, ich war noch niemals auf Hawaii
Ging nie durch San Francisco in zerriss’nen Jeans
Ich war noch niemals in New York, ich war noch niemals richtig frei
Einmal verrückt sein und aus allen Zwängen flieh′n.

Dann steckte er die Zigaretten ein
und ging wie selbstverständlich heim
Durchs Treppenhaus mit Bohnerwachs und Spießigkeit
Die Frau rief “Mann,
wo bleibst Du bloß, 'Dalli, Dalli′ geht gleich los”
Sie fragte “War was?” - “Nein, was soll schon sein.”
Ich war noch niemals in New York, ich war noch niemals auf Hawaii
Ging nie durch San Francisco in zerriss’nen Jeans
Ich war noch niemals in New York, ich war noch niemals richtig frei
Einmal verrückt sein und aus allen Zwängen flieh′n.

And after dinner he said
Let me just go and get some cigarettes
She called after him Take the keys with you
I’ll look after the little one in the meantime

He closed the door and went out silently
Into the neon-bright stairwell
It smelled of floor polish and stuffiness.
And on the stairs he thought, as if this were a departure now
I would just have to go for all time
For all time…

I’ve never been to New York, I’ve never been to Hawaii
Never walked through San Francisco in ripped jeans
I’ve never been to New York, I’ve never really been free
To be crazy for once and escape from all constraints.

And as he stood outside on the street
He remembered that he had almost everything with him
The passport, the euro checks and some money
Maybe there was a flight tonight.

He could′ take a cab there on the corner or hitchhike and just leave
The longing in him awoke again
To be full of dreams once again, to free himself from the confines here
He thought about his departure, his departure…

I’ve never been to New York, I’ve never been to Hawaii
Never walked through San Francisco in ripped jeans
I’ve never been to New York, I’ve never really been free
To be crazy for once and escape from all constraints.

Then he pocketed the cigarettes
And went home as a matter of course
Through the stairwell with floor polish and bourgeoisie
The wife shouted “Man,
Where are you, 'Dalli, Dalli′ is about to start”
She asked “Was what?” - “No, what’s the matter.”
I’ve never been to New York, I’ve never been to Hawaii
Never walked through San Francisco in ripped jeans
I’ve never been to New York, I’ve never really been free
To be crazy once and escape from all constraints.

2 Likes

It’s a cover of this:

1 Like

Simply brilliant. This made my day!

Schon als Kind war Flo ein richtiger Lausbua. Als die ersten Handys ins Voralpenland kamen, hat Flo seinen Klassenkameraden die Telefone auf eine fremde Sprache umgestellt, die keiner lesen konnte.

:rofl:

1 Like

You have 3 videos posted on your YT channel, from 9, 6 and 3 years ago. Isn’t about time for another one? :sunglasses: :guitar: :+1:

1 Like

:sweat_smile: You’re absolutely right - a new video is overdue.
But the truth is we’re all “gig performers” - life is live and the videos are for the potential customers to see what they get (or to survive the lockdown).
And to be honest, after the appearance on TV (playback…) there were some people seeing big money coming - but certainly not for the artists… That just didn’t feel right. Since then we know where we belong - on the stage. :metal:t2:

2 Likes

A gigantic pitch bender !!! :slight_smile: They can’t see that every day :sweat_smile:

And the band with positive energy!

Thank you very much @Frank1119 and @Josehdx for pointing that out!

Now that the season has come to an end, I took the bender home to have another look at that.
It turns out that with little programming knowledge I was mistaken by thinking the function “void controlChange…” explained in the library’s manual was a fixed integrated thing. With your examples I realized it’s just a user function that sends out raw midi data. So it was easy to put the coarse and the fine value into this and transmit them as one smooth real pitch bend message.

[Arduino code:]

void pitch(byte channel, byte fine, byte coarse)
{
  midiEventPacket_t pitchBend = {0x0b, 0xE0 | channel, ScaledValFine, ScaledValCoarse};
  MidiUSB.sendMIDI(pitchBend);
  MidiUSB.flush();
}

Since my lever is spring loaded but not centered I need to scale the pitch bend message to control only the positive half of the range which is really easy to do in the widget properties.

I must admit however that it was fun to learn how to cheat by splitting the AD value into two controllers and converting them back into one hi-res message in Gig Performer. :wink:

1 Like