Sit at a piano and play the Gb major scale, and something unusual happens: five of its seven notes are black keys. Only two, Cb and F, land on white keys. That is why pianists often find Gb major surprisingly comfortable under the fingers, despite its intimidating key signature. Chopin famously wrote an étude in this key (Op. 10 No. 5, nicknamed the "Black Key" étude) where the right hand plays almost nothing but black keys. For a melody writer, this key is worth knowing well, because every note in it has a clear job: some feel like home, and some are always leaning somewhere else.
The notes of Gb major are Gb, Ab, Bb, Cb, Db, Eb, F. The rule behind the spelling is simple: a major scale uses each letter name from A to G exactly once. Start on Gb, walk through the alphabet, and every letter appears one time.
The one that surprises people is Cb. On the piano, Cb is the same key as B. So why not just call it B? Because we already have Bb, and calling the fourth note B would give us two kinds of B and no C at all. Writing Cb keeps the alphabet tidy and makes chords and melodies much easier to read. It sounds strange at first, but it is perfectly normal, and after a week of using it you won't blink.
That spelling gives the key six flats: Bb, Eb, Ab, Db, Gb and Cb. A key signature is the set of sharps or flats written at the start of each line of music so you don't have to mark them on every note. You'll also meet this exact sound written as F# major, which uses six sharps instead. Same pitches, different names. Which one a piece uses usually depends on the surrounding music.
Every major scale follows the same step pattern: W - W - H - W - W - W - H. A half step (H) is the smallest distance in Western music, one piano key to the very next one, black or white. A whole step (W) is two half steps.
From Gb, it runs like this: Gb up a whole step to Ab, a whole step to Bb, a half step to Cb, a whole step to Db, a whole step to Eb, a whole step to F, and a half step back up to Gb. Those two half steps, Bb to Cb and F to Gb, are where the scale's personality lives.
Hum a melody and stop on a random note. Some notes feel finished; others feel like a sentence cut off mid-word. In Gb major, the three restful notes are Gb, Bb and Db. Together they make the Gb major chord, and landing on any of them gives a sense of arrival, with Gb itself the most settled of all.
The others want to move:
Cb and F, the fourth and seventh notes, are what make this sound like major and not one of its cousin modes. Lean on them and the key announces itself.
Stack every other note of the scale and you get seven chords:
Notice that the V chord, Db, contains F, and Db7 adds Cb too. That's why Db7 to Gb feels so conclusive: both pull notes resolve at once, F up to Gb and Cb down to Bb.
A good progression to write over is Gb - Ebm - Cb - Db, two beats or a bar each. Ebm is the relative minor, the minor key that shares all seven notes, and it brings a touch of shadow before Cb and Db lift you back home.
Over that progression, try this shape. On Gb, start on Bb and step down to Gb. On Ebm, rise from Gb to Bb and hold it. On Cb, sing Cb and let it fall to Bb, then step to Ab. On Db, climb Ab to F and hang there for a moment, unresolved. Then return to the Gb chord and finally give the F its Gb.
That little phrase uses every trick in the key: stable notes to open, Cb sighing down, F reaching up. Sing it, play it on any instrument, or program it into a sequencer. The point is to hear tension and release happen on cue.
Find Gb on the low E string at fret 2 or 14, or on the A string at fret 9 or 21. The 9th-fret A-string root is a comfortable spot to work out the melody above; F sits one fret below each Gb, so you can feel that half-step pull under your finger.
Write a four-bar melody over Gb - Ebm - Cb - Db where bar three ends on Cb and bar four ends on F. Then add a fifth bar that resolves both, landing on Bb and Gb. Record it, and listen for the moment the key clicks shut.
For the bigger picture, read The Major Scale (Ionian Mode).