Saturday, February 16, 2013

Current Crufty Midi Theme

Current state of crufty "midi" oriented theme

Full view
When track panel is wide enough, it shows patch selection parameters, various common midi items (envelope / cc automation etc) --  got rid of all the audio nonsense (see track 1).  I put all the buttons on the left so they are in a "common" spot, regardless of the width of the track panel.

Condensed view 
When the track view is narrow enough, we hide more of the buttons--unless the track is tall enough to include a narrow row.





Narrow View
When the track is very narrow--we display ONLY the label.  I would like to get the label to render vertically (like the moog)...but so far, no luck!

Theme is getting closer to completion...next up! button bars.


Saturday, February 2, 2013

Crufty_Midi: A midi specific mod to the Default Reaper Theme

In the previous post, I setup a a custom "crufty_midi" theme for me to use in Reaper.

Theming in Reaper is fairly straightforward; I'll edit a text file "crufty_midi.ReaperTheme" first and connect to our custom images folder--just in case.  Then i'll edit an "rtconfig.txt" file and add a custom track layout for myself (We still have the unchanged, default theme present in case I goof up).

I'll select my theme from inside Reaper, and each time I make edits, reselect.

The engine that Reaper uses for theming is called "WALTER".  Anytime we see "WALTER" in the context of Reaper, we should think of this "crufty_midi.ReaperTheme" text file, and any associated images/files.

1. Getting started: essential WALTER Links

White Tie "Themer's Guide "Tutorial

A Reaper user has posted an awesome tutorial for WALTER theming...read this first!  This http://www.houseofwhitetie.com/reaper/walter_themers_guide.pdf

Official WALTER syntax

The Reaper www site has the official WALTER syntax:
http://www.reaper.fm/sdk/walter/walter.php

Official WALTER Forum

The Reaper forums are very friendly and a great resource:
http://forum.cockos.com/forumdisplay.php?f=26

I won't be covering WALTER 101 stuff--the above links will be way more up to date.

2.  Open crufty_midi.ReaperTheme

Very few edits will be made to the .Re
First, we navigate to the ColorThemes folder and double click on crufty_midi.ReaperTheme

If this is the first time we are trying to open a ReaperTheme file, OSX may not know what to do with it.  I use the TextEditor because I too lazy to install a "better" editor, though I am sure there are better options.


2.  Set ui_img to "crufty_midi"

I find the setting for "ui_img" and ensure it knows about our image subfolder. Not sure if this is strictly necessary:

ui_img=crufty_midi

I save--and quit.   This is edit for edits to the crufty_midi.ReaperTheme file!

3. Open up rt_config.txt

Next, I descend into the crufty_midi subfolder and double click on the rt_config.txt file.  This will open the "WALTER" syntax file in TextEdit, and allow me to make mods in ernest!




Again--I'm sure there are 'better' text editors...this is just what i use.

A. Add a crufty_midi layout

Inside of  rt_config.txt there are a whole host of options, settings, and finite-state-machine flotsam and jetsam.  If the rt_config.txt seems alien at first--do not despair!  We can compartmentalize our mod almost entirely, so that we gain all the benefit of our default theme, and don't have to learn the WALTER syntax to the n'th degree.

First, we go and find where the walter init ends and the CockOs default theme begins.

Next, we add our little crufty_midi track layout.


I save. As long as I keep all my mods in between the comments 'Crufty Begin' / 'Crufy End' have a very simple way to 'upgrade' my mod with new themes as they come out.


B. Basic Theme Desires

Rather then go into the syntax of the crufty_midi theme--I'll post the actual theme on the Reaper stash (a place for files to be shared with the rest of the reaper community) so folks can download and inspect as they desire.

Instead, I'll talk about what I want from my theme:

First, the default theme is "too bulky". 

For Midi oriented tracks, I need only Mute, Solo, FX (for vst controls) and envelopes.  I also need VST "FX" parameters, so that I can pick patches directly from the track itself.   I don't need any i/o, volume, pan, or 'audio' related misc stuff.  These can all be found on the vertical "mixer" layout.   

Next, I want the label last, not first.  I want the buttons all on the left--and the parameters to the right of the label.  I want it all to "shrink" reasonably,  with buttons disappearing as we run out of column space.

I guess a list will help--what is important to display, in order?
  1. Track Number
  2. Folder compress/uncompress
  3. Track Name
  4. Mute & Solo
  5. FX Window & Envelope Display
  6. VST "FX" Parameters (esp important for bank/patch selection via ReaControlMidi)

Hmm..thinking about it, I want everything displayed in a single row when the track height is small.

I never really have tall track heights--but I can see where I might want more horizontal space w/out sacrificing buttons. So if my track height is < 32 pixels, all buttons will be on a single row.  But, if the track height is >32 pixels, I'll want buttons oriented in a 2x2 grid,w/a taller label.

C. Layout Pseudo Code

In my mind, I determine the layout will be structured:
  1. Hide & clear all unused elements (io, vol, pan, etc)
  2. Create positional macros for the buttons (2x2 grid vs single row)
  3. Place track index
  4. Use the height & width of the panel to determine the x, y, w, h of the first four buttons (mute, solo, fx, envelope)
    1. Hide buttons based on panel width
    2. Use panel height to determine grid or row positioning
  5. Next we'll plop the label, using panel width to determine x positioning--the label x will have to shift based on the number of buttons visible
    1. If parameters aren't visible, the label width will have to be longer
  6. Parameters (if there) will be last, and only if there is room.
  7. Finally the folder button.
How will I know where to place eveything?  I basically have two categories of use cases: short (<32 and="" pixels="" tall="">=32 pixels).

Use Cases

In the short category, I'll have three display cases:
  1. Completely minimal--label only
  2. Mute & Solo & Label only, all in a row
  3. Everything

In the tall category, I'll have three equivalent display cases:
  1. Completely minimal--label only
  2. Mute & Solo & Label only, with mute and solo above/below each other
  3. Everything
Ideally it would be cool to generate the positional information programmatically.  However, to do so, we'll need the "-" operator--and walter doesn't know how to subtract. It only knows how to add and multiply.   True, a - b = a + 1 * - b, but this is an extra layer of complexity we don't need.

So instead, I'll use Apple's Numbers spreadsheet to determine the x,y,w,h layout.

4. Numbers

The Numbers document I make will be used to copy and paste widget positions into the rtconfig.txt file.  I'll use the Numbers document to programmatically determine widget layout, vs trying to do it inside rtconfig.txt via Walter--it's just easier for me this way.

Widget Dimensions

First, I create a table "Gui Sizes" of basic dimensional information:

Short 

Next, I create the three uses cases for short -- i want everything in a row. So where will all the widgets go?

Note:

The final "everything" use case table has our panel width--340.  to make our life really easy, I have found it important to make sure all our setups fit within this same width.

So our first two use cases have a gap calculation, which we add to the label width--this makes sure all our panel layouts will have the same dimension.

Tall

Do the same thing for the tall uses cases:

Notice how the X/Y of the 2x2 grid is different.

Summary

In the WALTER logic, I'll need to figure out when to show and hide buttons and where to stick the label--this is different for tall vs short use cases.  So I make a summary table:

finally! Done with the widget positioning.  By using references and various formulas, I can tweak the dimensions, and simplify the walter logic--just need to remember to copy and paste everything :)

The Numbers "tables" used are:


Thats it for now!  In my next post I'll add show how to use the theme and where I'll go from here.

Custom Themes in Reaper, OSX

Custom Themes in Reaper (OSX)

I usually stick with default themes; in my experience, custom themes usually degrade with time...a release comes out, the original developer no longer has time, the audience isn't quite sure how to maintain.

In the case of Reaper, I have found that track layouts are really oriented around sound / recording sound. 

MIDI isn't quite the focus. I don't need inputs, pan, volume, or any of the more recording oriented buttons that one might use.  So I decided to create a mod to the default theme.

Setup:
Non-Retina MacBook Pro (i7)
OSX 10.8 (Mountain Lion)
Reaper 4.32


1. Themes are stored in the Color Themes folder

Open up a finder window, and from your "home" folder, navigate to:
 ~/Library/Application Support/Reaper/ColorThemes


2. Duplicate the default reaper theme

I am opting to use the default theme as the basis for my mod...but really any mod would do.

I select Default_4.0ReaperThemeZip, Copy (⌘C) and Paste  (⌘V).



3. Rename duplicated theme to .zip

Now that we have a copy of the default theme, we need to modify it!  A theme file is just a zip, so we need to unzip.  First, I rename Default_4.0 copy.ReaperThemeZip to crufty_midi_temp.zip



4. Open .zip file, rename & move contents to ColorThemes folder

Once renamed as a zip fie, I double click on the zip file to 'unpack' the theme folder--this will create a crufty_midi_temp folder. 


 Inside the crufty_midi_temp folder, we find the 4.0 theme we're going to use as the basis for our tweaks.



To reduce conflicts--and I'm not sure if this is required,  but its what I did--I rename the Default_4.0_unpacked folder to crufty_midi.  Default_4.0_unpacked.ReaperTheme gets renamed to crufty_midi.ReaperTheme.

Next, I cut (⌘X) both these items, navigate to the parent Color Themes Folder, and paste (⌘V).  I delete the crufty_midi_temp folder, as well as the crufty_midi_temp.zip file--these are no longer needed.

Done! I now have a baseline for any theme mods I need to make!  I can edit crufty_midi.ReaperTheme in TextEdit to my hearts content.