Update of /cvsroot/pure-data/externals/unauthorized/sonogram~ In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6145
Modified Files: CHANGES.LOG rs-sonogram~.pd rs-sonograph~.pd sonogram~.c Log Message: Added GOP supoort
Index: CHANGES.LOG =================================================================== RCS file: /cvsroot/pure-data/externals/unauthorized/sonogram~/CHANGES.LOG,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CHANGES.LOG 30 Mar 2004 04:18:54 -0000 1.2 --- CHANGES.LOG 2 Mar 2005 02:48:57 -0000 1.3 *************** *** 1,2 **** --- 1,4 ---- + 0.13 + added GOP support 0.12 adapted for pd 0.37
Index: rs-sonograph~.pd =================================================================== RCS file: /cvsroot/pure-data/externals/unauthorized/sonogram~/rs-sonograph~.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rs-sonograph~.pd 16 Aug 2003 17:08:55 -0000 1.1 --- rs-sonograph~.pd 2 Mar 2005 02:48:57 -0000 1.2 *************** *** 142,146 **** #X restore 694 150 pd modifications; #X obj 298 73 tabplay~ $0-sonosample; ! #X obj 106 329 sonogram~ 215 0; #X text 538 54 When the sonogram is RED (updating) ,; #X text 537 43 VERY IMPORTANT NOTE :; --- 142,146 ---- #X restore 694 150 pd modifications; #X obj 298 73 tabplay~ $0-sonosample; ! #X obj 106 329 sonogram~ 256 0; #X text 538 54 When the sonogram is RED (updating) ,; #X text 537 43 VERY IMPORTANT NOTE :;
Index: sonogram~.c =================================================================== RCS file: /cvsroot/pure-data/externals/unauthorized/sonogram~/sonogram~.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sonogram~.c 14 Aug 2004 02:30:50 -0000 1.8 --- sonogram~.c 2 Mar 2005 02:48:57 -0000 1.9 *************** *** 38,48 **** #include <fcntl.h> #include <sys/stat.h> - - #ifdef __APPLE__ - #include <sys/malloc.h> - #else #include <malloc.h> - #endif - #include <ctype.h> #include <pthread.h> --- 38,42 ---- *************** *** 51,60 **** #endif #ifdef NT ! #define random rand ! #include <windows.h> ! static int usleep (unsigned int us) { ! Sleep((long)(us/1000.)); ! return 0; ! } #endif #include <math.h> --- 45,49 ---- #endif #ifdef NT ! #define M_PI 3.14159265358979323846 #endif #include <math.h> *************** *** 383,390 **** static void *sonogram_do_update_part(void *tdata) { ! t_sonogram *x = (t_sonogram*) tdata; ! t_int si; ! t_int nbpoints = 0; ! t_float percentage = 0, opercentage = 0;
// loose synchro --- 372,381 ---- static void *sonogram_do_update_part(void *tdata) { ! t_sonogram *x = (t_sonogram*) tdata; ! t_int si; ! t_int nbpoints = 0; ! t_float percentage = 0, opercentage = 0; ! t_canvas *canvas=glist_getcanvas(x->x_glist); !
// loose synchro *************** *** 430,437 ****
// set borders in black ! SYS_VGUI3(".x%x.c itemconfigure %xSONOGRAM -outline #000000\n", glist_getcanvas(x->x_glist), x); if ( x->x_phaso ) { ! SYS_VGUI3(".x%x.c itemconfigure %xPHASOGRAM -outline #000000\n", glist_getcanvas(x->x_glist), x); }
--- 421,428 ----
// set borders in black ! SYS_VGUI3(".x%x.c itemconfigure %xSONOGRAM -outline #000000\n", canvas, x); if ( x->x_phaso ) { ! SYS_VGUI3(".x%x.c itemconfigure %xPHASOGRAM -outline #000000\n", canvas, x); }
*************** *** 444,448 **** t_int erase, t_int redraw, t_int keepframe) { ! pthread_attr_t update_child_attr;
if ( x->x_graphic ) --- 435,440 ---- t_int erase, t_int redraw, t_int keepframe) { ! pthread_attr_t update_child_attr; ! t_canvas *canvas=glist_getcanvas(glist);
if ( x->x_graphic ) *************** *** 468,472 **** if ( ( bstart == 0 ) && ( bend == x->x_size-1 ) && !keepframe ) { ! SYS_VGUI3(".x%x.c delete %xSONOGRAM\n", glist_getcanvas(glist), x ); SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xSONOGRAM\n", glist_getcanvas(glist), x->x_xpos-1, x->x_ypos-1, --- 460,464 ---- if ( ( bstart == 0 ) && ( bend == x->x_size-1 ) && !keepframe ) { ! SYS_VGUI3(".x%x.c delete %xSONOGRAM\n", canvas, x ); SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xSONOGRAM\n", glist_getcanvas(glist), x->x_xpos-1, x->x_ypos-1, *************** *** 475,509 **** x); SYS_VGUI2("image delete SONIMAGE%x\n", x ); ! SYS_VGUI3(".x%x.c delete ISONIMAGE%x\n", glist_getcanvas(glist), x ); SYS_VGUI4("image create photo SONIMAGE%x -format gif -width %d -height %d\n", x, x->x_size*x->x_zoom, x->x_blocksize/2*x->x_zoom ); SYS_VGUI2("SONIMAGE%x blank\n", x); SYS_VGUI6(".x%x.c create image %d %d -image SONIMAGE%x -tags ISONIMAGE%x\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+((x->x_size*x->x_zoom)/2), (x->x_ypos+((x->x_blocksize/2*x->x_zoom)/2)), x, x ); if ( x->x_phaso ) { ! SYS_VGUI3(".x%x.c delete %xPHASOGRAM\n", glist_getcanvas(glist), x ); SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xPHASOGRAM\n", ! glist_getcanvas(glist), x->x_xpos-1, x->x_ypos+x->x_blocksize/2*x->x_zoom+2, x->x_xpos + x->x_size*x->x_zoom +1, x->x_ypos + x->x_blocksize*x->x_zoom + 3, x); SYS_VGUI2("image delete FAZIMAGE%x\n", x ); ! SYS_VGUI3(".x%x.c delete IFAZIMAGE%x\n", glist_getcanvas(glist), x ); SYS_VGUI4("image create photo FAZIMAGE%x -format gif -width %d -height %d\n", x, x->x_size*x->x_zoom, x->x_blocksize/2*x->x_zoom ); SYS_VGUI2("FAZIMAGE%x blank\n", x); SYS_VGUI6(".x%x.c create image %d %d -image FAZIMAGE%x -tags IFAZIMAGE%x\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+((x->x_size*x->x_zoom)/2), x->x_ypos+3*((x->x_blocksize/2*x->x_zoom)/2)+2, x, x ); } ! canvas_fixlinesfor( glist_getcanvas(x->x_glist), (t_text*)x ); } // set borders in red ! SYS_VGUI3(".x%x.c itemconfigure %xSONOGRAM -outline #FF0000\n", glist_getcanvas(glist), x); if ( x->x_phaso ) { ! SYS_VGUI3(".x%x.c itemconfigure %xPHASOGRAM -outline #FF0000\n", glist_getcanvas(glist), x); }
--- 467,501 ---- x); SYS_VGUI2("image delete SONIMAGE%x\n", x ); ! SYS_VGUI3(".x%x.c delete ISONIMAGE%x\n", canvas, x ); SYS_VGUI4("image create photo SONIMAGE%x -format gif -width %d -height %d\n", x, x->x_size*x->x_zoom, x->x_blocksize/2*x->x_zoom ); SYS_VGUI2("SONIMAGE%x blank\n", x); SYS_VGUI6(".x%x.c create image %d %d -image SONIMAGE%x -tags ISONIMAGE%x\n", ! canvas, x->x_xpos+((x->x_size*x->x_zoom)/2), (x->x_ypos+((x->x_blocksize/2*x->x_zoom)/2)), x, x ); if ( x->x_phaso ) { ! SYS_VGUI3(".x%x.c delete %xPHASOGRAM\n", canvas, x ); SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xPHASOGRAM\n", ! canvas, x->x_xpos-1, x->x_ypos+x->x_blocksize/2*x->x_zoom+2, x->x_xpos + x->x_size*x->x_zoom +1, x->x_ypos + x->x_blocksize*x->x_zoom + 3, x); SYS_VGUI2("image delete FAZIMAGE%x\n", x ); ! SYS_VGUI3(".x%x.c delete IFAZIMAGE%x\n", canvas, x ); SYS_VGUI4("image create photo FAZIMAGE%x -format gif -width %d -height %d\n", x, x->x_size*x->x_zoom, x->x_blocksize/2*x->x_zoom ); SYS_VGUI2("FAZIMAGE%x blank\n", x); SYS_VGUI6(".x%x.c create image %d %d -image FAZIMAGE%x -tags IFAZIMAGE%x\n", ! canvas, x->x_xpos+((x->x_size*x->x_zoom)/2), x->x_ypos+3*((x->x_blocksize/2*x->x_zoom)/2)+2, x, x ); } ! canvas_fixlinesfor( canvas, (t_text*)x ); } // set borders in red ! SYS_VGUI3(".x%x.c itemconfigure %xSONOGRAM -outline #FF0000\n", canvas, x); if ( x->x_phaso ) { ! SYS_VGUI3(".x%x.c itemconfigure %xPHASOGRAM -outline #FF0000\n", canvas, x); }
*************** *** 617,628 **** static void sonogram_paste_phase( t_sonogram* x) { ! t_int pxstart = (x->x_xdraw-x->x_xpos)/x->x_zoom; ! t_int pystart = (x->x_ypos+x->x_blocksize/2*x->x_zoom+1-x->x_ydraw)/x->x_zoom+x->x_blocksize/2; ! t_int cxs,cxe,cys,cye,si,fi; ! t_float fspectrum, fdestspectrum; ! t_float fphase, fdestphase; ! t_float *icopy; ! t_float *rcopy; ! t_int copynd;
if ( x->x_xstartcapture > x->x_xendcapture ) { --- 609,622 ---- static void sonogram_paste_phase( t_sonogram* x) { ! t_int pxstart = (x->x_xdraw-x->x_xpos)/x->x_zoom; ! t_int pystart = (x->x_ypos+x->x_blocksize/2*x->x_zoom+1-x->x_ydraw)/x->x_zoom+x->x_blocksize/2; ! t_int cxs,cxe,cys,cye,si,fi; ! t_float fspectrum, fdestspectrum; ! t_float fphase, fdestphase; ! t_float *icopy; ! t_float *rcopy; ! t_int copynd; ! t_canvas *canvas=glist_getcanvas(x->x_glist); !
if ( x->x_xstartcapture > x->x_xendcapture ) { *************** *** 701,705 **** sonogram_update_part(x, x->x_glist, pxstart, pxstart+(si-1)-cxs, 0, 1, 1); // start a new capture ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", glist_getcanvas( x->x_glist ), x ); x->x_xstartcapture = x->x_xdraw; x->x_ystartcapture = x->x_ydraw; --- 695,699 ---- sonogram_update_part(x, x->x_glist, pxstart, pxstart+(si-1)-cxs, 0, 1, 1); // start a new capture ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", canvas, x ); x->x_xstartcapture = x->x_xdraw; x->x_ystartcapture = x->x_ydraw; *************** *** 711,721 **** static void sonogram_draw_new(t_sonogram *x, t_glist *glist) { ! t_canvas *canvas=glist_getcanvas(glist);
! if ( x->x_xpos == -1 ) ! { ! x->x_xpos=x->x_obj.te_xpix; ! x->x_ypos=x->x_obj.te_ypix; ! } if ( x->x_graphic ) { --- 705,712 ---- static void sonogram_draw_new(t_sonogram *x, t_glist *glist) { ! t_canvas *canvas=glist_getcanvas(glist);
! x->x_xpos=text_xpix(&x->x_obj, glist); ! x->x_ypos=text_ypix(&x->x_obj, glist); if ( x->x_graphic ) { *************** *** 729,738 **** SYS_VGUI2("SONIMAGE%x blank\n", x); SYS_VGUI6(".x%x.c create image %d %d -image SONIMAGE%x -tags ISONIMAGE%x\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+((x->x_size*x->x_zoom)/2), (x->x_ypos+((x->x_blocksize/2*x->x_zoom)/2)), x, x ); if ( x->x_phaso ) { SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xPHASOGRAM\n", ! glist_getcanvas(glist), x->x_xpos-1, x->x_ypos+x->x_blocksize/2*x->x_zoom+2, x->x_xpos + x->x_size*x->x_zoom +1, x->x_ypos + x->x_blocksize*x->x_zoom + 3, --- 720,729 ---- SYS_VGUI2("SONIMAGE%x blank\n", x); SYS_VGUI6(".x%x.c create image %d %d -image SONIMAGE%x -tags ISONIMAGE%x\n", ! canvas, x->x_xpos+((x->x_size*x->x_zoom)/2), (x->x_ypos+((x->x_blocksize/2*x->x_zoom)/2)), x, x ); if ( x->x_phaso ) { SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xPHASOGRAM\n", ! canvas, x->x_xpos-1, x->x_ypos+x->x_blocksize/2*x->x_zoom+2, x->x_xpos + x->x_size*x->x_zoom +1, x->x_ypos + x->x_blocksize*x->x_zoom + 3, *************** *** 742,746 **** SYS_VGUI2("FAZIMAGE%x blank\n", x); SYS_VGUI6(".x%x.c create image %d %d -image FAZIMAGE%x -tags IFAZIMAGE%x\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+((x->x_size*x->x_zoom)/2), x->x_ypos+3*((x->x_blocksize/2*x->x_zoom)/2)+2, x, x ); } --- 733,737 ---- SYS_VGUI2("FAZIMAGE%x blank\n", x); SYS_VGUI6(".x%x.c create image %d %d -image FAZIMAGE%x -tags IFAZIMAGE%x\n", ! canvas, x->x_xpos+((x->x_size*x->x_zoom)/2), x->x_ypos+3*((x->x_blocksize/2*x->x_zoom)/2)+2, x, x ); } *************** *** 751,768 **** static void sonogram_draw_delete(t_sonogram *x, t_glist *glist) { if ( x->x_graphic && glist_isvisible( glist ) ) { ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", glist_getcanvas( glist ), x ); ! SYS_VGUI3( ".x%x.c delete line %xREADSTART\n", glist_getcanvas( glist ), x); ! SYS_VGUI3( ".x%x.c delete line %xREADEND\n", glist_getcanvas( glist ), x); ! SYS_VGUI3( ".x%x.c delete line %xMODSTART\n", glist_getcanvas( glist ), x); ! SYS_VGUI3( ".x%x.c delete line %xMODEND\n", glist_getcanvas( glist ), x); ! SYS_VGUI3(".x%x.c delete %xSONOGRAM\n", glist_getcanvas( glist ), x ); ! SYS_VGUI3(".x%x.c delete %xPHASOGRAM\n", glist_getcanvas( glist ), x ); ! SYS_VGUI3(".x%x.c delete %xISONIMAGE\n", glist_getcanvas( glist ), x ); SYS_VGUI2("image delete SONIMAGE%x\n", x ); if ( x->x_phaso ) { ! SYS_VGUI3(".x%x.c delete %xIFAZIMAGE\n", glist_getcanvas( glist ), x ); SYS_VGUI2("image delete FAZIMAGE%x\n", x ); } --- 742,761 ---- static void sonogram_draw_delete(t_sonogram *x, t_glist *glist) { + t_canvas *canvas=glist_getcanvas(glist); + if ( x->x_graphic && glist_isvisible( glist ) ) { ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", canvas, x ); ! SYS_VGUI3( ".x%x.c delete line %xREADSTART\n", canvas, x); ! SYS_VGUI3( ".x%x.c delete line %xREADEND\n", canvas, x); ! SYS_VGUI3( ".x%x.c delete line %xMODSTART\n", canvas, x); ! SYS_VGUI3( ".x%x.c delete line %xMODEND\n", canvas, x); ! SYS_VGUI3(".x%x.c delete %xSONOGRAM\n", canvas, x ); ! SYS_VGUI3(".x%x.c delete %xPHASOGRAM\n", canvas, x ); ! SYS_VGUI3(".x%x.c delete %xISONIMAGE\n", canvas, x ); SYS_VGUI2("image delete SONIMAGE%x\n", x ); if ( x->x_phaso ) { ! SYS_VGUI3(".x%x.c delete %xIFAZIMAGE\n", canvas, x ); SYS_VGUI2("image delete FAZIMAGE%x\n", x ); } *************** *** 772,776 **** static void sonogram_draw_move(t_sonogram *x, t_glist *glist) { ! t_canvas *canvas=glist_getcanvas(glist);
if ( x->x_graphic && glist_isvisible( x->x_glist ) ) --- 765,769 ---- static void sonogram_draw_move(t_sonogram *x, t_glist *glist) { ! t_canvas *canvas=glist_getcanvas(glist);
if ( x->x_graphic && glist_isvisible( x->x_glist ) ) *************** *** 803,807 **** static void sonogram_draw_select(t_sonogram* x,t_glist* glist) { ! t_canvas *canvas=glist_getcanvas(glist);
if ( x->x_graphic && glist_isvisible( x->x_glist ) ) --- 796,800 ---- static void sonogram_draw_select(t_sonogram* x,t_glist* glist) { ! t_canvas *canvas=glist_getcanvas(glist);
if ( x->x_graphic && glist_isvisible( x->x_glist ) ) *************** *** 959,963 **** static void sonogram_motion(t_sonogram *x, t_floatarg dx, t_floatarg dy) { ! int fdraw=0, sdraw=0;
// post( "sonogram_motion @ [%d,%d] dx=%f dy=%f alt=%d", x->x_xdraw, x->x_ydraw, dx, dy, x->x_alted ); --- 952,957 ---- static void sonogram_motion(t_sonogram *x, t_floatarg dx, t_floatarg dy) { ! t_int fdraw=0, sdraw=0; ! t_canvas *canvas=glist_getcanvas(x->x_glist);
// post( "sonogram_motion @ [%d,%d] dx=%f dy=%f alt=%d", x->x_xdraw, x->x_ydraw, dx, dy, x->x_alted ); *************** *** 997,1004 **** x->x_yendcapture += dy; } ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", glist_getcanvas( x->x_glist ), x ); SYS_VGUI7( ".x%x.c create rectangle %d %d %d %d -outline #0000FF -tags %xCAPTURE\n", ! glist_getcanvas( x->x_glist ), x->x_xstartcapture, ! x->x_ystartcapture, x->x_xendcapture, x->x_yendcapture, x ); } } --- 991,997 ---- x->x_yendcapture += dy; } ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", canvas, x ); SYS_VGUI7( ".x%x.c create rectangle %d %d %d %d -outline #0000FF -tags %xCAPTURE\n", ! canvas, x->x_xstartcapture, x->x_ystartcapture, x->x_xendcapture, x->x_yendcapture, x ); } } *************** *** 1007,1012 **** int xpix, int ypix, int shift, int alt, int dbl, int doit) { ! t_sonogram* x = (t_sonogram *)z; ! int si,fi;
// post( "sonogram_click : x=%d y=%d doit=%d alt=%d, shift=%d", xpix, ypix, doit, alt, shift ); --- 1000,1007 ---- int xpix, int ypix, int shift, int alt, int dbl, int doit) { ! t_sonogram* x = (t_sonogram *)z; ! t_int si,fi; ! t_canvas *canvas=glist_getcanvas(x->x_glist); !
// post( "sonogram_click : x=%d y=%d doit=%d alt=%d, shift=%d", xpix, ypix, doit, alt, shift ); *************** *** 1091,1095 **** } // start a new capture ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", glist_getcanvas( x->x_glist ), x ); x->x_xstartcapture = xpix; x->x_ystartcapture = ypix; --- 1086,1090 ---- } // start a new capture ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", canvas, x ); x->x_xstartcapture = xpix; x->x_ystartcapture = ypix; *************** *** 1370,1374 **** static void sonogram_readstart(t_sonogram *x, t_floatarg fstart) { ! t_float startpoint = fstart;
if (startpoint < 0) startpoint = 0; --- 1365,1370 ---- static void sonogram_readstart(t_sonogram *x, t_floatarg fstart) { ! t_float startpoint = fstart; ! t_canvas *canvas=glist_getcanvas(x->x_glist);
if (startpoint < 0) startpoint = 0; *************** *** 1381,1387 **** { SYS_VGUI3( ".x%x.c delete line %xREADSTART\n", ! glist_getcanvas( x->x_glist ), x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #FF0000 -tags %xREADSTART -width 3\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+(x->x_readstart*(x->x_size)/100 ), x->x_ypos, x->x_xpos+(x->x_readstart*(x->x_size)/100 ), x->x_ypos+x->x_blocksize*x->x_zoom, x ); --- 1377,1383 ---- { SYS_VGUI3( ".x%x.c delete line %xREADSTART\n", ! canvas, x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #FF0000 -tags %xREADSTART -width 3\n", ! canvas, x->x_xpos+(x->x_readstart*(x->x_size)/100 ), x->x_ypos, x->x_xpos+(x->x_readstart*(x->x_size)/100 ), x->x_ypos+x->x_blocksize*x->x_zoom, x ); *************** *** 1392,1396 **** static void sonogram_modstart(t_sonogram *x, t_floatarg fstart) { ! t_float startpoint = fstart;
if (startpoint < 0) startpoint = 0; --- 1388,1393 ---- static void sonogram_modstart(t_sonogram *x, t_floatarg fstart) { ! t_float startpoint = fstart; ! t_canvas *canvas=glist_getcanvas(x->x_glist);
if (startpoint < 0) startpoint = 0; *************** *** 1405,1411 **** { SYS_VGUI3( ".x%x.c delete line %xMODSTART\n", ! glist_getcanvas( x->x_glist ), x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #11E834 -tags %xMODSTART -width 3\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+(x->x_modstart*(x->x_size)/100 ), x->x_ypos, x->x_xpos+(x->x_modstart*(x->x_size)/100 ), x->x_ypos+x->x_blocksize*x->x_zoom, x ); --- 1402,1408 ---- { SYS_VGUI3( ".x%x.c delete line %xMODSTART\n", ! canvas, x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #11E834 -tags %xMODSTART -width 3\n", ! canvas, x->x_xpos+(x->x_modstart*(x->x_size)/100 ), x->x_ypos, x->x_xpos+(x->x_modstart*(x->x_size)/100 ), x->x_ypos+x->x_blocksize*x->x_zoom, x ); *************** *** 1434,1438 **** static void sonogram_readend(t_sonogram *x, t_floatarg fend) { ! t_float endpoint = fend;
if (endpoint < 0) endpoint = 0; --- 1431,1436 ---- static void sonogram_readend(t_sonogram *x, t_floatarg fend) { ! t_float endpoint = fend; ! t_canvas *canvas=glist_getcanvas(x->x_glist);
if (endpoint < 0) endpoint = 0; *************** *** 1445,1451 **** { SYS_VGUI3( ".x%x.c delete line %xREADEND\n", ! glist_getcanvas( x->x_glist ), x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #FF0000 -tags %xREADEND -width 3\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+(x->x_readend*(x->x_size)/100 ), x->x_ypos, x->x_xpos+(x->x_readend*(x->x_size)/100 ), x->x_ypos+x->x_blocksize*x->x_zoom, x ); --- 1443,1449 ---- { SYS_VGUI3( ".x%x.c delete line %xREADEND\n", ! canvas, x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #FF0000 -tags %xREADEND -width 3\n", ! canvas, x->x_xpos+(x->x_readend*(x->x_size)/100 ), x->x_ypos, x->x_xpos+(x->x_readend*(x->x_size)/100 ), x->x_ypos+x->x_blocksize*x->x_zoom, x ); *************** *** 1456,1460 **** static void sonogram_modend(t_sonogram *x, t_floatarg fend) { ! t_float endpoint = fend;
if (endpoint < 0) endpoint = 0; --- 1454,1459 ---- static void sonogram_modend(t_sonogram *x, t_floatarg fend) { ! t_float endpoint = fend; ! t_canvas *canvas=glist_getcanvas(x->x_glist);
if (endpoint < 0) endpoint = 0; *************** *** 1469,1475 **** { SYS_VGUI3( ".x%x.c delete line %xMODEND\n", ! glist_getcanvas( x->x_glist ), x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #11E834 -tags %xMODEND -width 3\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+(x->x_modend*(x->x_size)/100 ), x->x_ypos, x->x_xpos+(x->x_modend*(x->x_size)/100 ), x->x_ypos+x->x_blocksize*x->x_zoom, x ); --- 1468,1474 ---- { SYS_VGUI3( ".x%x.c delete line %xMODEND\n", ! canvas, x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #11E834 -tags %xMODEND -width 3\n", ! canvas, x->x_xpos+(x->x_modend*(x->x_size)/100 ), x->x_ypos, x->x_xpos+(x->x_modend*(x->x_size)/100 ), x->x_ypos+x->x_blocksize*x->x_zoom, x );
Index: rs-sonogram~.pd =================================================================== RCS file: /cvsroot/pure-data/externals/unauthorized/sonogram~/rs-sonogram~.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rs-sonogram~.pd 16 Aug 2003 17:08:55 -0000 1.1 --- rs-sonogram~.pd 2 Mar 2005 02:48:57 -0000 1.2 *************** *** 1,3 **** ! #N canvas 43 28 986 681 10; #X msg 306 57 record; #X msg 19 34 bang; --- 1,3 ---- ! #N canvas 7 13 986 674 10; #X msg 306 57 record; #X msg 19 34 bang; *************** *** 6,10 **** #X msg 259 42 bang; #X obj 262 101 rfft~; ! #X floatatom 59 171 10 0 0; #X msg 20 211 resize $1; #X obj 19 74 t s b; --- 6,10 ---- #X msg 259 42 bang; #X obj 262 101 rfft~; ! #X floatatom 59 171 10 0 0 0 - - -; #X msg 20 211 resize $1; #X obj 19 74 t s b; *************** *** 41,45 **** #X text 783 76 Set portion of the sonogram to modify; #X msg 953 108 100; ! #N canvas 309 22 600 544 modifications 0; #X text 234 236 Filter a frequency; #X text 254 190 Enhance a frequency by 10% ( might be a range of frequencies --- 41,45 ---- #X text 783 76 Set portion of the sonogram to modify; #X msg 953 108 100; ! #N canvas 656 8 600 544 modifications 1; #X text 234 236 Filter a frequency; #X text 254 190 Enhance a frequency by 10% ( might be a range of frequencies *************** *** 88,92 **** #X msg 115 466 add $1 $1 -0.5; #X text 218 465 Sub a constant from a frequency; - #X msg 113 395 average 100; #X text 198 393 Average over 100 blocks ( smooth with some sounds ) ; --- 88,91 ---- *************** *** 96,106 **** #X msg 107 198 enhance $1 $1 1.1 0; #X msg 116 488 threshold $1; ! #X floatatom 208 489 5 0 0; #X msg 107 239 enhance $1 $1 0 0; #X text 249 488 Suppress all points below the threshold; #X text 159 91 Roll frequencies : same as above but without loss; ! #X connect 3 0 38 0; #X connect 4 0 8 0; ! #X connect 5 0 38 0; #X connect 6 0 5 0; #X connect 8 0 9 0; --- 95,106 ---- #X msg 107 198 enhance $1 $1 1.1 0; #X msg 116 488 threshold $1; ! #X floatatom 208 489 5 0 0 0 - - -; #X msg 107 239 enhance $1 $1 0 0; #X text 249 488 Suppress all points below the threshold; #X text 159 91 Roll frequencies : same as above but without loss; ! #X msg 113 395 average 10; ! #X connect 3 0 37 0; #X connect 4 0 8 0; ! #X connect 5 0 37 0; #X connect 6 0 5 0; #X connect 8 0 9 0; *************** *** 109,140 **** #X connect 11 0 12 0; #X connect 12 0 6 0; ! #X connect 13 0 41 0; ! #X connect 14 0 44 0; ! #X connect 16 0 38 0; ! #X connect 17 0 38 0; ! #X connect 20 0 38 0; ! #X connect 22 0 38 0; ! #X connect 23 0 38 0; ! #X connect 26 0 38 0; #X connect 27 0 26 0; #X connect 30 0 31 0; ! #X connect 31 0 38 0; #X connect 33 0 34 0; ! #X connect 34 0 38 0; ! #X connect 36 0 38 0; ! #X connect 39 0 38 0; ! #X connect 40 0 38 0; ! #X connect 41 0 38 0; ! #X connect 42 0 38 0; ! #X connect 43 0 42 0; ! #X connect 44 0 38 0; #X restore 861 131 pd modifications; #X text 513 609 Zoom factor (>1); #X msg 418 608 zoom 2; #X obj 256 79 tabplay~ $0-sonosample; ! #X obj 80 275 sonogram~ 463 1 1 1; #X msg 467 608 zoom 1; #X msg 484 99 readspeed $1; ! #X floatatom 617 99 5 0 0; #X text 487 121 Reading speed; #X obj 576 99 / 100; --- 109,140 ---- #X connect 11 0 12 0; #X connect 12 0 6 0; ! #X connect 13 0 40 0; ! #X connect 14 0 43 0; ! #X connect 16 0 37 0; ! #X connect 17 0 37 0; ! #X connect 20 0 37 0; ! #X connect 22 0 37 0; ! #X connect 23 0 37 0; ! #X connect 26 0 37 0; #X connect 27 0 26 0; #X connect 30 0 31 0; ! #X connect 31 0 37 0; #X connect 33 0 34 0; ! #X connect 34 0 37 0; ! #X connect 38 0 37 0; ! #X connect 39 0 37 0; ! #X connect 40 0 37 0; ! #X connect 41 0 37 0; ! #X connect 42 0 41 0; ! #X connect 43 0 37 0; ! #X connect 46 0 37 0; #X restore 861 131 pd modifications; #X text 513 609 Zoom factor (>1); #X msg 418 608 zoom 2; #X obj 256 79 tabplay~ $0-sonosample; ! #X obj 114 263 sonogram~ 2452 1 1; #X msg 467 608 zoom 1; #X msg 484 99 readspeed $1; ! #X floatatom 617 99 5 0 0 0 - - -; #X text 487 121 Reading speed; #X obj 576 99 / 100; *************** *** 147,151 **** #X msg 822 207 stop; #X msg 418 652 modstep $1; ! #X floatatom 499 652 5 0 0; #X obj 525 36 spigot; #X obj 573 36 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0 1 --- 147,151 ---- #X msg 822 207 stop; #X msg 418 652 modstep $1; ! #X floatatom 499 652 5 0 0 0 - - -; #X obj 525 36 spigot; #X obj 573 36 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0 1 *************** *** 178,182 **** #X obj 260 126 rifft~; #X msg 418 630 refresh; - #X obj 829 571 block~ 256; #X text 239 10 Step 2 : Record the sonogram; #X obj 927 565 loadbang; --- 178,181 ---- *************** *** 185,189 **** #X obj 46 327 tabread envelop; #X msg 23 263 bang; ! #X floatatom 23 299 5 0 0; #X obj 71 280 + 1; #X msg 23 281 0; --- 184,188 ---- #X obj 46 327 tabread envelop; #X msg 23 263 bang; ! #X floatatom 23 299 5 0 0 0 - - -; #X obj 71 280 + 1; #X msg 23 281 0; *************** *** 196,200 **** #X msg 370 374 ; envelop const 1; #X msg 203 381 refresh; ! #X floatatom 160 280 5 0 0; #X msg 163 300 bang; #X obj 98 280 moses 127; --- 195,199 ---- #X msg 370 374 ; envelop const 1; #X msg 203 381 refresh; ! #X floatatom 160 280 5 0 0 0 - - -; #X msg 163 300 bang; #X obj 98 280 moses 127; *************** *** 232,236 **** #X restore 780 131 pd envelop; #X obj 310 174 / 100; ! #X floatatom 309 147 5 0 0; #X obj 263 174 *~ 1; #X obj 261 149 /~ 256; --- 231,235 ---- #X restore 780 131 pd envelop; #X obj 310 174 / 100; ! #X floatatom 309 147 5 0 0 0 - - -; #X obj 263 174 *~ 1; #X obj 261 149 /~ 256; *************** *** 242,245 **** --- 241,247 ---- #X text 526 630 One level undo; #X obj 21 192 makefilename %d-sonosample; + #X msg 23 264 undo; + #X msg 17 317 zoom 1; + #X obj 829 571 block~ 256; #X connect 0 0 41 0; #X connect 1 0 2 0; *************** *** 269,273 **** #X connect 39 0 41 0; #X connect 40 0 5 0; ! #X connect 40 0 90 0; #X connect 41 0 82 0; #X connect 41 1 82 1; --- 271,275 ---- #X connect 39 0 41 0; #X connect 40 0 5 0; ! #X connect 40 0 89 0; #X connect 41 0 82 0; #X connect 41 1 82 1; *************** *** 291,307 **** #X connect 57 0 56 1; #X connect 62 0 64 0; ! #X connect 63 0 98 0; #X connect 64 0 41 0; #X connect 78 0 36 0; ! #X connect 82 0 91 0; #X connect 83 0 41 0; ! #X connect 86 0 14 0; ! #X connect 87 0 41 0; ! #X connect 88 0 90 1; ! #X connect 89 0 88 0; ! #X connect 90 0 16 0; ! #X connect 90 0 51 0; ! #X connect 90 0 51 1; ! #X connect 91 0 90 0; ! #X connect 96 0 41 0; ! #X connect 98 0 9 1; --- 293,311 ---- #X connect 57 0 56 1; #X connect 62 0 64 0; ! #X connect 63 0 97 0; #X connect 64 0 41 0; #X connect 78 0 36 0; ! #X connect 82 0 90 0; #X connect 83 0 41 0; ! #X connect 85 0 14 0; ! #X connect 86 0 41 0; ! #X connect 87 0 89 1; ! #X connect 88 0 87 0; ! #X connect 89 0 16 0; ! #X connect 89 0 51 0; ! #X connect 89 0 51 1; ! #X connect 90 0 89 0; ! #X connect 95 0 41 0; ! #X connect 97 0 9 1; ! #X connect 98 0 41 0; ! #X connect 99 0 41 0;