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

Reply
 
Thread Tools Display Modes
Old 03-17-2019, 10:33 AM   #1
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default Insert new empty track.lua [LUCKY LUKE thanks to J Reverb]

Its purpose is being independent from your default setting for creating a new track, this should always create an empty new track, no matter what is your default setting. It seems there is no such action or lua yet. Thus mentioning it here, as a new idea. To be developed, by whom, time will tell.

Last edited by TonE; 03-18-2019 at 09:08 AM.
TonE is offline   Reply With Quote
Old 03-17-2019, 11:47 AM   #2
J Reverb
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,071
Default

This is about as empty as it gets...

default=0 (empty)
default=1 (with default settings)

Code:
default=0

function insert_empty_track()

      local SelTrack = reaper.GetSelectedTrack(0,0)
      local tr_num = reaper.GetMediaTrackInfo_Value(SelTrack, 'IP_TRACKNUMBER')
        reaper.InsertTrackAtIndex(tr_num, default)
  end
  
insert_empty_track()
It's a good place to start if your learning LUA ...
J Reverb is offline   Reply With Quote
Old 03-17-2019, 12:07 PM   #3
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Thanks, ah, this line 17 in me2beats_Create child track.lua was causing the problem then.
PHP Code:
r.InsertTrackAtIndex(num,1
So I need to use its 0 variant in my new folderify then, to make it independent of new track settings.
TonE is offline   Reply With Quote
Old 03-17-2019, 12:19 PM   #4
J Reverb
Human being with feelings
 
Join Date: Jul 2009
Posts: 1,071
Default

Yes that's for default settings

reaper.InsertTrackAtIndex(integer idx, boolean wantDefaults)
inserts a track at idx,of course this will be clamped to 0..GetNumTracks(). wantDefaults=TRUE for default envelopes/FX,otherwise no enabled fx/env
J Reverb is offline   Reply With Quote
Old 03-17-2019, 12:21 PM   #5
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Thanks, anyway, my new folderify is here: https://forum.cockos.com/showpost.ph...94&postcount=2
TonE 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 01:13 PM.


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