max v2; #N vpatcher 278 66 782 393; #P comment 86 292 78 196622 frequency; #P comment 12 34 121 196622 MIDI key number; #N comlet (float) frequency; #P outlet 71 294 15 0; #P button 106 222 15 0; #P newex 60 129 39 196622 mtof; #P number 73 83 51 14 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P flonum 71 165 56 14 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 152 83 51 14 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 71 250 80 196622 * 1.; #N comlet (int) MIDI pitchbend; #P inlet 141 56 15 0; #N comlet (int) MID key number; #P inlet 60 54 15 0; #P newex 205 147 205 196622 expr pow(2.\\\,($i1-64)/378.); #P newex 141 182 205 196622 expr pow(2.\\\,($i1-64)/384.); #P newex 141 109 74 196622 split 0 63; #P comment 215 109 255 196622 Convert pitchbend value 0-127 into a frequency factor ±2 semitones; #P comment 136 35 109 196622 MIDI pitchbend; #P connect 5 0 11 0; #P connect 11 0 9 0; #P connect 12 0 7 0; #P connect 9 0 7 0; #P connect 7 0 13 0; #P connect 5 0 10 0; #P connect 4 0 12 0; #P connect 3 0 12 0; #P connect 6 0 2 0; #P connect 2 0 3 0; #P connect 3 0 7 1; #P fasten 4 0 7 1 210 175 350 175 350 212 146 212; #P connect 6 0 8 0; #P connect 2 1 4 0; #P pop;