Chromatic alteration
A note outside the key can point to a target or color a chord.
Change a pitch for a reason
Chromatic alteration raises or lowers a note outside the current diatonic collection. It may create a leading tone, color a chord, approach a target note, or signal a new key. An accidental shows the written change, but context explains its job. Treating every foreign note as a modulation can make a short phrase sound more complicated on paper than it is to the ear.
Find the destination
Write a C-major melody with F-sharp immediately before G. Play the original with F-natural, then the altered version. Hear how F-sharp leans toward G. Next hold F-sharp without resolving and notice that its effect depends on what follows, not just on its presence.
A chromatic note can be a fleeting passing tone or the defining third of a new harmony. Check its duration, accent, and bass support before assigning a large structural role.
Related entries
Further reading
These source links provide technical background; the exercises above are Eidolon's own editorial guidance.