Everything is referenced to the white keys.
The notes are seven (do, re, mi, fa, sol, la, si) or C, D, E, F, G, A, B. With just those 7 notes almost everything is made of or composed, a symphony, a pop song, a tango, a rock ballad...
All one needs to remember is the harmonic triad from which all 7 chords are derived. The harmonic triad has the code 1.3.5, 1 being the bass. So...
All the basic chords on our planet are derived from:
CEG
DFA
EGB
FAC
GBD
ACE
BDF
With just those 7 chords most of music can be played.
Whether we would have to use flats or sharps will just depend on the scale or key on which the song or symphony is written.
Examples:
The first chord of Yesterday - Beatles
Bass F, chord F A C
The fist chord of Against all Odds - Phil Collins
Bass D, chord D F A, we play Bass D# chord D#, F#, A# since it is written in D sharp minor which has all those sharps, #s.
Everything is referenced to the bass or base. Chords are constructed from the default 135 code.
But ingenious music can have any other code or numbers above the bass.
For example:
The first chord of Against all Odds in more detail is D7. This means we also take the seventh note above the bass too. By counting the white notes this is C.
So we have :
D# bass, F#, A#, C#
The first code on Just Hold Me - Maria Mena is A9
So we have:
A bass with A C E B, all white notes since the key is A minor
On Symphony 40 in G minor - Mozart the first 2 chords are:
G bass G, B, D.
So we have G bass G, Bb, D since the key G minor has the B flat or Bb.
The second chord is G246 so we have
G bass with A C Eb. E is flat since the G minor key has any E flat. But is memory is correct the E note is omitted by Wolfgang.
Reference:
Bach, Niedt Bass Rules or instructions of Johann Senastian Bach to his scholars in music (source appendix of Spitta's biography of Bach).
http://normanschmidt.net/scores/bachjs-general_bass_rules.pdf