Open abalter opened 2 months ago
This seems to do nothing to change the instrument that actually plays or any of the other settings.
The editor does the renderAbc internally, so you don't need to listen for changes. So the basic setup is described here: https://paulrosen.github.io/abcjs/interactive/interactive-editor.html#constructor
You can set up the synth by passing the parameters into that. Then when your control changes you can update:
const editor = new ABCJS.Editor("abc", abcjsParams)
// after something changes
editor.paramChanged(abcjsParams)
I'm not sure what you mean by "alter the reference pitch". Do you mean transpose, for instance for clarinet? You can do that. See the parameter "midiTranspose" here: https://paulrosen.github.io/abcjs/audio/synthesized-sound.html#settune-visualobj-useraction-audioparams
(I know the API isn't particularly clear - sorry about that, but it grew over years when handling different use cases.)
I looked over the examples and while all of the kinds of things I want to do are included in one or more examples, the design patterns they use (how the render the ABC, how they set up the synth player, how the handle callbacks, etc.) are so different I just feel very confused.
I started with the simple example of editor and player. I added to the page a set of controls to edit tempo, swing, key (transposition), pitch, instrument, and chords. (It may not currently be possible to alter the reference pitch.) These controls are connected to a callback function called
updatePlayerSettings
that doesn't actually do anything other than print the values of the controls.Could someone show me how I can actually alter the player in this callback?