[PD-dev] Re: setting the sample rate from an external (Pontus Nyman)

Pontus Nyman f97-pny at nada.kth.se
Thu Aug 5 14:36:46 CEST 2004


Hi all, hi Kjetil.

Kjetil Svalastog Matheussen wrote:

>I think so. If you look at the source for k_jack~ on sourceforge,
>I close and open audio to be able to change the number of input
>and output channels. And the function to open audio includes a parameter
>to set the sample rate. This is code from k_jack~:
>
>static void set_pd_channels(int inc_ins,int inc_outs){
>  int num_recs=sys_get_inchannels();
>  int num_plays=sys_get_outchannels();
>
>  int t1[1]={0};
>  int t2[1]={0};
>  int t3[1]={num_recs+inc_ins};
>  int t4[1]={num_plays+inc_outs};
>  sys_close_audio();
>  sys_open_audio(1,t1,
> 1,t3,
> 1,t2,
> 1,t4,
> sys_getsr(),sys_schedadvance/1000,1);
>}
>
>
>Note that although the function works now, I don't know how long its
>going to last.
>  
>
This is exactly what I was looking for. The problem now is that I get 
linking errors. It seems as if sys_close_audio() and sys_open_audio() 
cannot be found in pd.lib. I looked in the makefile for k_jack~ and it 
does nothing that I don't do. I use pd version 0.37.1. Am I doing 
something wrong or doesn't this work anymore?

/Pontus




More information about the Pd-dev mailing list