OpenNBS / OpenNoteBlockStudio

An open-source Minecraft music maker.
https://opennbs.org/
MIT License
728 stars 50 forks source link

Generating a perfect progression of notes using the note pitch offset #444

Open CreeperPookie opened 3 months ago

CreeperPookie commented 3 months ago

Describe the enhancement you'd like Since the macros were added, I've been using fade in/out a lot; However, something I would use a lot is a quick way to make a transition between two notes and make a perfect progression between them. (i.e. a rising tone or sweep). So many songs use things like this and it would be VERY useful to have an easy way to recreate it here :D

Additional context To show this is doable, (and to get around this issue myself), I wrote a C++ NBS generator for this exact purpose. The number of cents to add or subtract to each note is defined by (((<number of semitones between the two notes> / <period length (how many ticks to span across)>) * 100)). To make a rising progression (to put it simply), you start with your base note and add the cent offset from above; if it becomes 50 or above, you subtract 100 from the note, increment the note key, and negate the new cents value; then repeat until you've made length number of notes.

Although the process is slightly different for a falling progression, both are very similar and might be doable to implement in NBS. Also, yes I know the cents offset can not be a perfect integer (making the progression fall a bit short), but even that could be compensated for by adding a few cents every few notes where needed. If it helps, I'd be happy to share my generator code to make this easier to understand, as I know math stuff isn't for everyone lol