
Count_Tracks = reaper.CountSelectedTracks(0)
if Count_Tracks == 0 then return end
  reaper.Undo_BeginBlock()
  cou2 = reaper.GetNumAudioInputs()
cou3 = 1023
cou4 = 1022
    Media_Track = reaper.GetSelectedTrack(0,0) 
    Input_Mono = reaper.GetMediaTrackInfo_Value( Media_Track, 'I_RECINPUT' )
if      (Input_Mono == cou2 +cou3) then
ZTTCCC = reaper.GetInputChannelName(cou2-cou3)
ZTTCCC2 = reaper.GetInputChannelName(cou2-cou4)
else
ZTT =     Input_Mono+1
    reaper.SetMediaTrackInfo_Value( Media_Track, 'I_RECINPUT' ,ZTT)
ZTTCCC = reaper.GetInputChannelName(ZTT-cou3-1)
ZTTCCC2 = reaper.GetInputChannelName(ZTT-cou4-1)

end
  reaper.Undo_EndBlock("choose next stereo input", -1)
reaper.osara_outputMessage(ZTTCCC .. "/" .. ZTTCCC2)