Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 05-08-2021, 05:00 PM   #1
Kaxaze music
Human being with feelings
 
Kaxaze music's Avatar
 
Join Date: Sep 2020
Location: India
Posts: 283
Default How to identify if select track rec input is midi or audio

i have read the "I_RECINPUT" command of Getmediatrackinfo_value. But i didn't understood the meaning of 4096. I just wanted to know which value means the track have a midi input selected or audio ... or none ...
Kaxaze music is offline   Reply With Quote
Old 05-08-2021, 07:49 PM   #2
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Code:
function Msg(value)
  reaper.ShowConsoleMsg(tostring(value).."\n")
end


sel_track = reaper.GetSelectedTrack2( 0, 0, false )

if sel_track then

  track_rec = reaper.GetMediaTrackInfo_Value(sel_track, "I_RECINPUT")
  
  if track_rec then
    Msg("I_RECINPUT= "..track_rec)
  end
  
end

--[[
I_RECINPUT : int * : record input, <0=no input. 
if 4096 set, input is MIDI and low 5 bits represent channel (0=all, 1-16=only chan),
next 6 bits represent physical input (63=all, 62=VKB). 
If 4096 is not set, 
low 10 bits (0..1023) are input start channel (ReaRoute/Loopback start at 512). 
If 2048 is set, input is multichannel input (using track channel count), 
or if 1024 is set, input is stereo input, otherwise input is mono.
--]]
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:03 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.