2

It seems that Pd has only a global MIDI pitch bend control. How can I send different pitch bend events for individual notes?

In Pd extended I made a simple patch that reads from MIDI in and writes the same note to MIDI out. Now I would like to change the pitch bend event individually for every incoming note according to a look up table, so the MIDI out note is bent differently depending on the MIDI in note.

Any ideas?

Max N
  • 1,134
  • 11
  • 23
xaratustra
  • 647
  • 1
  • 14
  • 28

4 Answers4

5

Pitch bend is a channel voice message meaning that it applies to the entire channel thus there is no direct way to do what you want. The only possible solution is pretty indirect and it would be using multiple channels, each configured to play the same sound then splitting the incoming notes among them such that only one note was playing at a time on each channel. A classic example of this approach is a MIDI pickup for a guitar - the ones with a pickup for each string. They assign each pickup to a discreet MIDI channel and then they can map string bends to pitch bends for the individual strings (sometimes poorly).

jaket
  • 9,140
  • 2
  • 25
  • 44
3

It's a limitation of the MIDI protocol, depending on what you want to do, you might want to look into OSC (OpenSoundControl), HD-MIDI or simply FUDI.

Max N
  • 1,134
  • 11
  • 23
2

so it seems that you are aware of the limitations of MIDI (only a single pitch-bend parameter per channel), but would like to shape the pitchbend value individually for each note.

assume you have created 128 tables (named "bend1" .. "bend128"), each 16383 values long, containing a lookup table to convert between input pitchbend values (-8192..+8192) and output pitchbend values (from -1..+1), then you could do something like:

[notein                        1]
|                               |
[t b f]                         |
|     +---------+               |
|               |               |
|  [bendin 1]   |               |
|  |            |               |
[f ]            [t f         f] |
|               |             | |
[+ 8192]        [set array$1( | |
| ______________+             | |
|/                           /  |
[tabread]                   /   |
|                          /    |
[* 12]                    /     |
|                        /      |
[+                      ]       |
|                               |
[noteout                       1]

this will modify each MIDI-note based on an individually shaped pitch-bend value. the main drawback is, that [noteout] will send MIDI-notes (which due to the limitations of MIDI can only be integer values), so the output will be quantized to semi-tones :-(

however, if you are doing the synth within Pd, then you can use fractal note-values: just send them to [mtof] to get a frequency from the MIDI-notenumber and send it to your favourite [osc~].

umläute
  • 28,885
  • 9
  • 68
  • 122
  • that's cool! It seems that this would be the only solution left, using `notein` but then use the `osc` for the sound, although . But can you please explain what the `array` block does? – xaratustra Sep 26 '15 at 20:01
  • [osc~] was just a silly example on how to easily generate sound; Pd is really good on building synths, so you should substitute [osc~] with your own fancy sound generator. – umläute Sep 27 '15 at 19:46
  • @xaratustra, what do you mean by "array block"? – umläute Sep 27 '15 at 19:46
  • I am sorry, I am a bit of a noob in Pd :-( I have written very simple patches up to now. In the diagram above what does `set array$1` do? btw. I am actually not interested in input pitch bend values, only output pitch. Using the `mtof` solution as you suggested, the whole thing reduces to a lookup table between `midi in` notes and modified frequencies... – xaratustra Sep 27 '15 at 20:16
  • a message `[set foo(` to `[tabread]` will simply change the table to be read; my patch uses it, to acess a different pitch-bend lookup table for each note – umläute Sep 27 '15 at 22:14
0

With pure data, you can work around this by using a midi CC to do real time pitch shifting instead or assign "note aftertouch" for this purpose.

PlateReverb
  • 654
  • 1
  • 7
  • 21