123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|582|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> On Topic -> Tracker-Based Music Basics

Thu, 30 Aug 2018, 08:28
spinal
Jay - remember that tracker you made that time? how did it work?

-=-=-
Check out my excellent homepage!
Thu, 30 Aug 2018, 08:28
Jayenkai
I've been thinking about that, recently, too..
The last JMTrackr was made in about 2013, but JNKPlat feels like it could do with some simpler choonage than giant mp3s.
Not sure I can get it working on 3DS, though..

The basic idea is, you have an array of "notes", and a trigger system.
The trigger point starts at 0, as does the current tick. (Millisecs)


To add randomness, I created the choons all under a C chord, then randomised the chord structure and pitchshifted the notes based on the current chord.
Also a little "mute channels" was added for extra randomness.

-=-=-
''Load, Next List!''
Thu, 30 Aug 2018, 08:56
spinal
I managed to play samples at different speed/pitches on pokitto. So as you might guess, the next logical thing to attempt is to play the samples at known pitches to make some sort of tune.

The only main thing now is to figure (find) out what the differences are between notes and apply them as a percentage (sort of) of change from middle C I guess.

-=-=-
Check out my excellent homepage!
Thu, 30 Aug 2018, 09:05
Jayenkai
There's a chart about halfway down this page.

https://en.wikipedia.org/wiki/Pitch_(music)

I typically find that working from A makes things easier.
Find the approximate pitch-shift float value for each note (C->B) and simply multiply samplerate by value for the correct note.
Octave above = pitch *2.0
Octave below = pitch *0.5

Be sure that your instrument samples are all starting from the same note.

-=-=-
''Load, Next List!''
Thu, 30 Aug 2018, 09:11
Jayenkai
To clarify, the chart says that an A note is 220.00, and assuming the instrument sample is an A note, too.
To play the C note below the A, which is at 130.81, we simply take the A value (1.0) divide by 220.00 (0.0045454545) and multiply up by 130.81 to give us a pitch value of 0.59459, which we should play the sample at.

Be aware, you're probably better off going up then down, due to floating point inconsistencies, so (1.0 * 130.81)/220.0
(Home * TargetPitch) / HomePitch

You can also speed things up a little if you make a lookup table of standard pitches, so C would be 0.5945, C# is 0.629954, etc. And again *0.5 for an octave lower, or *2.0 for higher, etc.

-=-=-
''Load, Next List!''
Thu, 30 Aug 2018, 09:29
spinal
Coming to think of it, do trackers assume an instrument sample will be a specific note?

-=-=-
Check out my excellent homepage!
Thu, 30 Aug 2018, 09:32
Jayenkai
Yeah, they typically assume C, I think, although I seem to remember F being important on the Amiga..?? Maybe all my instruments were Fs for some reason!!?

It all depends on what pitch your instrument is when played at pitch 1.0. That’s your starting point.

-=-=-
''Load, Next List!''
Thu, 30 Aug 2018, 10:07
spinal
Be aware, you're probably better off going up then down, due to floating point inconsistencies, so (1.0 * 130.81)/220.0
(Home * TargetPitch) / HomePitch


Surely the 1.0 is a bit redundant here? So it would be simply TargetPitch / HomePitch?

Although next step would be to figure out the percentages remapped to 255 instead of 100.

-=-=-
Check out my excellent homepage!
Thu, 30 Aug 2018, 10:24
Jayenkai
Yes, but the 1.0 assumes all your instruments are pitched to be A, when played at 1.0. If one of your instruments isn’t an A, you’ll need to change the 1.0 to match the pitch of the instrument when it IS an A

-=-=-
''Load, Next List!''
Thu, 30 Aug 2018, 10:57
spinal
Right, I've built a lookup frequency table, I'll test it later on tonight although I think it might be back to front.

-=-=-
Check out my excellent homepage!
Thu, 30 Aug 2018, 11:49
Jayenkai
Yeah, the more you can do via lookups, the better. I imagine the little pokitto isn’t all that powerful for the maths.

-=-=-
''Load, Next List!''