Drag and drop an audio file out of supercollider

Is it possible to create a gui in SC that would allow drag and drop of an audio file to a DAW? I guess to be more clear, is it possible that grabbing a GUI element that contains a string representing a path to an audio file can somehow move that audio file to a DAW?

Yes - you can use the Class DragSource which is a GUI widget you can drag from.
See the help file for examples:

https://doc.sccode.org/Classes/DragSource.html

Best, paul

1 Like

I think the answer to this is no.

If I drag a file from a file browser to, say, a nysthi QuadSimpler module in VCV Rack, it knows this is a file and accepts the drag.

If I drag the file from a file browser to a DragBoth, the drag .object is a string with the path.

Then I can drag this path from the DragBoth to the sampler module, but it does not accept the string path in place of however the file browser represents the file.

This isn’t the problem – the problem is, what do you put into the drag source so that the other software will recognize it as a file? I don’t think we have an object for that currently.

hjh

Thank you for your replies. Paul, if you have a way that this works, can you please demonstrate?

I tried putting a SoundFile object there, but of course the DAW (Reaper) has no idea what that is. The DAW also is not happy with a string, because it is not how the browser represents the file. So, perhaps it is as hjh states … there may not be an object for the DragSource in SuperCollider that represents the audio file appropriately.

Of note, there exists a third party way to do this in Max. So, that leads me to think that some tinkering with Drag and Drop could allow it.

MaxDragAndDrop

The ultimate goal would be to create an interface that allows the selection of parts of an audio file that could then be dragged to a DAW. But, before all that, how to drag and drop a representation of the audio file that is valid?

1 Like

My mistake - I thought it just needed a string.
Best, Paul