Saturday, February 25, 2012

Model Railroad Progress

It's been a long time since I've made any progress on my model railroad. It has gotten a little scenery work here and there but has been non-operational for at least a year - I have yet to get around to completing the electrical wiring. Today, I finally completed the mechanical work of assembling the operating panel. The next step is break out the soldering iron and put wire to terminal. Here is a mockup of the panel - created in Visio:
Figure 1 - panel mockup

I've also devised a way to use SPDP panel switches for my Atlas twin coil switch machines. The unique thing about this design is the use of bipolar electrolytic capacitors - they're a bit pricey but greatly simplify the the design.

Figure 2 - bipolar capacitive discharge schematic

Wednesday, January 11, 2012

True and False in the C Programming Language

I know, C is dead, right? Not quite. While C has been supplanted in many industries by C++, C#, and other object-oriented languages, much of the automotive industry still relies on plain vanilla C - MISRA C, to be specific. I overheard the following question today: "should TRUE be set to !FALSE or should it be set to 1 - which is more MISRA compliant?" I don't know which is more MISRA compliant (off the top of my head), but I'd like to offer an alternative that, to my thinking, is more type-safe and avoids clashes with the macro definitions provided with many compilers.

Since C does not have native support for a Boolean type, it is common to #define TRUE and FALSE:

#define FALSE 0
#define TRUE !FALSE

FALSE is always zero and true may be any non-zero integer, so it is safest to let the pre-compiler decide what !FALSE means. This is portable but not type-safe; TRUE and FALSE may be compared to a result of any type (leaving the type conversion to the compiler). I like to use a typedef'd enumeration, instead:

typedef enum {eFALSE = 0; eTRUE;} BOOL_t;

Since this is "user defined", it is incompatible with the return type of standard library functions, so they must either be handled in the typical manner or with explicit casts.

Thinking about how to define and use boolean types in C reveals an important lesson about the "safe" use of C. That is: Avoid comparisons to TRUE (or eTRUE or whatever). Since zero will always be "false", comparisons with FALSE will always work.

Tuesday, January 03, 2012

Fitting a Round Peg into a Square Hole

I received an iPod nano for Christmas. It's just what I wanted but I was not looking forward to moving the 400+ albums I had in Windows Media Player - complete with album art - into iTunes. My anxiety was warranted: the result was a disaster. So, I took the opportunity to completely re-rip my entire CD library into iTunes. I chose to keep working with the mp3 format but bumped up the resolution from 128 kbps to 192 kbps. I must say that iTunes seems to do a slightly better job of finding album art than WMP, though I still found many albums for which I had to manually paste an image (either found on the web or scanned from the original).

Wednesday, February 10, 2010

Resurrection?

Wow - over two years since my last post here ... wondering if I really have anything to say. Maybe I'm just a little paranoid about putting myself too "out there" on the Web, afraid to voice a disagreeable opinion or to be judged in an unfavorable light. I've witnessed too many "flame wars" ignited and fueled by thoughtless comments and want no part of that childish game. So it's safer to remain a lurker in the shadows. But - what the hell? - nothing ventured, nothing gained.

Random thoughts for today:

I tried Twitter for a short time. I can see its appeal but I had little to say and became overwhelmed with the influx of short messages from those I was following. Tried TweetDeck to get some sort of grip on the volume but the whole thing just became a time vacuum. So I deleted my account and I haven't missed out on anything important yet.

I do have a presence on LinkedIn. My network isn't that big but the service does keep me connected to my career industry.

I uploaded a bunch of stuff to my photostream on flickr - mostly recent art work from my participation on wetcanvas.com.

The Inter-Urban Industrial has been disassembled and moved twice in the last two years. I need to get some new pictures up on Flickr.

Monday, January 08, 2007

Railroad Update

The pictures are here!

The current state of my small N-gauge empire can be seen here.

Tuesday, February 07, 2006

House of Leaves

I've gotten tied up in reading House of Leaves by Mark Z. Danielewski. What an incredible work of literature! I'm about 3/4 of the way through and I'm thinking I'll have to re-read it immediately to get the full effect; there are so many mysteries.

Anyway, the vocabulary in HoL has been challenging me. Here's a few new words I've learned:
  • sabin
  • aphonia
  • scarification
  • tenebrific
  • tessellated
  • celerity
  • phillumenist
  • prolix
  • exegesis
Go loook them up if you don't already know their meanings.

Wednesday, January 04, 2006

Inter-Urban Industrial Update

The IUI has been downsized to something a little more manageable for my first foray into model railroading since I was a child. My little industrial empire now fits on a two foot by four foot table top. Here's the new plan:


I've left some expansion room to the right side, where the interchange track comes in. Where I intend to place the layout in my basement, I have another seven feet of shelf space about a foot wide. I've elevated the back side about 3/4" from the front to give a little interest to the terrain but the setting is essentially urban. The yard consists of 3 sorting tracks and a RIP track, with an engine terminal off the runaround. The right side of the loop also serves as the switching lead. The short siding crossing the yard lead serves a small freight station.

I've got the base built and a layer of foam on top of that. I've test fitted the track and will be ready to lay roadbed as soon as I purchase or manufacture the 3% grade inclines on get to the back industrial area.

Photos of progess to follow soon.

Sunday, December 04, 2005

The Whole-Tone Scale and Augmented Chords

In my study of jazz improvisation pedagogy, I've noticed a relative scarcity of instruction related to the whole-tone scale and the augmented chord that derives from it. There is quite a bit of information on the lydian-augmented scale, which is the 3rd mode of the ascending melodic minor scale, but even here there is a lack instruction on how to apply the scale in context. It seems to me that most of the literature focusing on scales does not go far enough in explaining the application of such scales in the context of the entire structure of real songs. In other words, it's easy enough to see that particular notes of a scale (i.e. the intervalic distances from the tonic) correspond with a particular chord (especially its altered extensions) but what are the possible functions of a scale or chord related to the surrounding changes in a song?

The augmented scale has intrigued me since I first learned about it in junior high school. I was taking saxophone lessons from a guy that got me interested in jazz improvisation. I had learned to write and play all of the major and minor scales (both melodic and harmonic) from memory and I wondered what other scales existed that I might have to memorize, hoping there were none. That's when my instructor embarked on several lessons in scale and chord construction and the limitless possibilities of sound using only the 12 tones of our Western chromatic scale. The first thing he showed me was that scales could have fewer or more tones than 7 (the number of tones in the majors and minors) and proceded to write out the formula for constructing a whole-tone scale : 1-1-1-1-1-1 (he always wrote scale formulas in terms of the intervals between successive notes, so a major scale would be written 1-1-1/2- 1-1-1-1/2). When he asked me to play a whole-tone scale starting on C, I was blown away by how accustomed I had become to diatonicity. My fingers had a hard time finding F# and G#. The B-flat (as I thought of it, instead of A#) was not as foriegn because I was used to playing the mixolydian modes, with their flatted sevenths. What really intrigued me about the whole-tone scale was that there are really only two of them (and only 4 augmented chords).

I've been trying to figure out how to use the whole-tone scale and the augmented chord in my improvisation ever since my first revelation. One of the first things I discovered is that the augmented 5th naturally resolves upward to become the major 3rd of the next chord. So a C+ chord naturally moves to F major. In other words, an augmented chord functions like V7 leanding to I. This is useful for the end of a song that ends on the V because V+ will naturally lead to Imaj, and this is can be heard almost as a signature in many older R&B and do-wap songs. It's fun to put a V+7 at the end of a blues progression. The disonance of the whole-tone scale can be suspended for a greater length of time in this situation because the tension is usually the greatest here and the listener expects a resolution on the downbeat of the next chorus. A III-VI-II-V-I turnaround offers an opportunity for whole-tone utilization because the III, VI, and II are really just substitutes for the V and the whole sequence functions as single dominant leading to the tonic. Playing a line on the whole-tone scale I+ just before the change to IV can add a sense of playing "outside" or ""sideslipping" but this opportunity comes and goes quickly as the tension and resolution of a I-IV near the beginning of the chorus does not have the urgency of a V-I progression. I've been trying to think of a way to keep the dissonant energy of a whole-tone line going from the final V of a blues chorus, through the I at the start of a new chorus, all the way to the IV in the 5th bar but I've not been successful in pulling this off (yet).

I've had quite a bit of success playing whole-tone patterns in modal playing, especially "one-chord" tunes where playing outside is almost a requirement to break the monotony. In a recent extended solo on Chain of Fools (known euphemistically by our band as Chain of Chord, or sometimes just Chord), which is in C minor, I managed to build the tension up through the use of chromaticism and a neopolitan minor scale to 8 bars of whole tone figures on E-flat. This had the effect of adding a flatted 9th to an ascending C melodic minor while omitting the root. A few obtuse counter-figures from the rhythm section really polished off the effect.

Tuesday, November 22, 2005

Palindromes

You're about to get a glimpse of the way the Mind of Kevin Bowman works. This is also an example of why people who have ADD tendencies should stay away from the internet.

For reasons I can't remember, I was talking with a work mate about strange audio processesing algorithms when I recalled seeing a farcical processing device on the internet that named all of the controls and such with palindromes. A quick search found the device in question to be the palindrometer (found here). Then I remembered hearing a satirical skit on NPR (my buddy Dave calls it National Proletariat Radio) that was an interview with a guy named Bob, who spoke entirely in palindromes. Of couse, this instigated a thourough search of the 'net for a transcript of that dialog. I did not find what I was looking for but did find several sites dedicated to palindromes and one site led me to another on which I discovered an intersting (to me) mathematical problem involving numerical palindromes (numbers like 12321).

So now I'm completely intrigued by this mathematical problem, which you can read about here. I started thinking about a related subject: what does it mean to "reverse a number"? And I discovered a couple of interesting things:
1) The absolute value of the difference of a number and it's reverse is a number evenly divisible by nine. This was really no surprise once I remembered the old accounting trick related to transposed digits (if the error is a multiple of 9, you've probably made a transposition error).
2) The result of dividing the difference mentioned above by 9 is often a palindrome! This was true for all of the numbers I first experimented with. My first experiments were with sequencial digits, like 123, 456, 987654, etc. I even tried 196 (196 - 691 / 9 = 55). However, I was able to find numbers that, when subtracted from thier reverse and divided by 9, did not result in a palindrome (72157 - 75127 / 9 = 330).
3) At least for some numbers, the process of "reverse and subtract" (and taking the absolute value) results in a palindrome. The number 196 "solves" in this case:
196 - 691 = 495
495 - 594 = 99

Subtraction is nothing more than adding with negative numbers. Perhaps this will open the door to generalizing the "reverse and add" process and help gain some understanding with the 196 problem. Or perhaps I've just found another way to waste a bunch of time.

Sunday, November 20, 2005

Model Railroad Theme


I've devised a name for my model railroad empire (such as it is). The theme is urban industrial and the name of the branch is the Inter-Urban Industrial Line. Pretty generic, I know. But since this is a freelanced layout (not representing any particular "real" place), I thought I could exercise a little artistic license. The Inter-Urban Industrial color scheme is orange, black, and white. The following two pictures are the logo on black field and on orange field, respectively:



When applied to locomotives, the horizontal stripes exend the length of the cab.

The era I am modeling is the early '60s. Steam has been completely phased out so the loco' fleet is entirely diesel or diesel-electric. A future expansion will model an interchange with a Grand Trunk double-track main, so some loco's from other railroads may operate on the IUI.

Here's the complete track plan:
The 2' X 4' section in yellow is the future addition. The darker colored track near the top is hidden from view by buildings, backdrop, whatever. Structure placement and the layout of the downtown area on the right side is preliminary.

I still have to nail down the industries on the IUI. Some ideas include a pertroleum refinery, a couple of freight stations, a piano factory, a furniture factory, a brewery and/or bottling plant, a lumber yard, and distributers (in town) of fruit and bottled goods.