Пример #1
0
static void audiosettings_setparams(t_audiosettings *x, t_symbol*s, int argc, t_atom*argv) {
/*
  PLAN:
    several messages that accumulate to a certain settings, and then "apply" them
*/
  int apply=1;
  int advance=0;
  t_paramtype param=PARAM_INVALID;

  audiosettings_params_init (x); /* re-initialize to what we got */

  advance=audiosettings_setparams_next(argc, argv);
  while((argc-=advance)>0) {
    argv+=advance;
    s=atom_getsymbol(argv);
    param=audiosettings_setparams_id(s);

    argv++;
    argc--;

    switch(param) {
    case PARAM_RATE:
      advance=audiosettings_setparams_rate(x, argc, argv);
      break;
    case PARAM_ADVANCE:
      advance=audiosettings_setparams_advance(x, argc, argv);
      break;
    case PARAM_CALLBACK:
      advance=audiosettings_setparams_callback(x, argc, argv);
      break;
    case PARAM_INPUT:
      advance=audiosettings_setparams_input(x, argc, argv);
      break;
    case PARAM_OUTPUT:
      advance=audiosettings_setparams_output(x, argc, argv);
      break;
    default:
      pd_error(x, "unknown parameter"); postatom(1, argv);endpost();
      break;
    }

    argc-=advance;
    argv+=advance;
    advance=audiosettings_setparams_next(argc, argv);
  }
  if(apply) {
    audiosettings_params_apply(x);
  }
}
Пример #2
0
void zexy_setup(void) 
{
  int i;

  startpost("\n\t");
  for (i=0; i<28; i++) startpost("%c", HEARTSYMBOL);
  endpost();
  post("\t%c the zexy external  "VERSION" %c", HEARTSYMBOL, HEARTSYMBOL);
  post("\t%c (l)  forum::für::umläute %c", HEARTSYMBOL, HEARTSYMBOL);
  post("\t%c       iem   @  kug       %c", HEARTSYMBOL, HEARTSYMBOL);
  post("\t%c  compiled:  "__DATE__"  %c", HEARTSYMBOL, HEARTSYMBOL);
  post("\t%c send me a 'help' message %c", HEARTSYMBOL, HEARTSYMBOL);
  startpost("\t");
  for (i=0; i<28; i++) startpost("%c", HEARTSYMBOL);
  endpost(); endpost();
  
  zexy_class = class_new(gensym("zexy"), zexy_new, 0, sizeof(t_zexy), 0, 0);
  class_addmethod(zexy_class, zexy_help, gensym("help"), 0);

  zexy_register("zexy");

  /* ************************************** */
  z_zexy_setup();
}
Пример #3
0
Файл: index.c Проект: Tzero2/pd
static void index_helper(t_index *x)
{
  endpost();
  post("%c index :: index symbols to indices", HEARTSYMBOL);
  post("<symbol>             : look up the <symbol> in the index and return it's index");
  post("<int>                : look up the element at index <int> in the index");
  post("'add <symbol>'       : add a new symbol to the index-map");
  post("'add <symbol> <int>' : add a new symbol at the index <int>");
  post("'delete <symbol>'    : delete a symbol from the index-map");
  post("'delete <int>'       : delete the entry at index <int> from the index-map");
  post("'reset'              : delete the whole index-map");
  post("'bang'               : return the number of entries in the index-map");
  post("'dump'               : dump each entry in the format \"list <symbol> <index>\"");
  post("'compact'            : remove holes in the index-map");
  endpost();
  post("'sort'               : alphabetically sort the entries");
  post("'auto <1/0>          : if auto is 1 and a yet unknown symbol is looked up it is\n\t\t\t automatically added to the index-map");
  post("'resize <1/0>        : if resize is 1 (default), the index-map is resized\n\t\t\t automatically if needed");
  post("'help'               : view this");
  post("outlet : <n>         : index of the <symbol>");
  post("         <symbol>    : entry at <index>");
  endpost();
  post("creation:\"index [<maxelements> [<auto>]]\": creates a <maxelements> sized index");
}
Пример #4
0
/*-------------------------------------------------------------
 * print()
 */
static void holmes_mask_print(t_holmes_mask *x)
{
  int i, j;
  for (i=0; i < 3; i++) {
    if (i == 0) startpost("holmes_mask:");
    else        startpost("            ");
    for (j=0; j < 10 && (i*10+j) < num_Features; j++) {
      startpost(" %s=%d",
		FeatureNames[i*10+j],
		((x->x_mask & Features[i*10+j]) ? 1 : 0));
    }
    endpost();
  }
  post("            = %ld", x->x_mask);
}
Пример #5
0
/////////////////////////////////////////////////////////
// add backends
//
/////////////////////////////////////////////////////////
bool pix_record :: addHandle( std::vector<std::string>available, std::string ID)
{
  unsigned int i=0;
  int count=0;

  std::vector<std::string>id;
  if(!ID.empty()) {
    // if requested 'cid' is in 'available' add it to the list of 'id's
    if(std::find(available.begin(), available.end(), ID)!=available.end()) {
      id.push_back(ID);
    } else {
      // request for an unavailable ID
      logpost(NULL, 6, "backend '%s' unavailable", ID.c_str());
      return false;
    }
  } else {
    // no 'ID' given: add all available IDs
    id=available;
  }

  for(i=0; i<id.size(); i++) {
    std::string key=id[i];
    logpost(NULL, 6, "trying to add '%s' as backend", key.c_str());
    if(std::find(m_ids.begin(), m_ids.end(), key)==m_ids.end()) {
      // not yet added, do so now!
      gem::plugins::record         *handle=NULL;
      startpost("backend #%d='%s'\t", m_allhandles.size(), key.c_str());
      try {
	handle=gem::PluginFactory<gem::plugins::record>::getInstance(key); 
      } catch (GemException ex) {
      }
      if(NULL==handle) { 
	post("<--- DISABLED");
	break;
      }
      endpost();

      m_ids.push_back(key);
      m_allhandles.push_back(handle);
      count++;
      logpost(NULL, 6, "added backend#%d '%s' @ 0x%x", m_allhandles.size()-1, key.c_str(), handle);
    }
  }

  return (count>0);
}
Пример #6
0
static void audiosettings_testdevices(t_audiosettings *x)
{
  int i;

  char indevlist[MAXNDEV][DEVDESCSIZE], outdevlist[MAXNDEV][DEVDESCSIZE];
  int indevs = 0, outdevs = 0, canmulti = 0, cancallback = 0;

  if(0) {
    pd_error(x, "this should never happen");
  }
 
  sys_get_audio_devs((char*)indevlist, &indevs, (char*)outdevlist, &outdevs, &canmulti,
                &cancallback, MAXNDEV, DEVDESCSIZE);

  post("%d indevs", indevs);
  for(i=0; i<indevs; i++)
    post("\t#%02d: %s", i, indevlist[i]);

  post("%d outdevs", outdevs);
  for(i=0; i<outdevs; i++)
    post("\t#%02d: %s", i, outdevlist[i]);

  post("multi: %d\tcallback: %d", canmulti, cancallback);

  endpost();

  int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV];
  int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV];
  int rate, advance, callback, blocksize;
  as_get_audio_params(&naudioindev, audioindev, chindev,
                       &naudiooutdev, audiooutdev, choutdev, 
                       &rate, &advance, &callback, &blocksize);
  
  post("%d audioindev (parms)", naudioindev);
  for(i=0; i<naudioindev; i++) {
    post("\t#%02d: %d %d", i, audioindev[i], chindev[i]);
  }
  post("%d audiooutdev (parms)", naudiooutdev);
  for(i=0; i<naudiooutdev; i++) {
    post("\t#%02d: %d %d", i, audiooutdev[i], choutdev[i]);
  }
  post("rate=%d\tadvance=%d\tcallback=%d\tblocksize=%d", rate, advance, callback, blocksize);

}
Пример #7
0
void binbuf_add(t_binbuf *x, int argc, t_atom *argv)
{
    int newsize = x->b_n + argc, i;
    t_atom *ap;
    if((ap = t_resizebytes(x->b_vec, x->b_n * sizeof(*x->b_vec),
	newsize * sizeof(*x->b_vec))))
	    x->b_vec = ap;
    else
    {
    	error("binbuf_addmessage: out of space");
    	return;
    }
#if 0
    startpost("binbuf_add: ");
    postatom(argc, argv);
    endpost();
#endif
    for (ap = x->b_vec + x->b_n, i = argc; i--; ap++)
    	*ap = *(argv++);
    x->b_n = newsize;
}
Пример #8
0
void pix_video :: driverMess() {
  // a little bit of info
  if(m_videoHandle) {
    post("current driver: '%s'", m_videoHandle->getName().c_str());
  }
  if(m_videoHandles.size()>1) {
    unsigned int i=0;
    post("available drivers:");
    for(i=0; i<m_videoHandles.size(); i++) {
      gem::plugins::video*handle= m_videoHandles[i];
      if(NULL==handle)continue;
      startpost("\t'%s' provides ", handle->getName().c_str());
      std::vector<std::string>backends=handle->provides();
      unsigned int j=0;
      for(j=0; j<backends.size(); j++) {
        startpost("'%s' ", backends[j].c_str());
      }
      if(j==0)startpost("<nothing>");
      endpost();
    }
  }
}
Пример #9
0
static void zexy_help(void)
{
  endpost(); endpost(); 
  post("...this is the zexy %c external "VERSION"...", HEARTSYMBOL);
  endpost();
  post("%c handling signals", HEARTSYMBOL);
#if 0
  post("streamout~\t:: stream signals via a LAN : (%c) gige 1999");
  post("streamin~\t:: catch signals from a LAN : based on gige");
#endif
  post("sfplay\t\t:: play back a (multichannel) soundfile : (c) ritsch 1999");
  post("sfrecord\t:: record a (multichannel) soundfile : based on ritsch");

  endpost(); post("%c generating signals", HEARTSYMBOL);
  post("noish~\t\t:: generate bandlimited noise");
  post("noisi~\t\t:: generate bandlimited noise");
  post("dirac~\t\t:: generate a dirac-pulse");
  post("step~\t\t:: generate a unity-step");
  post("dfreq~\t\t:: detect frequency by counting zero-crossings : (c) ritsch 1998");

  endpost(); post("%c manipulating signals", HEARTSYMBOL);
  post("limiter~\t:: limit/compress one or more signals");
  post("nop~\t\t:: pass through a signal (delay 1 block)");
  post("z~\t\t:: samplewise delay");
  post("swap~\t\t:: byte-swap a signal");
  post("quantize~\t:: quantize a signal");

  endpost(); post("%c binary operations on signals", HEARTSYMBOL);
  post("abs~, sgn~, >~, <~, ==~, &&~, ||~");

  endpost(); post("%c multary operations on signals", HEARTSYMBOL);
  post("multiline~\t:: multiple line~ multiplication");
  post("multiplex~\t:: multiplex 1 inlet~ to 1-of-various outlet~s");
  post("demultiplex~\t:: demultiplex 1-of-various inlet~s to 1 outlet~");

  endpost(); post("%c investigating signals in message-domain", HEARTSYMBOL);
  post("pack~\t\t:: convert a signal into a list of floats");
  post("unpack~\t\t:: convert packages of floats into a signal");

  post("sigzero~\t:: indicates whether a signal is zero throughout the block");
  post("avg~\t\t:: outputs average of a signal as float");
  post("tavg~\t\t:: outputs average of a signal between two bangs");
  post("envrms~\t\t:: an env~-object that ouputs rms instead of db");
  post("pdf~\t\t:: power density function");
       
  endpost(); post("%c basic message objects", HEARTSYMBOL);
  post("nop\t\t:: a no-operation");
  post("lister\t\t:: stores lists");
  post("any2list\t\t:: converts \"anything\" to lists");
  post("list2int\t:: cast each float of a list to integer");
  post("atoi\t\t:: convert ascii to integer");
  post("list2symbol\t:: convert a list into a single symbol");
  post("symbol2list\t:: split a symbol into a list");
  post("strcmp\t\t:: compare 2 lists as if they where strings");
  post("repack\t\t:: (re)packs atoms to packages of a given size");
  post("packel\t\t:: element of a package");
  post("length\t\t:: length of a package");
  post("niagara\t\t:: divide a package into 2 sub-packages");
  post("glue\t\t:: append a list to another");
  post("repeat\t\t:: repeat a message");
  post("segregate\t:: sort inputs by type");
  post(".\t\t:: scalar multiplication of vectors (lists of floats)");

  endpost(); post("%c advanced message objects", HEARTSYMBOL);
  post("tabread4\t:: 4-point interpolating table-read object");
  post("tabdump\t\t:: dump the table as a list");
  post("tabset\t\t:: set a table with a list");
  post("mavg\t\t:: a variable moving average filter");
  post("mean\t\t:: get the arithmetic mean of a vector");
  post("minmax\t\t:: get the minimum and the maximum of a vector");
  post("makesymbol\t:: creates (formatted) symbols");
  post("date\t\t:: get the current system date");
  post("time\t\t:: get the current system time");
  post("index\t\t:: convert symbols to indices");
  post("drip\t\t:: converts a package to a sequence of atoms");
  post("sort\t\t:: shell-sort a package of floats");
  post("demux\t\t:: demultiplex the input to a specified output");
  post("msgfile\t\t:: store and handles lists of lists");
  post("lp\t\t:: write to the (parallel) port");
  post("wrap\t\t:: wrap a floating number between 2 limits");
  post("urn\t\t:: unique random numbers");
  post("operating_system\t:: information on the OS");

  endpost(); post("\n(l) forum::für::umläute except where indicated");
  post("this software is released under the GnuGPL that is provided with these files");
  endpost();
}
Пример #10
0
/* LATER analyse various cases of mixed (midi/nonmidi) binbufs and try to
   find a better way of adjusting time in such cases */
static int mfbb_parse(t_binbuf *x, t_mifi_stream *stp, t_squtt *tt,
		      t_mfbb_parsinghook hook)
{
    t_mifi_event *evp = stp->s_auxeve;
    t_mfbb_parsinghook thehook = (hook ? hook : mfbb_analyse_hook);
    int natoms = x->b_n;
    t_atom *ap= x->b_vec;
    uint32 thisticks = 0, pastticks = 0;
    int track, hookresult;
    t_symbol *tname = 0;

    if (!hook)
    {
	/* LATER make sure we are called after mifi_stream_new()
	   or after reinitialization */
    }
    while (natoms >= MFBB_PARTICLE_SIZE)
    {
	t_atom *ap1 = ap;
	t_float f, delaytime = 0;
	if (ap1->a_type != A_FLOAT || (delaytime = ap1->a_w.w_float) < 0)
	    goto nextmessage;
	ap1++;
#if 1  /* assume folded time */
	thisticks += (uint32)(delaytime * stp->s_timecoef);
#else  /* but keep unfolded version ready */
	thisticks = (uint32)(delaytime * stp->s_timecoef);
#endif
	if (!(track = squtt_checkatom(tt, ap1)))
	    goto nextmessage;
	tname = ap1->a_w.w_symbol;
	ap1++;
	if (mfbb_parse_status(ap1, evp)) ap1++;
	else goto nextmessage;
	if (mfbb_parse_data(ap1, evp, 0)) ap1++;
	else goto nextmessage;
	if (MIFI_ONE_DATABYTE(evp->e_status))
	{
	    if (mfbb_parse_channel(ap1, evp)) ap1++;
	    else goto nextmessage;
	    evp->e_data[1] = 0, ap1++;  /* accept this being just anything... */
	}
	else {
	    if (mfbb_parse_data(ap1, evp, 1)) ap1++;
	    else goto nextmessage;
	    if (mfbb_parse_channel(ap1, evp)) ap1++;
	    else goto nextmessage;
	}
	if (ap1->a_type != A_SEMI)  /* ...but this is required */
	    goto nextmessage;

	evp->e_delay = thisticks - pastticks;
	if (!(hookresult = thehook(stp, evp, track, tname)))
	    return (0);
	if (hookresult > 0) pastticks = thisticks;

	natoms -= MFBB_PARTICLE_SIZE;
	ap += MFBB_PARTICLE_SIZE;
	continue;

    nextmessage:
#ifdef MFBB_DEBUG
	if (!hook)
	{  /* print this only once, i.e. during a default (analysis) pass */
	    startpost("skip"); postatom(1, ap);
	    poststring("with"); postatom(6, ap+1);
	    poststring("bad"); postatom(1, ap1);
	    endpost();
	}
#endif
	while (natoms-- > MFBB_PARTICLE_SIZE && (ap++)->a_type != A_SEMI);
    }
    return (1);
}
Пример #11
0
    /* this is broken now... used to work when "timestamp" was derived from
    	QueryPerformanceCounter() instead of the gates approved 
	    timeGetSystemTime() call in the MIDI callback routine below. */
    return (nt_tixtotime(timestamp) - nt_hibuftime);
}
#endif	    /* MIDI_TIMESTAMP */


static int nt_fill = 0;
#define WRAPFWD(x) ((x) >= nt_naudiobuffer ? (x) - nt_naudiobuffer: (x))
#define WRAPBACK(x) ((x) < 0 ? (x) + nt_naudiobuffer: (x))
#define MAXRESYNC 500

#if 0 	    /* this is used for debugging */
static void nt_printaudiostatus(void)
{
    int nad, nda;
    for (nad = 0; nad < nt_nwavein; nad++)
    {
    	int phase = ntsnd_inphase[nad];
    	int phase2 = phase, phase3 = WRAPFWD(phase2), count, ntrans = 0;
    	int firstphasedone = -1, firstphasebusy = -1;
    	for (count = 0; count < nt_naudiobuffer; count++)
    	{
    	    int donethis =
    	    	(ntsnd_invec[nad][phase2].lpWaveHdr->dwFlags & WHDR_DONE);
    	    int donenext =
    	    	(ntsnd_invec[nad][phase3].lpWaveHdr->dwFlags & WHDR_DONE);
    	    if (donethis && !donenext)
    	    {
    	    	if (firstphasebusy >= 0) goto multipleadc;
    	    	firstphasebusy = count;
    	    }
    	    if (!donethis && donenext)
    	    {
    	    	if (firstphasedone >= 0) goto multipleadc;
    	    	firstphasedone = count;
    	    }
    	    phase2 = phase3;
    	    phase3 = WRAPFWD(phase2 + 1);
    	}
    	post("nad %d phase %d busy %d done %d", nad, phase, firstphasebusy,
    	    firstphasedone);
    	continue;
    multipleadc:
	startpost("nad %d phase %d: oops:", nad, phase);
	for (count = 0; count < nt_naudiobuffer; count++)
	{
    	    char buf[80];
    	    sprintf(buf, " %d", 
    		(ntsnd_invec[nad][count].lpWaveHdr->dwFlags & WHDR_DONE));
    	    poststring(buf);
	}
	endpost();
    }
    for (nda = 0; nda < nt_nwaveout; nda++)
    {
    	int phase = ntsnd_outphase[nad];
    	int phase2 = phase, phase3 = WRAPFWD(phase2), count, ntrans = 0;
    	int firstphasedone = -1, firstphasebusy = -1;
    	for (count = 0; count < nt_naudiobuffer; count++)
    	{
    	    int donethis =
    	    	(ntsnd_outvec[nda][phase2].lpWaveHdr->dwFlags & WHDR_DONE);
    	    int donenext =
    	    	(ntsnd_outvec[nda][phase3].lpWaveHdr->dwFlags & WHDR_DONE);
    	    if (donethis && !donenext)
    	    {
    	    	if (firstphasebusy >= 0) goto multipledac;
    	    	firstphasebusy = count;
    	    }
    	    if (!donethis && donenext)
    	    {
    	    	if (firstphasedone >= 0) goto multipledac;
    	    	firstphasedone = count;
    	    }
    	    phase2 = phase3;
    	    phase3 = WRAPFWD(phase2 + 1);
    	}
    	if (firstphasebusy < 0) post("nda %d phase %d all %d",
    	    nda, phase, (ntsnd_outvec[nad][0].lpWaveHdr->dwFlags & WHDR_DONE));
    	else post("nda %d phase %d busy %d done %d", nda, phase, firstphasebusy,
    	    firstphasedone);
    	continue;
    multipledac:
	startpost("nda %d phase %d: oops:", nda, phase);
	for (count = 0; count < nt_naudiobuffer; count++)
	{
    	    char buf[80];
    	    sprintf(buf, " %d", 
    		(ntsnd_outvec[nad][count].lpWaveHdr->dwFlags & WHDR_DONE));
    	    poststring(buf);
	}
	endpost();
    }
}
Пример #12
0
static void *array_define_new(t_symbol *s, int argc, t_atom *argv)
{
    t_symbol *arrayname = &s_;
    float arraysize = 100;
    t_glist *x;
    int keep = 0;
    float ylo = -1, yhi = 1;
    float xpix = 500, ypix = 300;
    while (argc && argv->a_type == A_SYMBOL &&
        *argv->a_w.w_symbol->s_name == '-')
    {
        if (!strcmp(argv->a_w.w_symbol->s_name, "-k"))
            keep = 1;
        else if (!strcmp(argv->a_w.w_symbol->s_name, "-yrange") &&
            argc >= 3 && argv[1].a_type == A_FLOAT &&
                argv[2].a_type == A_FLOAT)
        {
            ylo = atom_getfloatarg(1, argc, argv);
            yhi = atom_getfloatarg(2, argc, argv);
            if (ylo == yhi)
                ylo = -1, yhi = 1;
            argc -= 2; argv += 2;
        }
        else if (!strcmp(argv->a_w.w_symbol->s_name, "-pix") &&
            argc >= 3 && argv[1].a_type == A_FLOAT &&
                argv[2].a_type == A_FLOAT)
        {
            if ((xpix = atom_getfloatarg(1, argc, argv)) < 10)
                xpix = 10;
            if ((ypix = atom_getfloatarg(2, argc, argv)) < 10)
                ypix = 10;
            argc -= 2; argv += 2;
        }
        else
        {
            error("array define: unknown flag ...");
            postatom(argc, argv); endpost();
        }
        argc--; argv++;
    }
    if (argc && argv->a_type == A_SYMBOL)
    {
        arrayname = argv->a_w.w_symbol;
        argc--; argv++;
    }
    if (argc && argv->a_type == A_FLOAT)
    {
        arraysize = argv->a_w.w_float;
        argc--; argv++;
    }
    if (argc)
    {
        post("warning: array define ignoring extra argument: ");
        postatom(argc, argv); endpost();
    }
    x = (t_glist *)table_donew(arrayname, arraysize, keep, xpix, ypix);

        /* bash the class to "array define".  We don't do this earlier in
        part so that canvas_getcurrent() will work while the glist and
        garray are being created.  There may be other, unknown side effects. */
    x->gl_obj.ob_pd = array_define_class;
    array_define_yrange(x, ylo, yhi);
    outlet_new(&x->gl_obj, &s_pointer);
    return (x);
}
Пример #13
0
void cyclone_setup(void)
{

    /* -- post cyclone lib version -- */
    {
        post("------------------------------------------------------------------");
        post("CYCLONE Library 0.3; A sub library containing the objects:");
        post("[!-], [!-~], [!/], [!/~], [!=~], [%%~], [+=~], [<=~], [<~], [==~], [>=~] and [>~]");
        post("------------------------------------------------------------------");
    }
    endpost();
    endpost();
    endpost();
    endpost();

    /* -- [!-] -- */

    rminus_class = class_new(gensym("!-"),
                             (t_newmethod)rminus_new, 0,
                             sizeof(t_rev_op), 0, A_DEFFLOAT, 0);
    class_addbang(rminus_class, rminus_bang);
    class_addfloat(rminus_class, rminus_float);
    class_sethelpsymbol(rminus_class, gensym("rminus"));

    /* -- [!/] -- */

    rdiv_class = class_new(gensym("!/"),
                           (t_newmethod)rdiv_new, 0,
                           sizeof(t_rev_op), 0, A_DEFFLOAT, 0);
    class_addbang(rdiv_class, rdiv_bang);
    class_addfloat(rdiv_class, rdiv_float);
    class_sethelpsymbol(rdiv_class, gensym("rdiv"));

    /* -- [==~] -- */

    equals_class = class_new(gensym("==~"),
                             (t_newmethod)equals_new, (t_method)equals_free,
                             sizeof(t_equals), CLASS_DEFAULT, A_DEFFLOAT, 0);
    class_addmethod(equals_class, nullfn, gensym("signal"), 0);
    class_addmethod(equals_class, (t_method)equals_dsp, gensym("dsp"), A_CANT, 0);
    class_sethelpsymbol(equals_class, gensym("equals~"));

    /* -- [!=~] -- */

    notequals_class = class_new(gensym("!=~"), (t_newmethod)notequals_new,
                                (t_method)notequals_free, sizeof(t_notequals), CLASS_DEFAULT, A_DEFFLOAT, 0);
    class_addmethod(notequals_class, nullfn, gensym("signal"), 0);
    class_addmethod(notequals_class, (t_method)notequals_dsp, gensym("dsp"), A_CANT, 0);
    class_sethelpsymbol(notequals_class, gensym("notequals~"));

    /* -- [<~] -- */

    lessthan_class = class_new(gensym("<~"), (t_newmethod)lessthan_new,
                               (t_method)lessthan_free, sizeof(t_lessthan), CLASS_DEFAULT, A_DEFFLOAT, 0);
    class_addmethod(lessthan_class, nullfn, gensym("signal"), 0);
    class_addmethod(lessthan_class, (t_method)lessthan_dsp, gensym("dsp"), A_CANT, 0);
    class_sethelpsymbol(lessthan_class, gensym("lessthan~"));

    /* -- [>~] -- */

    greaterthan_class = class_new(gensym(">~"), (t_newmethod)greaterthan_new,
                                  (t_method)greaterthan_free, sizeof(t_greaterthan), CLASS_DEFAULT, A_DEFFLOAT, 0);
    class_addmethod(greaterthan_class, nullfn, gensym("signal"), 0);
    class_addmethod(greaterthan_class, (t_method)greaterthan_dsp, gensym("dsp"), A_CANT, 0);
    class_sethelpsymbol(greaterthan_class, gensym("greaterthan~"));

    /* -- [<=~] -- */

    lessthaneq_class = class_new(gensym("<=~"), (t_newmethod)lessthaneq_new,
                                 (t_method)lessthaneq_free, sizeof(t_lessthaneq), CLASS_DEFAULT, A_DEFFLOAT, 0);
    class_addmethod(lessthaneq_class, nullfn, gensym("signal"), 0);
    class_addmethod(lessthaneq_class, (t_method)lessthaneq_dsp, gensym("dsp"), A_CANT, 0);
    class_sethelpsymbol(lessthaneq_class, gensym("lessthaneq~"));

    /* -- [>=~] -- */

    greaterthaneq_class = class_new(gensym(">=~"), (t_newmethod)greaterthaneq_new,
                                    (t_method)greaterthaneq_free, sizeof(t_greaterthaneq), CLASS_DEFAULT, A_DEFFLOAT, 0);
    class_addmethod(greaterthaneq_class, nullfn, gensym("signal"), 0);
    class_addmethod(greaterthaneq_class, (t_method)greaterthaneq_dsp, gensym("dsp"), A_CANT, 0);
    class_sethelpsymbol(greaterthaneq_class, gensym("greaterthaneq~"));

    /* -- [!-~] -- */

    rminus_tilde_class = class_new(gensym("!-~"), (t_newmethod)rminus_tilde_new,
                                   (t_method)rminus_tilde_free, sizeof(t_rminus_tilde), CLASS_DEFAULT, A_DEFFLOAT, 0);
    class_addmethod(rminus_tilde_class, nullfn, gensym("signal"), 0);
    class_addmethod(rminus_tilde_class, (t_method)rminus_tilde_dsp, gensym("dsp"), A_CANT, 0);
    class_sethelpsymbol(rminus_tilde_class, gensym("rminus~"));

    /* -- [!/~] -- */

    rdiv_tilde_class = class_new(gensym("!/~"), (t_newmethod)rdiv_tilde_new,
                                 (t_method)rdiv_tilde_free, sizeof(t_rdiv_tilde), CLASS_DEFAULT, A_DEFFLOAT, 0);
    class_addmethod(rdiv_tilde_class, nullfn, gensym("signal"), 0);
    class_addmethod(rdiv_tilde_class, (t_method)rdiv_tilde_dsp, gensym("dsp"), A_CANT, 0);
    class_sethelpsymbol(rdiv_tilde_class, gensym("rdiv~"));

    /* -- [%~] -- */

    modulo_class = class_new(gensym("%~"), (t_newmethod)modulo_new,
                             (t_method)modulo_free, sizeof(t_modulo), CLASS_DEFAULT, A_DEFFLOAT, 0);
    class_addmethod(modulo_class, nullfn, gensym("signal"), 0);
    class_addmethod(modulo_class, (t_method)modulo_dsp, gensym("dsp"), A_CANT, 0);
    class_sethelpsymbol(modulo_class, gensym("modulo~"));

    /* -- [+=~] -- */

    plusequals_class = class_new(gensym("+=~"), (t_newmethod)plusequals_new, 0,
                                 sizeof(t_plusequals), 0, A_DEFFLOAT, 0);
    class_addmethod(plusequals_class, nullfn, gensym("signal"), 0);
    class_addmethod(plusequals_class, (t_method) plusequals_dsp, gensym("dsp"), 0);
    class_addbang(plusequals_class, plusequals_bang);
    class_addmethod(plusequals_class, (t_method)plusequals_set, gensym("set"), A_FLOAT, 0);
    class_sethelpsymbol(plusequals_class, gensym("plusequals~"));

}
Пример #14
0
void number_post(t_pd_obj_number *x)
{
  startpost("%s",*x->x_sym);
  postfloat(*x->x_number);
  endpost();
}