chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] C_truep( C_fixnump( w ))


From: Heinrich Taube
Subject: Re: [Chicken-users] C_truep( C_fixnump( w ))
Date: Sun, 24 Feb 2008 12:28:22 -0600

hmmm it has nothing to do with the C_truep( C_fixnump( w )) test -- even if the else clause is empty it still crashes if the data are NOT floats. im sure this must be something stupid but i dont understand why it crashes if its not float data


#>
#include "Csound.h"
void cs_event (int type, int len, C_word lyst) {
//  MYFLT buf[len];
  printf("IN CS_EVENT, BEFORE LOOP LEN=%d\n", len);
  int i=0;
  for (; C_SCHEME_END_OF_LIST != lyst; lyst = C_u_i_cdr( lyst ) ) {
    if (i==len) break;
    C_word w = C_u_i_car( lyst );
    if (C_truep( C_flonump( w ) )) {
      printf("FLO: buf[%d]=%f\n", i++, (float)C_flonum_magnitude( w ));
    }
    else {
    }
  }
// ((GraceApp *)GraceApp::getInstance())->getCsoundPort()- >sendEvent(typ, len, buf);
}

<#

(define (cs:i . args)
  (if (not (null? args))
      ((foreign-lambda void "cs_event" int int scheme-object)
       1
       (length args)
       args))
  (values))

---------------------------------------

(cs:i 1.0 0.0 1.0 60.0 1000.0)

IN CS_EVENT, BEFORE LOOP LEN=5
FLO: buf[0]=1.000000
FLO: buf[1]=0.000000
FLO: buf[2]=1.000000
FLO: buf[3]=60.000000
FLO: buf[4]=1000.000000


(cs:i 1 0 1 60 1000)

<<<CRASH>>>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]