Audio Loop Player Auto Detect Note
-
I have a 1 second timer running which returns the root note (as automatically detected in the loop player). This updates a combo box with which you can select a new root note or whatever. Basically you drag in a file and within a second it updates the root note combo box.
Now, when I begin changing the start point of the sample the root note changes! Is it updating itself based on what the start is? The sample is a vocal so changes pitch throughout. It's not very helpful tbh! Once the root note is set I imagine you want it kept that way.
I don't think there is a callback for loading in a new audio file - please correct me if I'm wrong...
-
I've just encountered the same issue. I'm wondering if we can use the new broadcaster system for this and react when the pitch is updated. @Christoph-Hart ??
By the way, the detected pitch seems to be 10 semitones out for me. If I load a C3 (MIDI 60) file the detected pitch is 50. If the file is 73 the detected pitch is 63. Are you experiencing that? Maybe it's just my audio files.
-
Actually I found the proper solution and it's quite simple.
const audioFile = AudioLoopPlayer1.getAudioFile(0); audioFile.setContentCallback(function(event) { if (isDefined(event)) { var rootNote = AudioLoopPlayer1.getAttribute(AudioLoopPlayer1.RootNote); knbRoot.setValue(rootNote); } });