Reaper Track Colors.

Discussion in 'Reaper' started by justsomerandomdude, Mar 16, 2022.

  1. justsomerandomdude

    justsomerandomdude Rock Star

    Joined:
    Aug 24, 2020
    Messages:
    491
    Likes Received:
    325
    Hi everyone.
    Are there any scripts to assign automatic track color. i.e. when i input a track name eg. Drums it assigns a color to that track. I could search my self, but i want to ask experts here, where better to ask than here. Also i trust answers from here, and i like it here, ppl helping each other wholeheartedly.
    Thank you in advance.
     
  2.  
  3. Friendelek

    Friendelek Platinum Record

    Joined:
    Nov 28, 2020
    Messages:
    223
    Likes Received:
    155
    Yes. SWS Extensions - Auto Color
     
    • Like Like x 4
    • Agree Agree x 2
    • List
  4. bigboobs

    bigboobs Kapellmeister

    Joined:
    Oct 10, 2011
    Messages:
    333
    Likes Received:
    58
    • Like Like x 3
    • Useful Useful x 1
    • List
  5. justsomerandomdude

    justsomerandomdude Rock Star

    Joined:
    Aug 24, 2020
    Messages:
    491
    Likes Received:
    325
    Thanks dudes I checked it, it works, but are there any easier way to add or maybe import pre-written rules
     
  6. naitguy

    naitguy Audiosexual

    Joined:
    Jan 9, 2017
    Messages:
    789
    Likes Received:
    558
    Location:
    Canada
    Same thing.. SWS auto color.. you set up the rules in Extensions->Auto Color/Icon/Layout.

    Ex., I have some stuff named (something) Bus that automatically colors my bus tracks a certain way.

    There's a good script too that works with that even will gradient child tracks for you when run (I assign it to a button). I'll see if I can find it.

    Original thread: https://forum.cockos.com/showthread.php?t=191502&highlight=color+gradient

    Code:
    ----------------ICIO POULHOI - Set Color Gradient to Children tracks starting from parent color---------v1.2------
    ----------------?:^) written by 80icio & poulhoi -----------------------------------------------------------------
    ---------------- sws extensions needed!!!!------------------------------------------------------------------------
    local selchildren = reaper.NamedCommandLookup("_SWS_SELCHILDREN")
    local colchildren = reaper.NamedCommandLookup("_SWS_COLCHILDREN")
    local itemtotrkcolor = reaper.NamedCommandLookup("_SWS_ITEMTRKCOL")
    ---Gradient Step ---- positive numbers will gradient to white // negative numbers will gradient to black
    local gradientstep = -15 ---- 0 = no gradient
    local coloritem = true -----if true = force to color items/takes with track color
    local trktbl = {}
    function getseltracktable()
      local trackCount = reaper.CountSelectedTracks(0)
      if trackCount ~= 0 then
        for i = 1, trackCount, 1 do
        trktbl[i] = reaper.GetSelectedTrack(0, i-1)
        end
      end
    end
    function seltracktable()
        for i = 1, #trktbl, 1 do
        reaper.SetTrackSelected( trktbl[i], true )
        end
    end
    function main()
    reaper.Main_OnCommandEx(colchildren, 0, 0)
    reaper.Main_OnCommandEx(selchildren, 0, 0)
    local trackCount = reaper.CountSelectedTracks(0)
    local gradientstep =  math.ceil((gradientstep*10)/(trackCount+1)) ----dependent on track count
     for i = 0, trackCount - 2, 1 do
        local track = reaper.GetSelectedTrack(0, i)
        local nexttrack = reaper.GetSelectedTrack(0, i+1)
        local prevColorNative = reaper.GetTrackColor(track)
        local prevColorR, prevColorG, prevColorB = reaper.ColorFromNative(prevColorNative)
        if prevColorR + gradientstep < 0 then prevColorR = 0 else prevColorR = prevColorR + gradientstep end
        if prevColorG + gradientstep < 0 then prevColorG = 0 else prevColorG = prevColorG + gradientstep end
        if prevColorB + gradientstep < 0 then prevColorB = 0 else prevColorB = prevColorB + gradientstep end
        local newColorR = math.min(prevColorR, 255)
        local newColorG = math.min(prevColorG, 255)
        local newColorB = math.min(prevColorB, 255)
        local newColorNative = reaper.ColorToNative(newColorR, newColorG, newColorB)
        reaper.SetTrackColor(nexttrack, newColorNative)
           if coloritem == true then
              reaper.Main_OnCommandEx(40421, 0, 0)
              reaper.Main_OnCommandEx(itemtotrkcolor, 0, 0)
          end
      end
    end
    reaper.Undo_BeginBlock()
    reaper.PreventUIRefresh(1)
    getseltracktable()
    if #trktbl ~=0 then
    for c = 1, #trktbl, 1 do
    reaper.Main_OnCommandEx(40289, 0, 0)
    reaper.Main_OnCommandEx(40769, 0, 0)
    reaper.SetTrackSelected( trktbl[c], true )
    main()
    end
    reaper.Main_OnCommandEx(40769, 0, 0)
    seltracktable()
    end
    reaper.PreventUIRefresh(-1)
    reaper.Undo_EndBlock( "folder Color Gradient", 0)
    
    There's the script... so what I'll do, personally, is bus tracks together.. the bus will automatically color per rules set in the Auto color options... and for the child tracks, I have an button I click that runs this script.. select the buses you want, hit that button, and it will color child tracks below it using the same color, but gradually darken the color, IIRC
     
    Last edited: Mar 16, 2022
    • Like Like x 2
    • Interesting Interesting x 1
    • List
  7. Friendelek

    Friendelek Platinum Record

    Joined:
    Nov 28, 2020
    Messages:
    223
    Likes Received:
    155
    Magic is not available in current Reaper version. Try to future request it at forum.
     
  8. justsomerandomdude

    justsomerandomdude Rock Star

    Joined:
    Aug 24, 2020
    Messages:
    491
    Likes Received:
    325
    Thank u for link..
     
  9. justsomerandomdude

    justsomerandomdude Rock Star

    Joined:
    Aug 24, 2020
    Messages:
    491
    Likes Received:
    325
    @naitguy updated Reapack, checked under action list, and there was the script installed.
     
  10. Zenarcist

    Zenarcist Audiosexual

    Joined:
    Jan 1, 2012
    Messages:
    4,252
    Likes Received:
    2,728
    Location:
    Planet Earth
    I find it easier to work with templates, i.e. 8 group busses and each has it's own color scheme, e.g red for guitars, pink for synths, blue for bass, etc. The advantage is you always know where everything is with each project.
     
    Last edited: Mar 17, 2022
Loading...
Loading...