Csound Csound-dev Csound-tekno Search About

[Csnd] browsing for files

Date2012-09-16 13:44
Fromralf
Subject[Csnd] browsing for files
Hello,

Sorry if this question has come up before, but i couldn't find any info and
got stuck with this so many times.

I need to know if theres an opcode or any way to browse audio files and to
get the path into csound. Something like [openpanel] in PD.
I am very Impressed with cabbage, and i am trying to make a VST/AU version
of the SchedkwhenGranulation.csd from Iain McCurdys realtime examples. 
I've noticed that the original version of it doesn't have a browser and
there's only three predefined sound files. But the CsoundQT version of it,
that is linked at Iain McCurdys site, has a file browser function. I can't
really seem to find it in its code though. It is basically just a CsQT
button widget named "_Browse" with a value of 1 that is linked to this:

Sfile	 invalue	"_Browse"

Somehow this opens up a browser panel. Is this file browsing option
exclusive to CsoundQT?
Can Cabbage itself maybe handle file browsing? Maybe even store the file
path with the host?

I am on OSX by the way.

Thanks for any advice,
Ralf



--
View this message in context: http://csound.1045644.n5.nabble.com/browsing-for-files-tp5715869.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-09-16 13:52
FromRory Walsh
SubjectRe: [Csnd] browsing for files
Not yet in Cabbage, but I can put one in for the next release(the code
is written). I'm sure that if there is one in CsoundQT then it can
definitely be used to load soundfile for playback. You probably just
need to pass the string retrieved from the file browse object to an
event in Csound using one of th event opcodes. Maybe something like
this:

Sfilename chnget "filename"
if(button is pressed) then
event "i", 1, 0, 10, Sfilename
endif


instr 1
a1 diskin2 p4, ....
out a1
endin


???
On 16 September 2012 13:44, ralf  wrote:
> Hello,
>
> Sorry if this question has come up before, but i couldn't find any info and
> got stuck with this so many times.
>
> I need to know if theres an opcode or any way to browse audio files and to
> get the path into csound. Something like [openpanel] in PD.
> I am very Impressed with cabbage, and i am trying to make a VST/AU version
> of the SchedkwhenGranulation.csd from Iain McCurdys realtime examples.
> I've noticed that the original version of it doesn't have a browser and
> there's only three predefined sound files. But the CsoundQT version of it,
> that is linked at Iain McCurdys site, has a file browser function. I can't
> really seem to find it in its code though. It is basically just a CsQT
> button widget named "_Browse" with a value of 1 that is linked to this:
>
> Sfile    invalue        "_Browse"
>
> Somehow this opens up a browser panel. Is this file browsing option
> exclusive to CsoundQT?
> Can Cabbage itself maybe handle file browsing? Maybe even store the file
> path with the host?
>
> I am on OSX by the way.
>
> Thanks for any advice,
> Ralf
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/browsing-for-files-tp5715869.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>

Date2012-09-16 14:17
Frompeiman khosravi
SubjectRe: [Csnd] browsing for files
Yes there is one in CsoundQT.

Just use a button with the channel name __Browse# where # is a user
defined number. Clicking on this will open the browser and pass the
path of the chosen file to Csound as a string:

Sfile		invalue	"_Browse2"
giFile		ftgen		0, 0, 0, -1, Sfile, 0, 0, 1

In WinXound you can just drag a file into the editor and its complete
path will be inserted into the code. You can also do alt+cmd+click on
a file path inside the editor to select the whole path (to delete it
for instance). Or cmd+click to open the file in the default external
application.

It would be very nice to have one in Cabbage too. But I always thought
that most hosts don't let plug-ins open an additional window (i.e. a
browser). In this case maybe an auto-populate menu would be useful in
cabbage.

P

On 16 September 2012 13:52, Rory Walsh  wrote:
> Not yet in Cabbage, but I can put one in for the next release(the code
> is written). I'm sure that if there is one in CsoundQT then it can
> definitely be used to load soundfile for playback. You probably just
> need to pass the string retrieved from the file browse object to an
> event in Csound using one of th event opcodes. Maybe something like
> this:
>
> Sfilename chnget "filename"
> if(button is pressed) then
> event "i", 1, 0, 10, Sfilename
> endif
>
>
> instr 1
> a1 diskin2 p4, ....
> out a1
> endin
>
>
> ???
> On 16 September 2012 13:44, ralf  wrote:
>> Hello,
>>
>> Sorry if this question has come up before, but i couldn't find any info and
>> got stuck with this so many times.
>>
>> I need to know if theres an opcode or any way to browse audio files and to
>> get the path into csound. Something like [openpanel] in PD.
>> I am very Impressed with cabbage, and i am trying to make a VST/AU version
>> of the SchedkwhenGranulation.csd from Iain McCurdys realtime examples.
>> I've noticed that the original version of it doesn't have a browser and
>> there's only three predefined sound files. But the CsoundQT version of it,
>> that is linked at Iain McCurdys site, has a file browser function. I can't
>> really seem to find it in its code though. It is basically just a CsQT
>> button widget named "_Browse" with a value of 1 that is linked to this:
>>
>> Sfile    invalue        "_Browse"
>>
>> Somehow this opens up a browser panel. Is this file browsing option
>> exclusive to CsoundQT?
>> Can Cabbage itself maybe handle file browsing? Maybe even store the file
>> path with the host?
>>
>> I am on OSX by the way.
>>
>> Thanks for any advice,
>> Ralf
>>
>>
>>
>> --
>> View this message in context: http://csound.1045644.n5.nabble.com/browsing-for-files-tp5715869.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>

Date2012-09-16 14:32
FromRory Walsh
SubjectRe: [Csnd] browsing for files
> It would be very nice to have one in Cabbage too. But I always thought
> that most hosts don't let plug-ins open an additional window (i.e. a
> browser). In this case maybe an auto-populate menu would be useful in
> cabbage.

This is why I left this feature out from the current version. I just
never got around to testing it with enough hosts. It worked with
Renoise without a problem. Actually the idea of loading samples at the
start of each session seems like a pain. An auto-populate combobox
with an option to set the root directory does seem like a nicer
option. Hmm. Good idea.

Date2012-09-16 15:06
Fromralf
Subject[Csnd] Re: browsing for files
Thanks a lot Peiman! That's the information i was looking for. 

I am very much looking forward to the next cabbage version!

cheers
Ralf




--
View this message in context: http://csound.1045644.n5.nabble.com/browsing-for-files-tp5715869p5715874.html
Sent from the Csound - General mailing list archive at Nabble.com.