Hello,
I couldnt google this little feature so ... if you 're already using it, sorry.
I just somehow wanted to contribute with something .
How to build Drag&Drop soundfiler.
1.
Fedora Core users reported the package tkdnd is available for tcl8.4 so you'll just have to fire up your package manager and install it.
For Debian based systems (including Ubuntu), you'll have to do a little command-fu. First, go to sourceforge and download the latest i386 rpm file. I know, you thought that you were done with rpms, but... you're not.
Open up a command line and issue the following commands as root in the directory that you downloaded it (probably ~/Desktop):
apt-get install alien
alien -d tkdnd*.rpm
dpkg --install tkdnd*.deb
2.
in a /usr/lib/pd/bin directory is pd.tk file
replace procedure pdtk_canvas_makeobjs with these lines:
proc pdtk_canvas_makeobjs {name files x y} {
set c 0
for {set n 0} {$n < [llength $files]} {incr n} {
set absolute [lindex $files $n]
if {[regexp {.*/(.+).pd$} $absolute file obj] == 1} {
pd $name obj $x [expr $y + ($c * 30)] [pdtk_enquote $obj] \;
incr c
} elseif {[regexp {.*/(.+).(wav|WAV|aiff|AIFF)$} $absolute file obj] == 1} {
set tmp [string trimleft $absolute "file:"]
set filename [file join / $tmp]
pd $name obj $x [expr $y + ($c * 30)] [concat "table " $obj \;]
pd PDTK_ondrop [concat "??????" $filename] $obj $x $y \;
incr c
}
}
}
That's it. Now you should be able to drop a soundfile on a patch and everything else should be done dynamically.
See included test patch to see how it works.
Hope someone will find it usefull.
Have a nice day.