In the first installment of this brief series, I discussed the ridiculously obvious: Before you can begin to write down a tune, you need to know what key you're going to write it in. Hidden within that precept is the assumption that you'll have mastered enough music theory to be able to tell one key from another, and figure out which note is which in functioning tonality, and know how to write in music notation. Sorry, without those prerequisites, you're just going to have to go to somebody who knows this stuff and whistle your tune to them. If you are ready to do it yourself, however, read on.
Some of the factors to take into account have already been discussed by way of choosing the key for the melody. But the shape, range, and register of the melody should also be considered in light of the limits of the featured performer's range, the tessitura (range of pitches predominating in the tune) that will showcase the best qualities of the instrument without unduly exhausting the performer, how the tune approaches the extreme upper and lower limits of his range and breaks between registers within it, how much consideration the tune's phrasing must give a singer or wind player's need to breathe or a string player's need to change bowing direction, the attack and decay qualities of the instrument and other factors relating to its agility, the interval sizes the instrument is best at navigating, fingering issues and any conditions that may affect the performer's intonation and ability to stay in tune.
Is it the kind of instrument that makes certain key changes or intervals difficult to tune? Is the performer likely to lose his way in a thicket of chromaticism? How virtuoso do you dare to go with the performer you have in mind?
So the next battle of the campaign is to write a tune that, as musical jargon puts it, falls gratefully on the target instrument. Not too high, not too low, not too fast, not to slow, not unplayably difficult, not absurdly out of character.
Actually singing the tune to be sung, or playing the tune to be played on the instrument in question, would probably be ideal. Most of us mortals, however, only ever master the playing of one or a handful of instruments if any. How do you find out about all this stuff? How do you prepare to write music for a lot of instruments you have never played? Here you actually have some choices.
Choice #1: Read a book on orchestration or instrumentation (or vocal arranging, etc.) and bone up on the vital stats of the instruments you plan to use in your work. There are books that will guide you through each instrument or family of instruments, showing you their range, register pitfalls, and what not. Absorb what you can, use the book as a reference for the rest.
Choice #2: Study lots of scores, which you may be able to find online via sites that purvey public-domain sheet music, or in a college music library, or in a used book store, a music store, an online sheet music store. There are miniature scores of whole symphonies, operas, and other major masterpieces that can be bought on the cheap and stand up nicely on an ordinary bookshelf. With today's recording technology you can also listen to a performance of the piece you are studying. A lot of the great composers cut their teeth on reading scores and, even better, copying them one part at a time. An attentive student can pick up a lot this way from the examples of great works.
Choice #3: Try typing your tune into a piece of music software that has the ability to show you (say, by the color of a note head) or tell you (by refusing to play back an audible note) that something you are writing for a given instrument can't be played.
Choice #4: Run a rough draft of your tune past someone who sings or plays that voice type or instrument and deal with the red marks they put on it.
Choice #5: Take a class or private lessons on instrumentation or vocal arranging. You may be able to find someone qualified to teach you at a nearby university.
Choice #6, and this is the one I personally prefer, is not to bother writing music I couldn't personally sing or play within a wide enough margin of error to feel confident that the work is practicable. So as I move on in this thread, I will be talking about the kind of music I feel qualified to write: music for keyboards (piano, organ) and the voice (solo, chorus). For more specific advice about how to write tunes for a banjo, accordion, bagpipes, or whatever, seek the advice of specialists in those instruments. Thank you. And farewell for now.