Sampler with flooper2 and soundfiler

Hi,

I’m trying to make a sampler that supports drag and drop into soundfiler and allows for looping using flooper2. I’m having trouble loading in a sample to a table with ftgen and then recalling the soundfiler selection. Would love some guidance.

Thanks!

Cabbage Sampler.csd (4.0 KB)

Sorry for the delay in replying @Rafi_Mayer and welcome to the forum. You had some typos in your code that were causing compile time errors. The follow code will load the sound into the table for you:

instr GUI
    SFile, kFileChanged cabbageGet "LAST_FILE_DROPPED"
    printf SFile, kFileChanged
    cabbageSet kFileChanged, "soundfiler1", "file", SFile
    if kFileChanged == 1 then
        event "i", "LOAD_FILE", 0, .1
    endif
endin

instr LOAD_FILE
    SFile, kFileChanged cabbageGet "LAST_FILE_DROPPED"
    giFile    ftgen     0,  0,    0,    1,  SFile , 0,    0,      0
endin