AudioWaveform - callback
-
@d-healey Okay well all Im getting is:
Interface:! Line 23, column 21: Unknown function 'get'
..after I try and drop in a couple of samples...
-
@d-healey said in AudioWaveform - callback:
You can use a sliderpack to store/restore the start/end values.
The problem with this is - the f***ng AudioWaveform control doesnt fire its callback - so I have no way of knowing when the start and end values have changed!!! Grrr.>>!!!!!!
-
@Lindon Where are you dropping in the samples?
-
@d-healey said in AudioWaveform - callback:
@Lindon Where are you dropping in the samples?
on the audiowaveform...
-
@Lindon That snippet I made is grabbing samples from the sampler's sample map, so I don't expect it would work when using the drag/drop thing.
-
@d-healey said in AudioWaveform - callback:
@Lindon That snippet I made is grabbing samples from the sampler's sample map, so I don't expect it would work when using the drag/drop thing.
Ok- but then I cant get it to do anything but show me the first (index 0) sample name - it wont show me the sample and thus I cant change its size...
So - lets say I use a widget (slider) to set the start and end values , first thing I would need is the actual real-world total length of the sample right? Any idea how to get that?
-
Yeah I couldn't get the waveform to show up either, think this is a bug or I'm not using it correctly.
You can get/set any sample property:
-
@d-healey said in AudioWaveform - callback:
Yeah I couldn't get the waveform to show up either, think this is a bug or I'm not using it correctly.
You can get/set any sample property:
no.... thats the value its been set to... not the actual start (which is always zero) and the actual sample length...
In order to work out where the end user wants to set the sample start and end I need to know the actual total real-world length of the sample itself, and use that to set the sample-start and sample-end based on teh widge tIm using to set this - dont I? Or can you thank of another way of doing this?
-
@Lindon Hmmm I see what you mean. It would be good if there was a .length property here. I assume it's not too difficult to add but I know Christoph is super busy at the moment so I wouldn't rely on it appearing any time soon.
However I just noticed this
-
@d-healey Ok that might be useful... if I was using a loop player- but Im using a sampler...
right well lets assume the AudioWaveform widget is setting the start and end points, and now I just need to save these for this sample in some sliderpack (actually Im using a panel data object but same thing..).
Now all I need to do before saving the preset is update this information to the current setting, so I know the sampler and I know the index of the sample.. so I assume I need to use this?
Sampler.getSoundProperty(int propertyIndex, int soundIndex)
Only as usual - theres no documentation about the property index anywhere I can see....any clues?
-
@Lindon Oh yeah, stupid me, I was thinking it was the same as the audiowaveform.
Sampler.getSoundProperty(int propertyIndex, int soundIndex)
Yeah it's a bit complicated, you might want to make a separate project to experiment with this.
I haven't used it for a while, but my approach was to create a selection using the
.createSelection()
function. And then perform the actions directly on the sample with.get
. -
@d-healey Okay well I've go this far:
const var Sampler1 = Synth.getSampler("Sampler1"); inline function onPresetSaveControl(component, value) { local f = Sampler1.createSelection(".*"); local m = f[0]; Console.print(m.get(1)); };
where I come upon the usual problem of trying to execute this call:
Sample.get(int propertyIndex)
when I have no idea what the property indexes are....anyone know where to find these? -specifically I need the SampleStart and SampleEnd
-
@Lindon Type Sampler. and the property constants will appear in the auto complete as in my earlier screenshot
-
@d-healey -okay thanks, got it - I was applying this in the wrong spot, so for those of you looking here's how to find the sample end for a given sample index
const var Sampler1 = Synth.getSampler("Sampler1"); inline function onPresetSaveControl(component, value) { local f = Sampler1.createSelection(".*"); Console.print(f[0].get(Sampler1.SampleEnd)); }; Content.getComponent("PresetSave").setControlCallback(onPresetSaveControl);
-
@Lindon -- Okay so I badly need this to get fixed if we can please....I'm trying work arounds with timers etc. but really not working so well I'm afraid...