Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Fw: Csound API Question?

Date2010-11-07 23:08
From"Art Hunkins"
SubjectRe: [Cs-dev] Fw: Csound API Question?
In my FileMix XO activity, I've finally got Python/Sugar to pass filenames 
referenced by the Journal, to my .csd (via chnget).

Now that the filename is gotten, Csound can't manage to do anything with it; 
neither diskin2 nor diskinfo (via filenchnls, filelen, filepeak) can open it 
to read it.

Is there something that needs additionally to be done in Python or Csound to 
open the file for reading?

I've tested both an OGG file created by the Record activity and the stereo 
beats.wav from the Csound distro. Accessed from the Journal both play fine 
from both the Browse and Jukebox activities.

Art Hunkins

----- Original Message ----- 
From: "Art Hunkins" 
To: 
Sent: Friday, November 05, 2010 1:39 PM
Subject: Re: [Cs-dev] Fw: Csound API Question?


> Victor,
>
> The str() conversion you suggested works just fine; problem solved - 
> thanks.
>
> One more question:
> I need to pass a value (val) to my Choose() function, something like this:
>
>   but5 = win.cbbutton(nbox, self.choose(val = 0), "1")
>
> def choose(self, widget, val):
>  chooser =  ObjectChooser(self, what_filter=mime.GENERIC_TYPE_AUDIO)
>  result = chooser.run()
>  if result == gtk.RESPONSE_ACCEPT:
>    jobject = chooser.get_selected_object()
>    if jobject and jobject.file_path:
>      filename = jobject.file_path
>      self.filenames[val] = str(filename)
>
> This doesn't work; I get messages about choose() not being passed the 
> correct number of arguments (as in, I passed two instead of the three 
> arguments expected, whatever that means).
>
> Can you suggest a solution please? (I'm happy to modify my csndsugui code 
> if necessary.)
>
> Art Hunkins


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-11-08 08:11
FromVictor Lazzarini
SubjectRe: [Cs-dev] Fw: Csound API Question?
but what error messages do you get?

Victor
On 7 Nov 2010, at 23:08, Art Hunkins wrote:

> In my FileMix XO activity, I've finally got Python/Sugar to pass  
> filenames
> referenced by the Journal, to my .csd (via chnget).
>
> Now that the filename is gotten, Csound can't manage to do anything  
> with it;
> neither diskin2 nor diskinfo (via filenchnls, filelen, filepeak) can  
> open it
> to read it.
>
> Is there something that needs additionally to be done in Python or  
> Csound to
> open the file for reading?
>
> I've tested both an OGG file created by the Record activity and the  
> stereo
> beats.wav from the Csound distro. Accessed from the Journal both  
> play fine
> from both the Browse and Jukebox activities.
>
> Art Hunkins
>
> ----- Original Message -----
> From: "Art Hunkins" 
> To: 
> Sent: Friday, November 05, 2010 1:39 PM
> Subject: Re: [Cs-dev] Fw: Csound API Question?
>
>
>> Victor,
>>
>> The str() conversion you suggested works just fine; problem solved -
>> thanks.
>>
>> One more question:
>> I need to pass a value (val) to my Choose() function, something  
>> like this:
>>
>>  but5 = win.cbbutton(nbox, self.choose(val = 0), "1")
>>
>> def choose(self, widget, val):
>> chooser =  ObjectChooser(self, what_filter=mime.GENERIC_TYPE_AUDIO)
>> result = chooser.run()
>> if result == gtk.RESPONSE_ACCEPT:
>>   jobject = chooser.get_selected_object()
>>   if jobject and jobject.file_path:
>>     filename = jobject.file_path
>>     self.filenames[val] = str(filename)
>>
>> This doesn't work; I get messages about choose() not being passed the
>> correct number of arguments (as in, I passed two instead of the three
>> arguments expected, whatever that means).
>>
>> Can you suggest a solution please? (I'm happy to modify my  
>> csndsugui code
>> if necessary.)
>>
>> Art Hunkins
>
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net