AudioWaveform - callback
-
Whilst I can register an AudioWaveform callback:
inline function onAudioWaveform1Control(component, value) { Console.print("here..."); }; Content.getComponent("AudioWaveform1").setControlCallback(onAudioWaveform1Control);
it never seems to get called... well I'd like to get a callback when the user changes the range start or end for the displayed audio...possible?
-
@Lindon bump anyone? Anyone get the audioWaveform callback to work?
-
@Lindon -err... anyone?
just in passing - it seems to fire on init but never after that ---
heres a trivial snippet - load your own audio into the sampler...
HiseSnippet 1220.3oc6X80aaaCDmJNJM1KqXsnCXuL.gf8fCPWfcaZ5.5C0INIEFqNwvNqauUvHQaSDJRMJJ23MzuS6iv9H0uAaGojrn7bRSL5RG5pevP2c7N9i2eoTOovmDGKjHmpmNMhfb1vcvTtZb6wXJG04.jycc6hiUDoWJq8mFgiiIAHGmJuPyvo5pHyu2878wLL2mTvBgdkf5SdIMjpJ31q0ORYrivAjSogVqdmVc7E71BlHAvSE2FnHr+43Qjiw5kshKxYsCCnJgbfBqHwHG28EASGLV7Fd55eEMldFinIZhF.FJk8ISHxITxaNRvBzHWyy9YT6wTVPubeQLBrbuBOSkTOyCb6RCny3W3g9Ji.uBMr8QNqTFxUJA4lWFjW.jbrfzpoP5dtC7kzHUgDMd9B2NbHfMDCgBanjtVzJ+piaaArBtZ6P74jij.wLMpuaiFOzC9aqmUqVMJmQ4DugIbeEUv8D78RBnheFOgLTHCapsiTvp6KBiDbvhOzaBlkP1p1uWqJHLVvHaGIobU8M8YT+yIAaBF9sOqVNBFQTsyUt9lks9lascrVrYOZiYryf7g5WBF.yZAyiEJxI75FbT6s07lWzvgKTVlsXD4BEqyWkWkh04IgmQj1dA8Bg.V4rf0tdYA9oNIqEJ3c3T0IQjL5hz3lKHmAk4k0YOYHDVpxj670Y4NkblHZfNetrCFYNL1U0nepyAXEN2rvN.6ZDQpn5CmyAjIPUeZJZU2CHwmqDQl0lEnQN24FChKJ.voslVPDzJJ+D2Azql6.bXDD.ahhMOzgGPtH0cFC9winrr9INUP+yJJnVVDjvvpxE35NcYBf3copJckCOlplZ2Ib9p9Uu73cCq386IZdMg68b6QU9iWLdWYA3Ehi+ai2rdneo6gCGR7UEfcU2i9kqrg4Gbnr9kLnaCSWQfRm67AXLWz0dLmSkq5Heoi09XMB6VMY9y0deJU68soP49tCTRBNjxGk0s1fGqd22p0e8jDl.GLf9aVK6OaseB3ujk49GsLa0dghDdo8JC48IQDrBB+V5rdq98egTjDMuVu64ljkSkv0Z.WgsfS3DvuqrOiskh33gvwwXqXaQ8Rjiz9pBN8IvcdiKy63jPH1y4Dl9pyNN543wDcrl52EqjzKrWsYWZbJ1Dug6danaNG8ili9wyQuybzOYN5cmi9oEzoNzt3Hclg9t+ycEp6b8tBEXfdX3Hasx8oilY7TNkawXszY9bCtrZIuf9sq849suu2vow0+MbpliwATcn5P9DnFE3nw38g6TNDmvT4bK2unqfKhFK3T+xUDPF9nQDoM1W3AZOkBJHK37fV8ILBN1pj96Z8R3dBXY4B8aju3l+1dKLd8Mtov0S2jy6Si4jU9e+bxqx0c2rojdvtKU+GONugqoutmdL7GKn1Wjnfwq4i3bg4fCfY+9D6ogqnmvlR2PSqAz.BOvP7WvuLgMyGcpE1LWHxO2TvYK6YyaH6Tgv0iNLW+iACkY1ozwvMLzPBFucqfxai8HD6KEu1O8qMn8Gqa3.dBt40tq51US6M6yJ351X6FnPXd3q880EaeODEWrNOZIz4wKgN6rD57jkPmcWBcd5RnyObk5nuJxdIJQXZiXfQuCSSdcNbVxaEzeCHscpCA
-
@Lindon The audiowaveform control seems to be broken for me. Dragging dropping doesn't do anything until I hit compile, and right-clicking doesn't display a file browser - do these things work for you?
One thought I had in general is that you could trigger the audiowaveform's callback from a panel's preload callback (assuming that switching out the file triggers the preload callback). I can't test this because of the two issues I mentioned above, but it would be something like this snippet:
HiseSnippet 884.3ocsV80aaaCDmzIrH1sEnEa80A07jBPmgcaZ2.JJZZbRJLZRpwbVWepELTzVDghTfhJYFE4609Dsm22f06jjikZcyRMvzCF738me+3w6N5QNqPlkYcDZ6SlkJI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+BO
-
@Lindon Oh I can see in your snippet you are linking the audiowaveform via
processorID
I assume the same rule applies as for other components, the callback won't be triggered when using processor ID. -
@d-healey - yeah I understand what you are saying but my use-case is much simpler than this:
(oh by the way right clicking doesnt do anything for me either..)
The user selects a sample map (in some browser based way) and it loads into a sampler - this sampler is connected to our audioWaveform.
The AudioWaveform starts out at index 0 and displays the first waveform, the user can then (using a menu ) select other waveforms to display.All fine with a passive AudioWaveform so far...but:
The user needs to be able to change the start and end of the sample, e.g.:
Again all fine with the current Audio Waveform -- except....
I need to know the length of the new playing segment (Sample End - SampleStart) - which is obtainable and calculatable - but I have no event that tells me when the user has made these start position and/or end position changes....
(( The reason by the way I need to know this length is to allow at least some sort of manual looping of this audio "segment" - turning looping on wont work as it will likely give the end user clicks - so instead I have to repeatedly time a note thats exactly the end pos - start pos length - so at least its got an envelope....)) - so even this is actuaully a work around for what we both agree is a bug ...not allowing x-fade material outside the start -end
-
@d-healey -- oh yeah processor id != callbacks - how do I assign an audio waveform to a sampler with scripting?
-
how do I assign an audio waveform to a sampler with scripting?
I think you just use
.set("processorId", "sampler")
but obviously that isn't going to help here.Can you read the length of the sample in the preload callback when the user selects the sample map?
-
@d-healey - yuep
its:AudioWaveform1.set("processorId", "Sampler1");
reading the length in the pre load is not much help as the end user is changing the length...
still .. working on it...
-
@Lindon -- yeah still no call back happening...
-
@Lindon Yeah using
AudioWaveform1.set("processorId", "Sampler1");
is effectively the same as setting it in the properties editor, that's why I said it isn't going to help here. I think what is needed is an additional callback for the audiowaveform control, something likeonFileChanged
. -
What controls does the user use to change the playable area range?
-
@d-healey said in AudioWaveform - callback:
@Lindon Yeah using
AudioWaveform1.set("processorId", "Sampler1");
is effectively the same as setting it in the properties editor, that's why I said it isn't going to help here. I think what is needed is an additional callback for the audiowaveform control, something likeonFileChanged
.Actually I need to be able to change the Sampler attached to the audioWaveform so I need:
audioWaveForm.attachSampler("somename");
and I need the callback to fire when the audiowaveform has the start and end positions changed..
-
@d-healey said in AudioWaveform - callback:
What controls does the user use to change the playable area range?
They use the audioWaveforms own controls: enableRange = true in the audioWaveforms properties...
-
@Lindon I think that this will require Christoph level intervention.
-
@d-healey - yeah I think that too... here goes... @Christoph-Hart !!!???
-
@Lindon said in AudioWaveform - callback:
@d-healey said in AudioWaveform - callback:
@Lindon Yeah using
AudioWaveform1.set("processorId", "Sampler1");
is effectively the same as setting it in the properties editor, that's why I said it isn't going to help here. I think what is needed is an additional callback for the audiowaveform control, something likeonFileChanged
.Actually I need to be able to change the Sampler attached to the audioWaveform so I need:
audioWaveForm.attachSampler("somename");
and I need the callback to fire when the audiowaveform has the start and end positions changed..
Worse..... this wont even work dynamically...:
if (a==1) { AudioWaveform1.set("processorId", "Sampler1"); }else{ AudioWaveform1.set("processorId", "Sampler2"); }
I can set this in a script but its ignored until I recompile the script....
-
NOOOOOO!!!!!!
Now I find that AudioWaveforms WONT save start and end values in
presets!!!! -
You can use a sliderpack to store/restore the start/end values.
I can't get the processorId to refresh the component without compiling either, I suggest opening a github issue.
Here's a solution for loading in different samples which does update. It's much more convoluted and you'll need to experiment to get this working how you want. Also with this method it doesn't actually display the waveform (at least not for me). Another solution is to use multiple waveform controls that you show/hide but this might not be practical depending on how many waveforms you have.
HiseSnippet 1592.3oc6Y8taZbDDeOi2DCMMpNMUpeoRmr5GHUoD.+uJU0VrwPjahsQfSZkpZsVe2BrJG6h1aOmPirTej5iPej5aP6r6c.6cgfbHItoR3OX4clc1427amclASKoviFFJjHm7mNZHE4bKbmQbU+58ILN5vCPNeJlD4yDOmbAsqPNPQCUn8GMjDFR8QNN4dndiN4WEY94u+g8IADtGcpHD5oBlG8wrAL0Tosp8HVPPShO8T1.qcuUsC8D75h.QD.pb3xngDumQ5QOln21JXjyMZ3yTBYGEA.CxY08E9i5zW7bd79eJKjcd.UunBpCbPwhaJB70HVKEUuOKvu03fODAGZqoTQtXp3t3iX9rIxmRIehQg6TKr4CmURCubofWEa3U1Bdy.RNVPBGCo0wc7jrgpoZz34ivGxUT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GSnGQFpyLtCdRM2NwkbekNN27p0wANvVDfBr149rdSbVrD6ojmP6FnYMg8043yqd0d7M+o6+eP4zTS6meLF6vz2NM3W.OSAIwIDGP6RhBTikltjwQBtXXeAm4k9QAjj2qGUZi8YFP6oTvaxoRtas1vrgjPqW0eYsGCCASjoeq+FwEUt5bw7tu9bbLbc004beat2tVSylaKwbWoVhuyw6h2d7Zk5tcRiR23gK+v9d9VXSocWcm3+qfZaQjB5vNtK25PqvNP6eOpcCw0zMYiWWd7vscnbeyh+A9IQYkI+SD.kUxnrpskUynbSaK2LixsrsbqLJ211xsynbGaK2Iixcssb2wJQdiCbfhS9aymDwIGkqazYlKM.lhHv9AXHLRjl.uI17obPnEwTepmGYQLs.NLRB4RvmeZAr9FX3y2PWjwQqtbbzkiiZON55Xw4BZEfoz0uzstxNM5ZW2Sitb5zOjmNs5xoSWNc5xoSWNc5xoSWNc5bmNMSt.dl4Bq7VkKfFP7jhy7h+tSzb7ZFI.R4lud473izqcm7kjfwkKUFM.lH3LOOc4luFximsMUW.a1bArYqEvlsW.a1YArY2EvluYt1nGFauHkXPbqHPPqFwIWNMljbkC8ubItN6.
-
@d-healey thanks I will take a look - so yes I am reverting to using multiple Audiowaveform widgets - one for each of the 32 samplers....