Respell pitches, how?

• Jan 14, 2023 - 07:52

I made a cool plugin, which turns music into aleatoric dodecaphony. The pitches are changed, but the noteheads don't move. I guess I need to do some respelling inside my plugin. Because doing the respell pitches after my plugin will fix the note heads. How is it done in plugin code?

The attached file is Beethoven's Für Elise aleatorized. The algorithm needs some tweaking yet. What it does now is it goes through each note and changes its pitch according to bell curve stochastics. In 16% of the cases the pitch is unaltered, in 14% it alters a half step, in 11% a whole step, all the way to 0.009% a tritone. But each time one tone of the 12 tones in the dodecaphonic realm has been used, its percentage is halved. With this I try to get all 12 tones to be used evenly in the long run.

Attachment Size
Fuer_Elise_aleatorized.mscz 25.2 KB


> The pitches are changed, but the noteheads don't move.
I've read the mscz but I can't understand what you mean, what do you want to achieve? I maxed out my tiny serialism brain but still can't grasp schoenberg.
Do you want to change the audio and keep the visual unchanged? Why not duplicate the staffs, mute the visual one and hide the audio one? Alternatively I'd try adding multiple capo staff text, need to lower the instrument first because no negative capo thou #280968: Capo Settings: add a "Detune" setting to emulate instruments below written pitch. I'm amazed what people are doing with Musescore, please forgive me Beethoven.

Attachment Size
Fuer_Elise_test.mscx 18.24 KB

In reply to by msfp

I want to alter the pitch AND the visual. But I only manage to alter the pitch. My plugin alters the pitch property of the note (which equals the midi note number).
Well, I KNOW how to also alter the visual in the code, I just set the visual to D# or Eb or Fbb. But I was hoping I could get that automatically in my plugin code by calling some function.
Right now, when my plugin is run, I can hear the pitches are changed, but the note heads haven't moved. I have to manually run the function "Respell the pitches" to get the note heads move. Since that function is available there, ot would be nice if I could call that function from my plugin.

In reply to by msfp

Great! Just what I needed. Well, I obviously have to figure out which of the three alternatives is the best for a particular midi pitch. But since I'm turning tonal music into atonal music, I just pick the note name with the least bb or ##. I could as well include in the plugin that it deletes the key signature of the score, since it doesn't really have any significance in atonal music.

In reply to by msfp

I made it work. I just write one particular tonal pitch class to note.tpc, note.tpc1 and note.tpc2. I don't quite understand the concept of having the concert pitch and transposing pitch saved for each note in a score. Why do I have to care for both, if I want to alter the pitch. Say I have note #60, which is C4 and the concert pitch class is C. If it is a clarinet score, the transposing pitch class is D. If my plugin changes the note to #64, I understand that I have to decide whether the concert pitch class is E, Fb or D##. But why do I have to further write the transposing pitch class? Instead of having a property named concert pitch class and another named transposing pitch class FOR EACH NOTE, there could just be one pitch class property, be it the concert pitch. The staff property defines the transposing. And that transposing should define that ALL occurances of concert pitch E become F# and not Gb, when viewing the transposing score.

In reply to by msfp

They are different intervals. Transpose a C up an aug4 and you get F#. Transpose a dim5 and you get Gb. Two different notes! Same midi note, same key on a keyboard, but two different notes!
But I guess I get the tpc1 and tpc2 right, if I read them both before I do anything else. They give me the info about whether it's a transposing stave. After altering the pitch I just adjust tpc2 according to the transposing.

Do you still have an unanswered question? Please log in first to post your question.