Jump to content

MIDI Pitch Bending the microKorg with Atari BASIC



The microKorg was plugged into the MIDIMAX. Then a few simple Atari BASIC programs to control the Pitch Bend Wheel were written for no other reason then I hadn't done it before.  A couple of ideas did present themselves as the programs were written. As always, my list of possible projects increases.

 

For many of the adjustable parameters of a synthisizer, the Control Change command (176+channel # -1), Control number (0-127), followed by the set point value (0-127) was adequate.  The Pitch Bend wheel was an exception. An exception that was deemed important enough to get its own command code.

 

This pitch bend command number (224+channel #-1) and a 14bit number split between 2 - 8bit words makes it possible to divide the Pitch Bend Range into 16384 (0-16383) increments.  When the pitch bend wheel is in the center position, the value will be 1892. The value will be sent in low bit - high bit order.

 

Convert a 14-bit Value to 2 - 8-bit bytes
X=Value (0-16833)
Most Significant 7 Bit=INT(X/128)
Least Significant 7 bits=X-MSB*128

 

This article gives a much more detailed explanation of pitch bending, 

Managing MIDI Pitchbend Messages
 <https://sites.uci.edu/camp2014/2014/04/30/managing-midi-pitchbend-messages/> 

 

On the microKorg the pitch bend range can be set between 0 and 12 semitones. Set the edit knob to PITCH and adjust dial 4. A negative range changes the direction of rotation.

 

All synthesizers are not created equal and you may want to consult the manuals. These simple programs should work if yours will accept the Pitch Bend command. The first is the complete program and the other two replace lines  100 - 299970.

 

The programs are in the single density ATR along with the M: driver(autorun.sys) and Dos 2.5.
".BTX" are BASIC TEXT files.microKorg pitch bend.atr

 

Let me know if you come up with any algorithms I might like to try. 


PBRND.BAS
1 REM microKORG PITCH BEND WHEEL
2 REM RANDOM POSITION
3 REM by Kevin Packard 4/2022
5 REM 
100 GOSUB 30000:REM set up variables
200 REM start of main loop
210 REM RANDOM SETTING
220 B=(INT(RND(0)*127)):REM WHEEL SETTING
225 C=(INT(RND(0)*127)):REM WHEEL SETTING
230 PUT #1,A:PUT #1,B:PUT #1,C
240 FOR W=1 TO 20:NEXT W:REM WAIT
250 GOTO 220
29997 STOP 
29998 REM *************
29999 REM set up
30000 REM 
30010 CHANNEL=1:REM MIDI CHANNEL
30020 A=(224+CHANNEL-1):REM MIDI COMMAND BIT
30030 B=0:REM LOW 7 BITS
30040 C=0:REM HIGH 7 BITS
32000 REM OPEN MIDI PORT
32010 CLOSE #1
32020 OPEN #1,13,0,"M:"
32030 XIO 40,#1,0,0,"M:"
32040 RETURN 


PBLOWHI1.BAS
1 REM microKORG PITCH BEND WHEEL
2 REM LOW TO HIGH - SINGLE LOOP
100 GOSUB 30000:REM set up variables
200 REM start of main loop
210 REM 
220 FOR X=0 TO 16383 STEP 30
225 C=INT(X/128):B=X-C*128
230 PUT #1,A:PUT #1,B:PUT #1,C
235 NEXT X
240 REM FOR W=1 TO 20:NEXT W:REM WAIT
250 GOTO 220
29997 STOP 


PBSIN.BAS
1 REM microKORG PITCH BEND WHEEL
2 REM LOW TO HIGH - SINE WAVE
100 GOSUB 30000:REM set up variables
200 REM start of main loop
210 DEG 
220 FOR X=0 TO 359 STEP 10
222 Y=8192+INT(SIN(X)*8192)
225 C=INT(Y/128):B=Y-C*128
230 PUT #1,A:PUT #1,B:PUT #1,C
235 NEXT X
240 REM FOR W=1 TO 20:NEXT W:REM WAIT
250 GOTO 220
29997 STOP 

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...