Cabbage Logo
Back to Cabbage Site

Save presets with soundfiler widget

Hello!

I would like to ask a question about the drag&drop function of the “soundfiler” widgets. I’ve been watching this video https://www.youtube.com/watch?v=2u-ETiLsAKQ&t=3027s and reading information on the “Soundfiler” widget getting ideas from there to do something that I think it’s interesting if it could be done. Using the “The next power of 2” example I shared earlier instead of using a “filebutton” to load the file I have replaced it with a “soundfiler” to be able to drag&drop. I have then limited the mouse coordinates where that screen is located to drag the samples into the screen and it has worked fine.

What I could not do is save the presets. They are saved and loaded without any error in the console but it seems that the reference to the directory is not saved. I think this has some logic because the last file that was dragged on the screen is the information that remains working but the path of the file that was being used when the preset was saved is not saved. I’m not sure if this is a bug becasuse probably I´m missing something also. I wanted to ask if there is a way to do this? that is to say that the file path is saved when saving the preset and that when loading the preset the screen is also updated. I have tried several ways but I have not succeeded. With the “filebutton” saving the presets worked fine but with the “soundfiler” it seems to be different. I attach a simple example with this issue (the first). I also attach and example with “filebuttons” that works fine. This is what I would like to do with the “soundfiler” drag&drop, in that case it saves the presets and updates the screen.

Thank you very much and greetings.

Drag&drop.csd (1.9 KB)
Drag&Drop filebutton (OK).csd (1.9 KB)

Thanks for the sample files. I was able to track down the issue and I just push some code that should sort this. Can you test and let me know? I only had time to test and debug in plugin mode with a DAW, so let me know if you have any issues in the Cabbage IDE.

Thanks for looking at this issue. I have tried it in the Cabbage IDE and in a Daw and I have not noticed a difference. What I have noticed on both platforms is that now the presets do save the information of the samples regarding to the screen and update the screen correctly but these do not save the information of the audio files regarding to the sound reproduction. This means that when loading a saved preset the screen is updated but the sound does not change and the sound of the last sample that the user had loaded remains. If the plugin is opened from scratch in Cabbage or a daw and no audio file is dragged onto the screen the presets do not load the audios files, they just show the waveform on the screen. Unlike what happens in the second example (Drag&Drop+filebutton (OK).csd) that I uploaded, it uses a filebutton to load the sample. In that example both the screen and the sound of the audio samples are updated when loading the preset. I think that the best thing would be that, as in the example with the filebutton, the audio files for playback will also be updated when loading the presets.
I’m going to mention another little issue with soundfilers that I didn’t mention in the first post since it seemed minor compared to the issue with the presets but I’ll take the opportunity to mention it here. What I noticed is that when dragging the samples onto the screen if by mistake a sample is dragged off the screen then that same file cannot be dragged onto the screen again, in such a case it is necessary to drop it back onto the screen a sample with another name and then it is loaded correctly.

Right, my bad, I have to admit to marking this as fixed once I saw the waveform appear on session load :man_facepalming: I’ll take another look when I get a chance, most likely Monday at some point. :+1:

1 Like

I think this is issue is not with presets but how your trying to recall them. You’re trying to recall data based on a last_file_dropped event, which doesn’t get saved with the session and preset data. The solution here is to set the soundfiler “file” identifier each time the audio is updated. These file will be saved, and will be recalled. Can you try this modified version of you instrument?

CabbagePluginSynth.csd (2.0 KB)

Thank you very much for taking time to fix bugs and solve these kinds of doubts, I really appreciate it.
I suspected that it could be something like that but I had made several attempts and I would not have known how to solve it. I tested and it works now as I expected. Being able to drag and drop samples onto a screen feels cool and modern.
I think the only thing missing now to be perfect is what I mentioned before that if a file is dragged off the screen it can’t be loaded again until another file is loaded. Will there be chances that you can take a look at that when you have time? I suspect it´s a bug but I´m not sure if it is not something wrong in my code. Sorry for insisting on those little things but i’m a zodiac sign virgo and sometimes I can’t help it. :sweat_smile:

It’s kind of a bug because the file-dropped event is only picked up when there is a change. I’ll take a look. It might not be that easy but I’ll look into it. :+1:

Thanks, have a good week.