GR-55 - Modeling sound PitchBend by MIDI CC# ?

Started by Gaustu, November 21, 2017, 06:21:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gaustu

Hi
I think this will be just for a little information.
I am not sure if this problem was not discussed, but I didn't find.

Lets say, I need to have an additional control of PitchBand of modeling sound with external control mounted onboard my guitar (will show this mod later).
So I go to assign page and make setting there. For instance, Expression pedal is set for bending down -12 and external controller is set for bending up +12.

For the first look external CC works ok, as same as onboard exp pedal...
But if to listen carefully you'll hear some abrupt jump when move controller from the zero position forward of very first angle. It's like the first semitone does not go to next semitone by every cent but very rough. Anyway, we hear this step jump and nothing similar with expression pedal.
We can hear something similar with exp pedal if set the range of data much less then 0 - 127.

I am afraid I can do nothing to fix that. Seems this concerned of some internal shortcoming of design CC parameters in GR55.
I tried to use different types of pots - linear, log, no luck.

But there is one trick which makes thing working almost fine. If to set your external controller to be working in middle position=0 (opposite to work in side position=0) -- there is not such issue.
Parker PDF85 modified: Sustainiac, SD TB-4, Piezo Hexpander 13 pin out.
GR-55 mod with 13 din thru, 6 analog outputs D-Sub => Presonus FS Mobile  8 analog inputs.
NI Reactor matchHEX Guitar Framer Ensemble custom.

admin

#1
QuoteFor the first look external CC works ok, as same as onboard exp pedal...
But if to listen carefully you'll hear some abrupt jump when move controller from the zero position forward of very first angle. It's like the first semitone does not go to next semitone by every cent but very rough. Anyway, we hear this step jump and nothing similar with expression pedal.
We can hear something similar with exp pedal if set the range of data much less then 0 - 127.

That abrupt change is because MIDI CC messages are only 7 bits - without the precision of a genuine MIDI Pitch bend messages which  are 14 bit double precision ( as detailed in the the MIDI Specification
http://sites.uci.edu/camp2014/2014/04/30/managing-midi-pitchbend-messages/
QuoteManaging MIDI pitchbend messages
Posted on April 30, 2014 by Christopher Dobrian
When designing a synthesizer or a sampler, how should you interpret MIDI pitchbend messages so that they'll have the desired effect on your sound? First let's review a few truisms about MIDI pitchbend messages.

1. A pitchbend message consists of three bytes: the status byte (which says "I'm a pitchbend message," and which also tells what MIDI channel the message is on), the least significant data byte (you can think of this as the fine resolution information, because it contains the 7 least significant bits of the bend value), and the most significant data byte (you can think of this as the coarse resolution information, because it contains the 7 most significant bits of the bend value).

2. Some devices ignore the least significant byte (LSB), simply setting it to 0, and use only the most significant byte (MSB). To do so means having only 128 gradations of bend information (values 0-127 in the MSB). In your synthesizer there's really no reason to ignore the LSB. If it's always 0, you'll still have 128 equally spaced values, based on the MSB alone.

3. Remember that all MIDI data bytes have their first (most significant) bit clear (0), so it's really only the other 7 bits that contain useful information. Thus each data byte has a useful range from 0 to 127. In the pitchbend message, we combine the two bytes (the LSB and the MSB) to make a single 14-bit value that has a range from 0 to 16,383. We do that by bit-shifting the MSB 7 bits to the left and combining that with the LSB using a bitwise OR operation (or by addition). So, for example, if we receive a MIDI message "224 120 95" that means "pitchbend on channel 1 with a coarse setting of 95 and a fine resolution of 120 (i.e., 120/128 of the way from 95 to 96)". If we bit-shift 95 (binary 1011111) to the left by 7 bits we get 12,160 (binary 10111110000000), and if we then combine that with the LSB value 120 (binary 1111000) by a bitwise OR or by addition, we get 12,280 (binary 10111111111000).

4. The MIDI protocol specifies that a pitchbend value of 8192 (MSB of 64 and LSB of 0) means no bend. Thus, on the scale from 0 to 16,383, a value of 0 means maximum downward bend, 8,192 means no bend, and 16,383 means maximum upward bend. Almost all pitchbend wheels on MIDI controllers use a spring mechanism that has the dual function of a) providing tactile resistance feedback as one moves the wheel away from its centered position and b) snapping the wheel quickly back to its centered position when it's not being manipulated.

5. The amount of alteration in pitch caused by the pitchbend value is determined by the receiving device (i.e., the synthesizer or sampler). A standard setting is variation by + or – 2 semitones. (For example, the note C could be bent as low as Bb or as high as D.) Most synthesizers provide some way (often buried rather deep in some submenu of its user interface) to change the range of pitchbend to be + or – some other number of semitones.

So, to manage the pitchbend data and use it to alter the pitch of a tone in a synthesizer we need to do the following steps.
1. Combine the MSB and LSB to get a 14-bit value.
2. Map that value (which will be in the range 0 to 16,383) to reside in the range -1 to 1.
3. Multiply that by the number of semitones in the ± bend range.
4. Divide that by 12 (the number of equal-tempered semitones in an octave) and use the result as the exponent of 2 to get the pitchbend factor (the value by which we will multiply the base frequency of the tone or the playback rate of the sample).

A pitchbend value of 8,192 (MSB 64 and LSB 0) will mean 0 bend, producing a pitchbend factor of 2(0/12) which is 1; multiplying by that factor will cause no change in frequency. Using the example message from above, a pitchbend of 12,280 will be an upward bend of 4,088/8191=0.499. That is, 12,280 is 4,088 greater than 8,192, so it's about 0.499 of the way from no bend (8,192) to maximum upward bend (16,383). Thus, if we assume a pitchbend range setting of ± 2 semitones, the amount of pitch bend would be about 0.998 semitones, so the frequency scaling factor will be 2(0.998/12), which is about 1.059. You would multiply that factor by the fundamental frequency of the tone being produced by your synthesizer to get the instantaneous frequency of the note. Or, if you're making a sampling synthesizer, you would use that factor to alter the desired playback rate of the sample.


MIDI Reference
https://www.vguitarforums.com/smf/index.php?topic=2977.0

admin

#2
search on DIY Pitch Bend Controller yields this Teensy CPU based version as a reference : ( Poor mans Virtual Jeff)




https://www.untergeek.de/2017/09/v2-0-a-teensy-based-midi-controller/

V2.0: A Teensy-based MIDI Controller
Veröffentlicht am Donnerstag, 14. September 2017 von untergeek

Building my own Pitch / Mod wheels for the Launchpad Pro – once again, with style.



Two weeks ago, I started a little sunday afternoon project, sucessfully building my first own MIDI controller – a pitch bend/mod wheel/midi merge device to serve as a companion to my new Launchpad Pro. Using an Arduino, a prototyping board by SparkFun, and community-made code, I succeeded with surprisingly little effort – the most time-consuming part was finding and fixing the errors I had clumsily soldered into my pathetic excuse for a MIDI interface. But it worked!

Launchpad Companion Controller in actionAs they say, the worst thing that can happen is that you succeed. The quick and easy success made me hungry for more – I started a MIDIfication project for my JEN SX-1000 monophonic synth, based on a Teensy, another microcontroller board that can be used within the Arduino development eco-system but is much better suited to MIDI/USB applications.

[(-)]
1 V2.0: A Teensy-based MIDI controller
1.1 It's surprisingly hard to get Pitch Bend/Mod wheels
1.2 Teensy 3.2, its contacts, and its levels
1.3 The MIDI board
1.4 Connecting the display
1.5 Adapting the Software
1.5.1 Verwandte Artikel:
V2.0: A Teensy-based MIDI controller

This is actually a side project to that. I looked at my self-made controller and noticed that it is usable but not very playable – I wanted real wheels for the Launchpad, not sliders. So I decided to redo a V2.0 of the controller, based on the Teensy.

The task was: Get controller wheels, wire them to a Teensy, provide it with MIDI In/Out and USB, wire it up to a small display and a couple of buttons for fun, adapt the software, and build it into a housing. All in all, it took about two working days to complete – a lot more than I (and my family) was originally prepared to sacrifice. But there you go – nothing as dangerous as success.

You can find the code, and the schematic, in this Github repository.

It's surprisingly hard to get Pitch Bend/Mod wheels

My first discovery was that wheels are surprisingly hard to get. Although I looked hard, I found no shop where you can order them as DIY parts, apart from Doepfer who are running out of stock. You can order spare parts for existing synths, but they are expensive and won't fit well. In the end, I got an old wheel box from eBay, just like the ones Doepfer no longer has on stock but seemingly from an old Wersi organ. (Hang on: An organ – with mod wheels??? Never mind.)

Wheelbox, buttons, display showing

This wheelbox has found a home in a rather unassuming blue housing for now, together with the microcontroller, the MIDI board, two buttons with LEDs, and an OLED display.

Teensy 3.2, its contacts, and its levels

The second issue was that the chip on the Teensy works with a 3.3V supply voltage rather than with the 5V I was used to. This is no big issue for this project, although it will be for the JEN SX-1000 project mentioned above.


To interface the Teensy, I soldered it to a breadboard with pinstripe connectors, quite simple and with much less wiring as it would seem from the breadboard wiring schematic above. The OLED display takes 5V supply voltage, wheel pots and MIDI interface circuitry are supplied with 3.3V. The MIDI interface is built to a small daughter board.

The MIDI board

As mentioned above, the Teensy has a working voltage of 3.3V. This calls for a slight adaptation of the standard MIDI circuitry dutifully described on the Teensy page, namely: using smaller resistors for wiring MIDI Out to the TX0 output pin. I used a 4N28 optocoupler I had in my cupboards but all in all this is the very same MIDI circuitry you'll find in a thousand Arduino tutorials.


Connecting the display

I used an OLED display by Chinese manufacturer Heltec that I found on Amazon. These displays are cute. They are as small as 25mm, and as they are controlled via a two-wire I2C interface, soldering to the Teensy/Arduino is done in no time. There is the standard Wire library for using the I2C interface with an Arduino, and there are a couple of OLED libraries around. I could only get the Adafruit SSD1306 library to work – the SSD1306 is the controller chip in the display – as, for example, the universal U8GLIB library seems to miss one important command for switching on the capacitor charge pump to convert 5V to the ~11V the OLED needs. I did not dive deeper.

Even the Adafruit library needs redefining to work with a 128×64 display (it is configured for 128×32 by default) but I ended up using a simpler library in the end – I felt that the Adafruit lib is very large, I felt obliged not to use it without a display bought from Adafruit, and I did not like the font. So I ended up using and adapting the OLED library by Deloarts that offers a simple, clean way of displaying an 8×8 font.

Of course, 8×8 is too small. Of course, displaying it with double the size looks bad. Of course, you could load a bigger font as well – which would use up precious memory (not that that is an issue here). Somehow, I got stuck with the idea of using the 8×8 font and enlarging it with an algorithm designed for just that – taking very coarse pixel grids, enlarge and smooth them. Voilá: enter Scale2x.



Adapting the Software

This is, sadly, where I spent most of the time I used for building this.

Scale2/Scale3x is an old algorithm designed for the MAME emulator, to display 8-bit games on much bigger screens. It has its own homepage. It tries to predict where lines and curves would be to add pixels for smoothing edges. As far as I can see, it is terribly outdated – algorithms like hq3x would probably be better – but it is simple enough that I could adapt it for the OLED library. You can find my fork of the library here. Apart from the scale2x/3x characters, the original code has also gained 8-bit support for extended charsets with Umlauts (using the CP437 code-page you know from MS-DOS right now, aiming for CP1252/ISO-8859-15 later), inverted characters, and a simple routine to print signed 8-bit values (which is useful for a MIDI controller). I did NOT add a proper println() routine – my understanding of C++ ends with overloading and inheritance – so there is work to do.

Compared with the first it

-----



Many more Strategies  here
https://www.google.com/search?biw=1187&bih=688&tbm=isch&sa=1&ei=qjkUWryHMaSh0wKm0JnwDw&q=DIY+Teensy++MIDI+Pitch+bend&oq=DIY+Teensy++MIDI+Pitch+bend&gs_l=psy-ab.3...89618.100488.0.101984.12.12.0.0.0.0.491.1829.0j9j4-1.10.0....0...1c.1.64.psy-ab..2.1.491...0j0i24k1.0.fANWKk1bHIk#imgrc=EJED25uaYA_p3M:



admin




http://www.markwingfield.com/gear/

And there is the VMETER MIDI CONTROLLER used by Mark Wingfield

QuoteI have a V-Meter touch strip which controls numerous parameters in MainStage on the laptop. I have a sustainer by Sustainiac which takes the signal from the bridge pickup and uses that to magnetically sustain the strings. This produces infinite sustain even acoustically without the guitar plugged in. There is a Fishman Tripleplay synth pickup which I use to trigger synths and samplers on the laptop. The synths are generally used for chords rather than lead. Finally there is a GK-2 which I use purely for the audio signals to the VG-88.

Gaustu

Thank you admsustainiac for your help. Lot of info, will read it and think what can do  ::)
What is coming to mind first as one idea is to make an additional selector inside GR to switch exp pedal wires to the external pot
Parker PDF85 modified: Sustainiac, SD TB-4, Piezo Hexpander 13 pin out.
GR-55 mod with 13 din thru, 6 analog outputs D-Sub => Presonus FS Mobile  8 analog inputs.
NI Reactor matchHEX Guitar Framer Ensemble custom.