can i draw my own wave form?
-
Is there a way i can draw my own waveform of a sample within a sampler, including playback position and loop points? I know I can use a buffer for drawing one but from my understanding I'd need to manage playback with Engine.playBuffer and I'd lose the advatages of the sampler, like the module chains and looping.
-
@d-healey This you? https://forum.hise.audio//post/17569
I was looking for IR display and ran into this. Still not familiar with the samples but can you get a return of the loop points? If so, I guess you can just draw them on top manually.
-
@aaronventure loop player is limited, sampler with custom import is a better choice
-
@d-healey Chris' post right below yours https://forum.hise.audio//post/17658
Or can you not dynamically generate samplemaps for user-imported stuff (if this works based on samplemaps)?
-
@aaronventure Oh that's how to display the waveform in the audio wavefrom control. I can already do that (with samplers too). What I'm looking for is how to draw a waveform on a panel using buffer data. I can do this already as I mentioned above but I lose the advantages of the sampler.
-
@d-healey Drawing a waveform will quickly get you into performance bottlenecks - I had to apply quite a few performance tricks that are only available on the C++ level (multithreading, under sampling, etc) to make the UI performance of the waveform acceptable for most use cases.
You can fetch the content of any sample as HiseScript Buffer and draw it yourself, but unless you do a aggressive simplification of the sample data you'll run into performance issues.
// Grab the first sample const var first = DemoSampler.createSelection(".*")[0]; // will give you an array of buffer objects for each channel const var bf = first.loadIntoBufferArray(); // Should print the length of the sample (or undefined if you load a mono sample, // but here's where the fun begins). Console.print(bf[0].length);
-
You can fetch the content of any sample as HiseScript Buffer and draw it yourself
This is where I had got up to. But I don't get the playback data from the sampler so I can't draw the playback cursor. Given the performance issues you mentioned I think I will abandon this road :)
My main goal was to be able to update the waveform when the gain level is changed (like in the waveform editor) and have horizontal and vertical zoom.