Easy beginners way.

Of course, if you got any musical training or practice you can find tonality by ear just hitting some notes or chords together with a sample but when I started I just don’t know anything about music theory so this is the easiest way that worked for me.

I started my journey by making beats from sample that I cut from a song. Making drums Рthat not that hard but to write a bass line to my beat this was a challenge, so in finding a way I stumbled across Celemony Melodyne software that recognizes pitches in songs and samples.

First I open my sample in Melodyne

Algorithm.

When the sample will be analyzed check the algorithm. Polyphonic means that in audio there couple of melody lines, chords and two or more instruments. If you got a bass line sample you can try to use a melodic algorithm it will analyze audio as it plays one note at a time. Sustain is for long notes maybe strings sample and decay for more faster pieces.

User interface.

After that, you can enable some interface elements for better understanding the notes.
In Options > Scale Editor Choose Selection & Master Tuning and in Note Editor Choose Scale Snap, Scale Notes and Note Names Options.

Notes in sample.

As you can see in my sample there is a prominent bass line that I can use with this sample It will be from E to A and then B notes. At the left, there is a scale of this sample E minor but always watch for notes and what they do.

Hope It helps you to begin your music journey easier.