Topic category: Minecraft mod ideas exchange
I am working on procedurally generated sounds for both Skills and a later update for my mod, A Rat's RPG. I plan on adding instruments as to help the bard class really get into their role. I thought that maybe someone out there might want to do the same.
The way this works is that I've eight sounds. All of which being a note from the A minor scale, plus an octave. There is a global map string variable that holds an initial value of 'z'. Z means not one note has yet to be played on this world.
When a note is called for while the variable is 'z', it will play the root note. Afterwards, 'lastNotePlayed, the global map string will be updated to a value of 'a'. There are now two chance based options that happen. There is a seventy-five percent chance it plays a 'diatonic' note, in this case meaning it will play another note from the chord it is the root of in the Amin scale. This means an 'a' will have a seventy-five percent chance to either play a C or an E. Once a note is selected and played, the variable is once again updated and the process repeats with the respective new note. If an octave is played, there will be an evenly distributed chance that all but the octave will be played.
- Edit: If a 'Diatonic Note' roll fails, it will play a 'Chromatic' note, which will be a note outside of the former's chord, though remaining in the Am Scale.
I'm sure this works on 'item right clicked' functions, so, enjoy your instruments. If you want to make it so that others wont influence one's own playing, make your lastNotePlayed string a Player variable.
Find the .PTPL here.