New Transpose Calculator (Experimental) #1391
Replies: 3 comments
-
Hey @ammatwain, this is great work already, thank you very much for working on this! Let us know when this progresses, and of course we would be extremely happy if you could submit a PR that integrates this into OSMD! Though since this functionality would be such a big improvement for OSMD, I would of course happily help you or integrate this into OSMD myself if you wish. So far, this seems to work very well. It would be nice to add octave selection (e.g. transpose from C to E upwards, downwards, or upwards plus one octave), since it looks like you can only transpose to each key signature in one specific octave, at least in your GUI. I haven't taken a look at the code yet, would you say it's close to finished, perhaps only requiring some refactoring and cleanup, or is there still some more functional work necessary? If so, can you say specifically what still needs to be worked on? |
Beta Was this translation helpful? Give feedback.
-
Good morning, @sschmidTU I'm glad that my work is meeting your approval. OSMD has been essential in giving practical meaning to the transposition algorithm I have in mind. During its use, I have realized that implementing it permanently might be slightly premature; it needs some refinements. In fact, for its proper initial implementation, it is absolutely necessary to include the functionality you requested, even to make it work as a substitute for a semitone transposition. Let me explain further: It may seem simple, but it's not quite there yet because I have to be careful with the intricacies of the "Sheet.Transpose" parameter, "halftones" parameter in "transposePitch()" and "isTransposedBy" property in "KeyIstruction". I'm thinking about how to make them work together. There is an implementation issue. For now, I have resolved it by setting the value "12" instead of "0", but it is important to note that the value "12" needs to be modulated, and this also affects the intentions regarding the direction of the transposition. However, the "Sheet.Transpose" alone does not seem to be sufficient to handle the various transposition options; perhaps it should be reconsidered as an object or directly communicate intentions to the TransposeCalculator. Then there is "GraphicSheet.getMainKey()," which I couldn't do without to achieve correct transposition to another key. To access these two objects, "GraphicSheet" and "Sheet," for now, I have solved it by providing a constructor to TransposeCalculator as "constructor(osmd: OpenSheetMusicDisplay = undefined)." In summary: Regards. Amedeo Sorpreso |
Beta Was this translation helpful? Give feedback.
-
Hey Simon, I haven't forgotten about you! It's starting to run just like I imagined. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone!
First of all, I would like to express my gratitude to the authors of OSMD and VexFlow, who have allowed me to actively implement some ideas that have been spinning in my head for years.
Next... I'm working on a key transposition calculator.
I've given it the temporary name of "TransportCalculator".
For now, I don't share the code yet because it's in a kind of "draft" state. I'm still reviewing and refining it.
If you'd like, you can see its current state at this address:
https://ammatwain.github.io/transport-calculator/
Getting straight to the point, as the first piece, you'll find "Prelude and Fugue in C#" by Bach, which the current algorithm doesn't transpose correctly, while my algorithm does it without errors.
In my plans - in addition to key transposition - there is also the ability to perform semitone transpositions, interval transpositions (with or without key transposition), and diatonic transpositions (without key transposition). But it's a task that requires a certain investment of time, and I would like to understand the interest behind this before determining the pace at which to proceed.
Thank you for your attention,
Your feedback and suggestions are highly appreciated!
Amedeo Sorpreso
https://github.com/ammatwain
Beta Was this translation helpful? Give feedback.
All reactions