Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11621
Modified Files: Tag: desiredata builtins.c Log Message: interleaved code of ctlout,midiout,pgmout
Index: builtins.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v retrieving revision 1.1.2.48 retrieving revision 1.1.2.49 diff -C2 -d -r1.1.2.48 -r1.1.2.49 *** builtins.c 24 Jul 2007 21:17:13 -0000 1.1.2.48 --- builtins.c 24 Jul 2007 23:09:40 -0000 1.1.2.49 *************** *** 2112,2145 **** }
- static t_class *midiout_class; void outmidi_byte(int portno, int byte); ! struct t_midiout : t_object { ! t_float portno; ! }; ! static void *midiout_new(t_floatarg portno) { ! t_midiout *x = (t_midiout *)pd_new(midiout_class); ! if (portno <= 0) portno = 1; ! x->portno = portno; ! floatinlet_new(x, &x->portno); ! #ifdef __irix__ ! post("midiout: unimplemented in IRIX"); ! #endif ! return x; ! } ! static void midiout_float(t_midiout *x, t_floatarg f){ ! outmidi_byte((int)x->portno-1, (int)f); ! } ! static void midiout_setup() { ! midiout_class = class_new2("midiout",midiout_new,0,sizeof(t_midiout),0,"FF"); ! class_addfloat(midiout_class, midiout_float); ! class_sethelpsymbol(midiout_class, gensym("midi")); ! }
- static t_class *noteout_class; - /* v=velocity */ - struct t_noteout : t_object { - t_float v; - t_float ch; - }; static void *noteout_new(t_floatarg channel) { t_noteout *x = (t_noteout *)pd_new(noteout_class); --- 2112,2120 ---- }
void outmidi_byte(int portno, int byte); ! static t_class *midiout_class; struct t_midiout : t_object {t_float portno;}; ! static t_class *noteout_class; struct t_noteout : t_object {t_float v; t_float ch;}; ! static t_class *ctlout_class; struct t_ctlout : t_object {t_float v; t_float ch;};
static void *noteout_new(t_floatarg channel) { t_noteout *x = (t_noteout *)pd_new(noteout_class); *************** *** 2150,2168 **** return x; } - static void noteout_float(t_noteout *x, t_float f) { - int binchan = max(0,(int)x->ch-1); - outmidi_noteon((binchan >> 4), (binchan & 15), (int)f, (int)x->v); - } - static void noteout_setup() { - noteout_class = class_new2("noteout",noteout_new,0,sizeof(t_noteout),0,"F"); - class_addfloat(noteout_class, noteout_float); - class_sethelpsymbol(noteout_class, gensym("midi")); - } - - static t_class *ctlout_class; - struct t_ctlout : t_object { - t_float v; /*ctl*/ - t_float ch; - }; static void *ctlout_new(t_floatarg v, t_floatarg channel) { t_ctlout *x = (t_ctlout *)pd_new(ctlout_class); --- 2125,2128 ---- *************** *** 2173,2176 **** --- 2133,2154 ---- return x; } + static void *midiout_new(t_floatarg portno) { + t_midiout *x = (t_midiout *)pd_new(midiout_class); + if (portno <= 0) portno = 1; + x->portno = portno; + floatinlet_new(x, &x->portno); + #ifdef __irix__ + post("midiout: unimplemented in IRIX"); + #endif + return x; + } + + static void midiout_float(t_midiout *x, t_floatarg f){ + outmidi_byte((int)x->portno-1, (int)f); + } + static void noteout_float(t_noteout *x, t_float f) { + int binchan = max(0,(int)x->ch-1); + outmidi_noteon((binchan >> 4), (binchan & 15), (int)f, (int)x->v); + } static void ctlout_float(t_ctlout *x, t_float f) { int binchan = (int)x->ch - 1; *************** *** 2178,2186 **** outmidi_controlchange((binchan >> 4), (binchan & 15), (int)x->v, (int)f); } - static void ctlout_setup() { - ctlout_class = class_new2("ctlout",ctlout_new,0,sizeof(t_ctlout),0,"FF"); - class_addfloat(ctlout_class, ctlout_float); - class_sethelpsymbol(ctlout_class, gensym("midi")); - }
static t_class *pgmout_class, *bendout_class, *touchout_class; --- 2156,2159 ---- *************** *** 2208,2219 **** outmidi_aftertouch(binchan>>4, binchan&15, (int)f); } - static void mido2_setup() { - pgmout_class = class_new2("pgmout", pgmout_new, 0, sizeof(t_pgmout), 0,"F"); - bendout_class = class_new2("bendout", bendout_new, 0, sizeof(t_bendout), 0,"F"); - touchout_class = class_new2("touchout", touchout_new, 0, sizeof(t_touchout), 0,"F"); - class_addfloat(pgmout_class, pgmout_float); class_sethelpsymbol(pgmout_class, gensym("midi")); - class_addfloat(bendout_class, bendout_float); class_sethelpsymbol(bendout_class, gensym("midi")); - class_addfloat(touchout_class, touchout_float); class_sethelpsymbol(touchout_class, gensym("midi")); - }
static t_class *polytouchout_class; --- 2181,2184 ---- *************** *** 2498,2506 **** midiin_setup(); notein_setup(); ctlin_setup(); midi2_setup(); /*pgmin,bendin,touchin*/ polytouchin_setup(); midirealtimein_setup(); midiclkin_setup(); ! midiout_setup(); noteout_setup(); ctlout_setup(); mido2_setup(); /*pgmout,bendout,touchout*/ ! polytouchout_setup(); ! makenote_setup(); stripnote_setup(); ! poly_setup(); ! bag_setup(); }
--- 2463,2479 ---- midiin_setup(); notein_setup(); ctlin_setup(); midi2_setup(); /*pgmin,bendin,touchin*/ polytouchin_setup(); midirealtimein_setup(); midiclkin_setup(); ! midiout_class = class_new2("midiout", midiout_new, 0, sizeof(t_midiout), 0,"FF"); ! ctlout_class = class_new2("ctlout", ctlout_new, 0, sizeof(t_ctlout), 0,"FF"); ! noteout_class = class_new2("noteout", noteout_new, 0, sizeof(t_noteout), 0,"F"); ! pgmout_class = class_new2("pgmout", pgmout_new, 0, sizeof(t_pgmout), 0,"F"); ! bendout_class = class_new2("bendout", bendout_new, 0, sizeof(t_bendout), 0,"F"); ! touchout_class = class_new2("touchout", touchout_new, 0, sizeof(t_touchout), 0,"F"); ! class_addfloat( midiout_class, midiout_float); class_sethelpsymbol( midiout_class, gensym("midi")); ! class_addfloat( ctlout_class, ctlout_float); class_sethelpsymbol( ctlout_class, gensym("midi")); ! class_addfloat( noteout_class, noteout_float); class_sethelpsymbol( noteout_class, gensym("midi")); ! class_addfloat( pgmout_class, pgmout_float); class_sethelpsymbol( pgmout_class, gensym("midi")); ! class_addfloat( bendout_class, bendout_float); class_sethelpsymbol( bendout_class, gensym("midi")); ! class_addfloat(touchout_class, touchout_float); class_sethelpsymbol(touchout_class, gensym("midi")); ! polytouchout_setup(); makenote_setup(); stripnote_setup(); poly_setup(); bag_setup(); }