A brand new game
for Windows, Linux, Mac, HTML5, 3DS Homebrew and more
every week,
unless exhausted!
About Games Music Pixelart Poetry Home Patreon Scores JNKPlat Petit Switch
Blog
Petit Switch - JMTrackr Release
  28th May, 2019


JMTrackr is a Music Randomisation engine, which can create an endless variety of music, based upon a set of prewritten melody patterns.

You can download it to PetitCom4 using the download code 4E3E33P5Y

-=-=-

Basic Usage


Upon loading the app, you're greeted with a rather simple Musical piano roll.
There are dots and crosses (balls and spikes) along the piano roll.
Dots mean "Play this note" whilst Crosses mean "stop a note"
Using these two simple devices, you can generate a monotone tune.

A places a dot, or toggles it to a cross.
B removes a dot/cross altogether.

Hit Y (or the P play button) to hear the pattern you've made.

Pattern Length


On the top right of the screen is a little circle. Tap this, and it'll cycle between allowing 1 "bar" in the pattern, to 2, then 4, then back to 1.
If you extend the number of bars, you can continue to scroll through the pattern using left and right.

Note, the number of bars you set is global, not per-pattern, so all patterns will change to the length you choose.

Switching Patterns


Moving between patterns is achieved using the L and R triggers.
You can create up to 16 monotone melodies, and beyond these 16 patterns are 16 drum patterns.
Drums work in the same way as the melodies.

Please note, since these melodies will be playing together, you should try to place notes that don't clash with each other!


View on YouTube

Randomisation


Hitting X, or the T Play button, will start the Randomisation process.
The engine will create a tune using your plotted melodies, as well as switching the various instruments, and also performing key changes to create different chords structures.

Hit X again to stop the tune from playing.

Using ingame


Sorry, this is a bit messy! I've tried to keep it as neat as possible!

Open the JMTrackr code, and jump down to (approx) line 100, and you'll see a commented Music header.
Copy from there, down to the lower "Music - Editor" header (about 100 lines).

Copy and Paste this function (it's called JMPlay) into your game's code, somewhere that the chaos of my coding style won't get in the way.

Save your code, then head back to JMTrackr.
Open up your chosen song, then hit the blue button on the bottom right corner. A beep will tell you it's done.
This copies the melody patterns into your clipboard, in the form of a couple of string arrays.

Head back across to your project, and you can paste this code, directly into your project, up near the top of your code.

From there, use the command JMPlay(Tempo) will play 64 patterns worth of random music.
If you need more, place a JMPlay(Tempo) command somewhere within your main loop, and it should seamlessly continue playing in the background.

Regular BGM commands can be used to control playback, but you might want to stop JMPlay access during pauses, or it'll start paying again!

Usage


You're free to use this as you wish. It would be nice to get credited. @Jayenkai will do, or AGameAWeek.com

You can tweak it, too.
There are settings for chord structures, and different instruments, but both options are currently fairly limited.
I also didn't add the Mute functionality, either, so feel free to add that in. It's supposed to mute channels, periodically, to add a bit more variety.

For different tunes, simply replace the melody/drum array contents. You might want to write a "loader" to load different tunes into the engine.

Let me know if you find it useful, and/or just fun to play with.
Good luck!

You can download it to PetitCom4 using the download code 4E3E33P5Y

Views 89, Upvotes 6
Petit Computer , Smilebasic , Nintendo , Switch , Petit Switch , Petitcom4 , Jmtrackr
Site credits : PHP script, Site design, Blog posts, Games, Music, Pixelart, Poems and More : Jayenkai
(c) Jayenkai 2017 and onwards. RSS feed
Blog - Petit Switch - JMTrackr Release - AGameAWeek