Beispiel #1
0
void split_path_setup(void)
{
    split_path_class = class_new(gensym("split_path"), (t_newmethod)split_path_new, 0,
				sizeof(t_split_path), 0,0);
    class_addsymbol(split_path_class,split_path_symbol);
    logpost(NULL, 4, "[split_path] %s",version);  
    logpost(NULL, 4, "\twritten by Hans-Christoph Steiner <*****@*****.**>");
}
Beispiel #2
0
static void sys_loadstartup(void)
{
    char startupdir[PATH_MAX];
    struct stat statbuf;

    strncpy(startupdir, sys_libdir->s_name, PATH_MAX - 8);
    strcat(startupdir, "/startup");
    if (stat(startupdir, &statbuf) == 0 && statbuf.st_mode & S_IFDIR)
    {
        DIR* dirp;
        struct dirent *dp;
        struct stat statbuf;
        char buf[PATH_MAX];
        char* extension;
        logpost(NULL, 5, "Using %s as startup.", startupdir);
        dirp = opendir(startupdir);
        while ((dp = readdir(dirp)) != NULL)
        {
            if(strcmp(".", dp->d_name) == 0 || strcmp("..", dp->d_name) == 0)
                continue;
            strncpy(buf, startupdir, PATH_MAX - 1);
            strcat(buf, "/");
            strncat(buf, dp->d_name, PATH_MAX - strlen(buf) - 1);
#ifdef _WIN32
            char resolved_path[PATH_MAX];
            strncpy(resolved_path, buf, PATH_MAX);
#elif defined(__gnu_linux__) || defined(__AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER)
            /* safe, non-standard format of realpath(), with NULL resolved_name */
            char* tmp = realpath(buf, NULL);
            char resolved_path[strlen(tmp)];
            strcpy(resolved_path, tmp);
            free(tmp);
#else
            char resolved_path[PATH_MAX];
            realpath(buf, resolved_path);
#endif /* _WIN32 elif __gnu_linux__ */
            stat(resolved_path, &statbuf);
            if (S_ISREG(statbuf.st_mode))
            {
                logpost(NULL, 4, "Loading %s", buf);
                /* remove the extension for sys_load_lib() */
                extension = strrchr(resolved_path, '.');
                if (extension != NULL)
                    *extension = 0;
                if (!sys_load_lib(0, resolved_path))
                    error("%s: can't load startup library'!\n", buf);
            }
            else if (S_ISDIR(statbuf.st_mode))
            {
                /* try lib-in-folder style, i.e. mylib/mylib.pd_linux */
                logpost(NULL, 4, "Loading %s in %s", dp->d_name, buf);
                if (!sys_load_lib(0, dp->d_name))
                    error("%s: can't load startup library'!\n", buf);
            }
        }
        (void)closedir(dirp);
    }
}
Beispiel #3
0
/////////////////////////////////////////////////////////
// add backends
//
/////////////////////////////////////////////////////////
bool pix_video :: 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::video         *handle=NULL;
      startpost("backend #%d='%s'\t", m_videoHandles.size(), key.c_str());
      try {
	handle=gem::PluginFactory<gem::plugins::video>::getInstance(key); 
      } catch (GemException ex) {
      }
      if(NULL==handle) { 
	post("<--- DISABLED");
        continue;
      }
      std::vector<std::string>devs=handle->provides();
      if(devs.size()>0) {
	startpost(": ");
	unsigned int i=0;
	for(i=0; i<devs.size(); i++) {
	  startpost("%s ", devs[i].c_str());
	}
      }
      endpost();

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

  return (count>0);
}
Beispiel #4
0
void libdir_setup(void)
{
    int major, minor, bugfix;
    sys_getversion(&major, &minor, &bugfix);
    if (major>0 || minor >=47) {
      sys_register_loader((void*)libdir_loader_pathwise);
    } else {
      sys_register_loader((void*)libdir_loader_legacy);
    }
    logpost(NULL, 3, "libdir loader %s",version);
    logpost(NULL, 3, "\tcompiled on "__DATE__" at "__TIME__ " ");
    logpost(NULL, 3, "\tcompiled against Pd version %d.%d.%d.%s",
            PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION, PD_TEST_VERSION);
    libdir_class = class_new(gensym("libdir"), libdir_new, 0, sizeof(t_object), CLASS_NOINLET, 0);
}
Beispiel #5
0
void unroute_setup(void)
{
    unroute_class = class_new(gensym("unroute"), (t_newmethod)unroute_new,
    	0, sizeof(t_unroute), 0, A_GIMME, 0);
#else
void maxlib_unroute_setup(void)
{
    unroute_class = class_new(gensym("maxlib/unroute"), (t_newmethod)unroute_new,
    	0, sizeof(t_unroute), 0, A_GIMME, 0);
#endif
		/* a class for the proxy inlet: */
	proxy_class = class_new(gensym("maxlib/unroute_proxy"), NULL, NULL, sizeof(t_proxy),
		CLASS_PD|CLASS_NOINLET, A_NULL);

	class_addanything(proxy_class, unroute_input);

    class_addfloat(unroute_class, unroute_float);
    class_addlist(unroute_class, unroute_list);
    class_addanything(unroute_class, unroute_any);
#ifndef MAXLIB
    
    logpost(NULL, 4, version);
#else
	class_addcreator((t_newmethod)unroute_new, gensym("unroute"), A_GIMME, 0);
    class_sethelpsymbol(unroute_class, gensym("maxlib/unroute-help.pd"));
#endif
}
Beispiel #6
0
/////////////////////////////////////////////////////////
// startRendering
//
/////////////////////////////////////////////////////////
void GemMan :: startRendering()
{
  if (!m_windowState)
    {
      error("GEM: Create window first!");
      return;
    }
    
  if (m_rendering)
    return;
    
  logpost(NULL, 3, "GEM: Start rendering");
    
  // set up all of the gemheads
  renderChain(gensym("__gem_render"), true);
  renderChain(gensym("__gem_render_osd"), true);

  m_rendering = 1;
    
  // if only single buffering then just return
  if (GemMan::m_buffer == 1)
    return;

  m_lastRenderTime = clock_getsystime();
  render(NULL);
}
Beispiel #7
0
/////////////////////////////////////////////////////////
//
// polygon
//
/////////////////////////////////////////////////////////
// Constructor
//
/////////////////////////////////////////////////////////
polygon :: polygon(t_floatarg numInputs)
  : GemShape(), 
    m_numVertices(0),
    m_vertarray(NULL),
    m_vert(NULL), 
    m_numInputs(0),
    m_inlet(NULL)
{
  int i;
  int realNum = static_cast<int>(numInputs);

  // configure the inlets
	if(realNum>0) {
		createVertices(realNum);
		
		m_numInputs=realNum;
		m_inlet=new t_inlet*[m_numInputs];
		
		char tempVt[7];
		// create the proper number of inputs
		for (i = 0; i < realNum; i++) {
			sprintf(tempVt, "%d", i+1);
			m_inlet[i]=inlet_new(this->x_obj, &this->x_obj->ob_pd, &s_list, gensym(tempVt) );
		}
	} else {
		logpost(NULL, 5, "variable number of vertices");
	}
}
Beispiel #8
0
void exciter_setup(void)
{
    logpost(NULL, 4,  exciter_version );
    exciter_class = class_new(gensym("exciter"), (t_newmethod)exciter_new,
                              (t_method)exciter_free, sizeof(t_exciter), 0, A_GIMME, 0);
    class_addmethod(exciter_class, (t_method)exciter_dialog, gensym("dialog"), A_GIMME, 0);
    class_addmethod(exciter_class, (t_method)exciter_dump, gensym("dump"), 0);
    class_addmethod(exciter_class, (t_method)exciter_clear, gensym("clear"), 0);
    class_addmethod(exciter_class, (t_method)exciter_start, gensym("start"), 0);
    class_addmethod(exciter_class, (t_method)exciter_stop, gensym("stop"), 0);
    class_addmethod(exciter_class, (t_method)exciter_reset, gensym("reset"), 0);
    class_addmethod(exciter_class, (t_method)exciter_pause, gensym("pause"), 0);
    class_addmethod(exciter_class, (t_method)exciter_resume, gensym("resume"), 0);
    class_addmethod(exciter_class, (t_method)exciter_dsp, gensym("dsp"), A_NULL);
    exciter_widgetbehavior.w_getrectfn =    exciter_getrect;
    exciter_widgetbehavior.w_displacefn =   exciter_displace;
    exciter_widgetbehavior.w_selectfn =     exciter_select;
    exciter_widgetbehavior.w_activatefn =   NULL;
    exciter_widgetbehavior.w_deletefn =     exciter_delete;
    exciter_widgetbehavior.w_visfn =        exciter_vis;
    exciter_widgetbehavior.w_clickfn =      exciter_click;

#if PD_MINOR_VERSION >= 37
    class_setpropertiesfn(exciter_class, exciter_properties);
    class_setsavefn(exciter_class, exciter_save);
#else
    exciter_widgetbehavior.w_propertiesfn = exciter_properties;
    exciter_widgetbehavior.w_savefn =       exciter_save;
#endif

    class_setwidget(exciter_class, &exciter_widgetbehavior);

    sys_vgui("eval [read [open {%s/%s.tcl}]]\n",
             exciter_class->c_externdir->s_name, exciter_class->c_name->s_name);
}
Beispiel #9
0
void dist_setup(void)
{
    dist_class = class_new(gensym("dist"), (t_newmethod)dist_new, 0,
    	sizeof(t_dist), 0, A_GIMME, 0);
#else
void maxlib_dist_setup(void)
{
    dist_class = class_new(gensym("maxlib_dist"), (t_newmethod)dist_new, 0,
    	sizeof(t_dist), 0, A_GIMME, 0);
#endif
    class_addcreator((t_newmethod)dist_new, gensym("d"), A_GIMME, 0);
    class_addbang(dist_class, dist_bang);
    class_addfloat(dist_class, dist_float);
    class_addsymbol(dist_class, dist_symbol);
    class_addpointer(dist_class, dist_pointer);
    class_addlist(dist_class, dist_list);
	class_addmethod(dist_class, (t_method)dist_connect, gensym("connect"), A_GIMME, 0);
	class_addmethod(dist_class, (t_method)dist_disconnect, gensym("disconnect"), A_GIMME, 0);
	class_addmethod(dist_class, (t_method)dist_clear, gensym("clear"), 0);
	class_addmethod(dist_class, (t_method)dist_print, gensym("print"), 0);
	class_addmethod(dist_class, (t_method)dist_send, gensym("send"), A_GIMME, 0);
    class_addanything(dist_class, dist_anything);
#ifndef MAXLIB
	
    logpost(NULL, 4, version);
#else
	class_addcreator((t_newmethod)dist_new, gensym("dist"), A_GIMME, 0);
	class_sethelpsymbol(dist_class, gensym("maxlib/dist-help.pd"));
#endif
}
Beispiel #10
0
/////////////////////////////////////////////////////////
// enumerate devices
//
/////////////////////////////////////////////////////////
void pix_video :: enumerateMess()
{
  std::vector<std::string>data;
  std::vector<std::string>backends;
  unsigned int i=0; 
  for(i=0; i<m_videoHandles.size(); i++) {
    //    a.insert(a.end(), b.begin(), b.end());
    if(m_videoHandles[i]) {
      std::string name=m_videoHandles[i]->getName();
      logpost(NULL, 5, "enumerating: %s", name.c_str());
      std::vector<std::string>temp=m_videoHandles[i]->enumerate();
      unsigned int i=0;
      for(i=0; i<temp.size(); i++) {
        backends.push_back(name);
        data.push_back(temp[i]);
      }
    }
  }
  if(data.size()<=0) {
    error("no devices found");
  }

  t_atom ap[2];
  SETFLOAT(ap, data.size());
  outlet_anything(m_infoOut, gensym("devices"), 1, ap);
  for(i=0; i<data.size(); i++) {
    SETSYMBOL(ap+0, gensym(data[i].c_str()));
    SETSYMBOL(ap+1, gensym(backends[i].c_str()));
    outlet_anything(m_infoOut, gensym("device"), 2, ap);
    //    post("%d: %s", i, data[i].c_str());
  }
}
Beispiel #11
0
void nroute_setup(void)
{
	/* the object's class: */
    nroute_class = class_new(gensym("nroute"), (t_newmethod)nroute_new,
    	0, sizeof(t_nroute), 0, A_GIMME, 0);
#else
void maxlib_nroute_setup(void)
{
	/* the object's class: */
    nroute_class = class_new(gensym("maxlib/nroute"), (t_newmethod)nroute_new,
    	0, sizeof(t_nroute), 0, A_GIMME, 0);
	class_addcreator((t_newmethod)nroute_new, gensym("nroute"), A_GIMME, 0);
#endif
	/* a class for the proxy inlet: */
	proxy_class = class_new(gensym("maxlib/nroute_proxy"), NULL, NULL, sizeof(t_proxy),
		CLASS_PD|CLASS_NOINLET, A_NULL);

	class_addmethod(nroute_class, (t_method)nroute_setpos, gensym("right"), A_FLOAT, 0);
    class_addfloat(nroute_class, nroute_float);
	class_addlist(nroute_class, nroute_list);
	class_addanything(nroute_class, nroute_any);
	class_addanything(proxy_class, nroute_setmatch);
#ifndef MAXLIB
    
    logpost(NULL, 4, version);
#else
    class_sethelpsymbol(nroute_class, gensym("maxlib/nroute-help.pd"));
#endif
}
Beispiel #12
0
Datei: sync.c Projekt: jondf/pd
void sync_setup(void)
{
    sync_class = class_new(gensym("sync"), (t_newmethod)sync_new,
                           0, sizeof(t_sync), 0, A_GIMME, 0);
#else
void maxlib_sync_setup(void)
{
    sync_class = class_new(gensym("maxlib_sync"), (t_newmethod)sync_new,
                           0, sizeof(t_sync), 0, A_GIMME, 0);
#endif
    /* a class for the proxy inlet: */
    proxy_class = class_new(gensym("maxlib_sync_proxy"), NULL, NULL, sizeof(t_proxy),
                            CLASS_PD|CLASS_NOINLET, A_NULL);

    class_addfloat(proxy_class, sync_float_input);
    class_addanything(proxy_class, sync_input);

    class_addfloat(sync_class, sync_float);
    class_addmethod(sync_class, (t_method)sync_set_trigger, gensym("trigger"), A_GIMME, 0);
    class_addmethod(sync_class, (t_method)sync_set_require, gensym("require"), A_GIMME, 0);
    class_addmethod(sync_class, (t_method)sync_set_mode, gensym("mode"), A_SYMBOL, 0);
#ifndef MAXLIB

    logpost(NULL, 4, version);
#else
    class_addcreator((t_newmethod)sync_new, gensym("sync"), A_GIMME, 0);
    class_sethelpsymbol(sync_class, gensym("maxlib/sync-help.pd"));
#endif
}
Beispiel #13
0
/////////////////////////////////////////////////////////
// spits out a list of installed codecs and stores them
//
/////////////////////////////////////////////////////////
void pix_record :: getCodecList()
{
  m_pimpl->clearCodecHandle();
  unsigned int i=0;
  for(i=0; i<m_handles.size(); i++) {
    std::vector<std::string>c=m_handles[i]->getCodecs();
    unsigned int j;
    for(j=0; j<c.size(); j++) {
      m_pimpl->addCodecHandle(m_handles[i], c[j]);
    }
  }
  for(i=0; i<m_pimpl->m_codecs.size(); i++) {
    const std::string id=m_pimpl->m_codecs[i];
    std::vector<PIMPL::codechandle>handles=m_pimpl->m_codechandle[id];
    unsigned int j=0;
    for(j=0; j<handles.size(); j++) {
      gem::plugins::record*handle=handles[j].handle;

      const std::string codecname=handles[j].codec;
      const std::string descr=handle->getCodecDescription(codecname);
      t_atom ap[3];

      logpost(NULL, 6, "codec%d: '%s': %s", i, codecname.c_str(), (descr.empty()?"":descr.c_str()));
      SETFLOAT (ap+0, static_cast<t_float>(i));
      SETSYMBOL(ap+1, gensym(codecname.c_str()));
      SETSYMBOL(ap+2, gensym(descr.c_str()));
      outlet_anything(m_outInfo, gensym("codec"), 3, ap);
    }
  }
}
Beispiel #14
0
static void colorpanel_list(t_colorpanel *x, t_symbol *s, int argc, t_atom *argv)
{
    t_symbol *tmp_symbol = s; /* <-- this gets rid of the unused variable warning */
    int i;
    unsigned int tmp_int;
    char color_buffer[3];
    char color_string[MAXPDSTRING];

    strncpy(color_string,"#",MAXPDSTRING);
    if(argc > 3) 
        logpost(x, 2, "[colorpanel] warning more than three elements in list");
    for(i=0; i<3; i++)
    {
        tmp_symbol = atom_getsymbolarg(i, argc, argv);
        if(tmp_symbol == &s_)
        {
            tmp_int = (unsigned int)(atom_getfloatarg(i, argc , argv) * 255);
            snprintf(color_buffer, 3, "%02x", (tmp_int > 255 ? 255 : tmp_int));
            strncat(color_string, color_buffer, 3);
        }
        else 
        {
            pd_error(x,"[colorpanel] symbols are not allowed in the color list");
            return;
        }
    }
    memcpy(x->current_color, color_string, 7);
    colorpanel_bang(x);
}
Beispiel #15
0
void netserver_setup(void)
{
   netserver_class = class_new(gensym("netserver"),(t_newmethod)netserver_new, (t_method)netserver_free,
							   sizeof(t_netserver), 0, A_DEFFLOAT, 0);
   class_addmethod(netserver_class, (t_method)netserver_print, gensym("print"), 0);
   class_addmethod(netserver_class, (t_method)netserver_send, gensym("send"), A_GIMME, 0);
   class_addmethod(netserver_class, (t_method)netserver_client_send, gensym("client"), A_GIMME, 0);
   class_addmethod(netserver_class, (t_method)netserver_broadcast, gensym("broadcast"), A_GIMME, 0);
/* syslog log level messages */
   class_addmethod(netserver_class, (t_method)netserver_emerg, gensym("emerg"), 0);
   class_addmethod(netserver_class, (t_method)netserver_emerg, gensym("emergency"), 0);
   class_addmethod(netserver_class, (t_method)netserver_alert, gensym("alert"), 0);
   class_addmethod(netserver_class, (t_method)netserver_crit, gensym("crit"), 0);
   class_addmethod(netserver_class, (t_method)netserver_crit, gensym("critical"), 0);
   class_addmethod(netserver_class, (t_method)netserver_err, gensym("err"), 0);
   class_addmethod(netserver_class, (t_method)netserver_err, gensym("error"), 0);
   class_addmethod(netserver_class, (t_method)netserver_err, gensym("quiet"), 0);
   class_addmethod(netserver_class, (t_method)netserver_warning, gensym("warning"), 0);
   class_addmethod(netserver_class, (t_method)netserver_notice, gensym("notice"), 0);
   class_addmethod(netserver_class, (t_method)netserver_info, gensym("info"), 0);
   class_addmethod(netserver_class, (t_method)netserver_info, gensym("verbose"), 0);
   class_addmethod(netserver_class, (t_method)netserver_debug, gensym("debug"), 0);
   
   
   logpost(NULL, 4, version);
}
Beispiel #16
0
/* print settings */
static void mp3streamout_print(t_mp3streamout *x)
{
    const char        * buf = 0;

    logpost(NULL, 4, mp3streamout_version);
    post("  LAME mp3 settings:\n"
         "    output sample rate: %d Hz\n"
         "    bitrate: %d kbit/s", x->x_samplerate, x->x_bitrate);
    switch(x->x_mp3mode)
    {
    case 0 :
        buf = "stereo";
        break;
    case 1 :
        buf = "joint stereo";
        break;
    case 2 :
        buf = "dual channel";
        break;
    case 3 :
        buf = "mono";
        break;
    }
    post("    mode: %s\n"
         "    quality: %d", buf, x->x_mp3quality);
#ifdef _WIN32
    if(x->x_lamechunk!=0)post("    calculated mp3 chunk size: %d", x->x_lamechunk);
#else
    post("    mp3 chunk size: %d", x->x_lamechunk);
#endif
    if(x->x_samplerate!=sys_getsr())
    {
        post("    resampling from %d to %d Hz!", (int)sys_getsr(), x->x_samplerate);
    }
}
 double BLSSS::find_posterior_mode() {
   BinomialLogitUnNormalizedLogPosterior logpost(m_, pri_.get());
   const Selector &inc(m_->coef().inc());
   Vector beta(m_->included_coefficients());
   int dim = beta.size();
   if (dim == 0) {
     return negative_infinity();
     // TODO: This logic prohibits an empty model.  Better to return
     // the actual value of the un-normalized posterior, which in
     // this case would just be the likelihood portion.
   } else {
     Vector gradient(dim);
     Matrix hessian(dim, dim);
     double logf;
     std::string error_message;
     bool ok = max_nd2_careful(beta,
                               gradient,
                               hessian,
                               logf,
                               Target(logpost),
                               dTarget(logpost),
                               d2Target(logpost),
                               1e-5,
                               error_message);
     if (ok) {
       m_->set_included_coefficients(beta, inc);
       return logf;
     } else {
       return negative_infinity();
     }
   }
 }
Beispiel #18
0
void pix_video :: getPropertyMess(int argc, t_atom*argv)
{
  if(argc) {
    int i=0;
    m_readprops.clear();

    for(i=0; i<argc; i++) {
      addProperties(m_readprops, 1, argv+i);
    }

  } else {
    /* LATER: read all properties */
  }

  t_atom ap[4];
  if(m_videoHandle) {
    m_videoHandle->getProperties(m_readprops);
    std::vector<std::string>keys=m_readprops.keys();
    unsigned int i=0;
    for(i=0; i<keys.size(); i++) {
      std::string key=keys[i];
      SETSYMBOL(ap+0, gensym(key.c_str()));
      int ac=0;
      switch(m_readprops.type(key)) {
      default:
      case gem::Properties::UNSET: 
        ac=0; 
        break;
      case gem::Properties::NONE:  
        ac=1; 
        break;
      case gem::Properties::DOUBLE:
        do {
          double d=0;
          if(m_readprops.get(key, d)) {
            ac=2;
            SETFLOAT(ap+1, d);
          }
        } while(0);
        break;
      case gem::Properties::STRING:
        do {
          std::string s;
          if(m_readprops.get(key, s)) {
            ac=2;
            SETSYMBOL(ap+1, gensym(s.c_str()));
          }
        } while(0);
        break;
      }	    
      if(ac) {
        outlet_anything(m_infoOut, gensym("prop"), ac, ap);
      } else {
        post("oops: %s", key.c_str());
      }
    }
  } else {
    logpost(NULL, 5, "no open videodevice...remembering properties...");
  }
}
Beispiel #19
0
void pix_video :: applyPropertiesMess()
{
  if(m_videoHandle) {
    m_videoHandle->setProperties(m_writeprops);
  } else {
    logpost(NULL, 5, "no open videodevice...remembering properties...");
  }
}
Beispiel #20
0
void pitch_setup(void)
{
    pitch_class = class_new(gensym("pitch"), (t_newmethod)pitch_new,
    	0, sizeof(t_pitch), 0, A_DEFFLOAT, 0);
    class_addfloat(pitch_class, pitch_float);
    
    logpost(NULL, 4, version);
}
Beispiel #21
0
void remote_setup(void)
{
    remote_class = class_new(gensym("remote"), (t_newmethod)remote_new, 0,
    	sizeof(t_remote), 0, A_DEFSYM, 0);
    class_addanything(remote_class, remote_anything);
	
    logpost(NULL, 4, version);
}
Beispiel #22
0
void netrec_setup(void)
{
    netrec_class = class_new(gensym("netrec"),(t_newmethod)netrec_new, (t_method)netrec_free,
    	sizeof(t_netrec), 0, A_DEFFLOAT, A_DEFFLOAT, A_DEFSYM, 0);
	class_addmethod(netrec_class, (t_method)netrec_print, gensym("print"), 0);
	
    logpost(NULL, 4, version);
}
 void SLLTPS::draw_nu_slope() {
   NuPosteriorFast logpost(nu_slope_prior_.get(),
                           &model_->nu_slope_complete_data_suf());
   ScalarSliceSampler sampler(logpost, true);
   sampler.set_lower_limit(0.0);
   double nu = sampler.draw(model_->nu_slope());
   model_->set_nu_slope(nu);
 }
Beispiel #24
0
void edge_setup(void)
{
    edge_class = class_new(gensym("edge"), (t_newmethod)edge_new,
    	0, sizeof(t_edge), 0, A_DEFFLOAT, 0);
    class_addfloat(edge_class, edge_float);
    
    logpost(NULL, 4, version);
}
Beispiel #25
0
void listfifo_setup(void)
{
    listfifo_class = class_new(gensym("listfifo"), (t_newmethod)listfifo_new,
                               (t_method)listfifo_free, sizeof(t_listfifo), 0, A_DEFFLOAT, 0);
    class_addbang(listfifo_class, listfifo_bang);
    class_addlist(listfifo_class, listfifo_list);

    logpost(NULL, 4, version);
}
Beispiel #26
0
static void *hoa_new(t_symbol *s)
{
    t_eobj *x = (t_eobj *)eobj_new(cream_class);
    if(x)
    {
        logpost(x, 3, "HOA Library by Pierre Guillot, Eliott Paris & Thomas Le Meur\n© 2013 - 2015  CICM | Paris 8 University\nVersion %s (%s) for Pure Data %i.%i\n",hoaversion, __DATE__, PD_MAJOR_VERSION, PD_MINOR_VERSION);
    }
    return (x);
}
Beispiel #27
0
void listfunnel_setup(void)
{
    listfunnel_class = class_new(gensym("listfunnel"), (t_newmethod)listfunnel_new,
    	0, sizeof(t_listfunnel), 0, 0, 0);
    class_addfloat(listfunnel_class, listfunnel_float);
    class_addlist(listfunnel_class, listfunnel_list);
    
    logpost(NULL, 4, version);
}
Beispiel #28
0
void countund_setup(void)
{
    logpost(NULL, 4, countund_version);
    countund_class = class_new(gensym("countund"), (t_newmethod)countund_new,
                               (t_method)countund_free,
                               sizeof(t_countund), 0, A_DEFFLOAT, 0);
    class_addmethod( countund_class, (t_method)countund_bang, &s_bang, 0);
    class_addmethod( countund_class, (t_method)countund_limit, gensym("limit"), A_FLOAT, 0);
}
Beispiel #29
0
void plus_setup(void)
{
    plus_class = class_new(gensym("plus"), (t_newmethod)plus_new,
    	0, sizeof(t_plus), 0, A_GIMME, 0);
    class_addfloat(plus_class, plus_float);
    class_addmethod(plus_class, (t_method)plus_ft1, gensym("ft1"), A_FLOAT, 0);
	class_addbang(plus_class, (t_method)plus_bang);
    
    logpost(NULL, 4, version);
}
Beispiel #30
0
static void itov_set(t_itov *x, t_float lo, t_float hi, t_float nbins)
{
	if (nbins<1)
	{
		nbins=1;
		logpost(x, 2, "[itov] minimum number of bins is 1");
	}
	if (hi<=lo)
	{
		logpost(x, 2, "[itov] higher bound (%g) must be higher than lower bound (%g)",
                hi, lo);	
		hi=lo+1.0f;
	}

	x->m_hi=hi;
	x->m_lo=lo;
	x->m_nbins=(int)nbins;
	x->m_scale=(t_float)x->m_nbins/(hi-lo);
}