Csound Csound-dev Csound-tekno Search About

[Cs-dev] csoundGetChannelPtr dont sound

Date2009-01-13 04:40
Fromdavistro
Subject[Cs-dev] csoundGetChannelPtr dont sound
it's my problem,
 I can't play any sound with this code:

#include 
#include "csound/csound.h"

//performance thread function prototype
uintptr_t csThread(void *clientData);

//userData structure declaration
struct userData {
	int result;
	CSOUND* csound;
	int PERF_STATUS;
};

typedef struct userData UD;
typedef struct userData * PUD;


//------------------------------------------------------------
int main(int argc, char *argv[])
{
	int userInput=200;
	void* ThreadID;
	PUD ud;
//	struct userData *ud;

	ud = (struct userData *)malloc(sizeof(struct userData));
	MYFLT* pvalue;
	
	ud->csound=csoundCreate(NULL);
	csoundInitialize(&argc, &argv, 0);
	ud->result=csoundCompile(ud->csound,argc,argv);
	
	if(!ud->result)
   {
	   ud->PERF_STATUS=1;
	   ThreadID = csoundCreateThread(csThread, (void*)ud);
   }
	else{
		printf("csoundCompiled returned an error");
		return 0;
	}

	while(userInput!=0)
      {
      if(csoundGetChannelPtr(ud->csound, &pvalue, "pitch",
                      CSOUND_INPUT_CHANNEL | CSOUND_CONTROL_CHANNEL)==0);
	      *pvalue = (MYFLT)userInput;
	      scanf("%d", &userInput);
        }
	
	ud->PERF_STATUS=0;
	return ud->result;
}

//-------------------------------------------------------------
//definition of our performance thread function
	uintptr_t csThread(void *data)
{
         struct userData* udata = (struct userData*)data;
         if(!udata->result)
            {
                    while((csoundPerformKsmps(udata->csound) == 0)
                           &&(udata->PERF_STATUS==1));
                  csoundDestroy(udata->csound);
            }
         udata->PERF_STATUS = 0;
          return 1;
}
//--------------------------------------------------------------------------------------------

new alloc for instr 102:
B  0.000 ..  3.000 T  3.000 TT  3.000 M:      0.0
Score finished in csoundPerformKsmps().
inactive allocs returned to freespace
end of score.		   overall amps:      0.0
	   overall samples out of range:        0
0 errors in performance
Elapsed time at end of performance: real: 6.558s, CPU: 0.170s

I followed the roryWalsh manual, but when I change to the channel value, it
shows 0 in the amp option

does exist any command that I forgot? or Do I need to declare  the channel
in other point in the code? I'm using a basic program to generate a senoidal
signal and, as the manual says, I'm only modifying the frequenci value

 By the way, I'm using csound5.1

Thanks, David
-- 
View this message in context: http://www.nabble.com/csoundGetChannelPtr-dont-sound-tp21429389p21429389.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-01-13 17:35
From"Rory Walsh"
SubjectRe: [Cs-dev] csoundGetChannelPtr dont sound
AttachmentsNone  

Date2009-01-14 06:28
Fromjpff
SubjectRe: [Cs-dev] csoundGetChannelPtr dont sound
If you only output sound to a channel,and have no out opcodes then
the amplitude will sow as zero as that measures the amplitude of out
only.  There is no knowledge of the channels by that tracing.
new alloc for instr 102:
B  0.000 ..  3.000 T  3.000 TT  3.000 M:      0.0
                                               ^^_from out opcode
==John ffitch

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-01-14 10:22
FromVictor Lazzarini
SubjectRe: [Cs-dev] csoundGetChannelPtr dont sound
you will need to use printk (or other similar opcode) to display
the value of a control variable.

At 06:28 14/01/2009, you wrote:
>If you only output sound to a channel,and have no out opcodes then
>the amplitude will sow as zero as that measures the amplitude of out
>only.  There is no knowledge of the channels by that tracing.
>new alloc for instr 102:
>B  0.000 ..  3.000 T  3.000 TT  3.000 M:      0.0
>                                                ^^_from out opcode
>==John ffitch
>
>------------------------------------------------------------------------------
>This SF.net email is sponsored by:
>SourcForge Community
>SourceForge wants to tell your story.
>http://p.sf.net/sfu/sf-spreadtheword
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2009-01-16 02:40
Fromdavistro
SubjectRe: [Cs-dev] csoundGetChannelPtr dont sound
I could fix the problem, and was the version of Csound which I installed
double and needed the floating, link found in the answer that I should look
better
http://www.nabble.com/chnget-not-working---Csound-API-question-td10320754.html#a10326032

 but thank you all for your answers

David


-- 
View this message in context: http://www.nabble.com/csoundGetChannelPtr-dont-sound-tp21429389p21491308.html
Sent from the Csound - Dev mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net