[PD-cvs] pd/src g_numbox.c, 1.4.8.1, 1.4.8.2 m_sched.c, 1.5.4.35.2.4, 1.5.4.35.2.5 s_audio_jack.c, 1.5.4.8.2.2, 1.5.4.8.2.3 s_inter.c, 1.5.4.10.2.4, 1.5.4.10.2.5 s_main.c, 1.7.4.17.2.3, 1.7.4.17.2.4 s_midi.c, 1.4.4.1.2.1, 1.4.4.1.2.2 u_main.tk, 1.4.4.10.2.5, 1.4.4.10.2.6 x_connective.c, 1.3.4.1.2.2, 1.3.4.1.2.3

Tim Blechmann timblech at users.sourceforge.net
Sat Jul 16 13:02:40 CEST 2005


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32725

Modified Files:
      Tag: devel_0_39
	g_numbox.c m_sched.c s_audio_jack.c s_inter.c s_main.c 
	s_midi.c u_main.tk x_connective.c 
Log Message:
- updating to miller's 0.39-test4
- runtime selection of simd function for jack callback
- run clock callbacks after each audio callback

Index: s_main.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_main.c,v
retrieving revision 1.7.4.17.2.3
retrieving revision 1.7.4.17.2.4
diff -C2 -d -r1.7.4.17.2.3 -r1.7.4.17.2.4
*** s_main.c	13 Jul 2005 22:49:39 -0000	1.7.4.17.2.3
--- s_main.c	16 Jul 2005 11:02:37 -0000	1.7.4.17.2.4
***************
*** 8,12 ****
   */
  
! char pd_version[] = "Pd version 0.39 TEST 3 devel\n";
  char pd_compiletime[] = __TIME__;
  char pd_compiledate[] = __DATE__;
--- 8,12 ----
   */
  
! char pd_version[] = "Pd version 0.39 TEST 4 devel\n";
  char pd_compiletime[] = __TIME__;
  char pd_compiledate[] = __DATE__;
***************
*** 489,493 ****
      char sbuf[MAXPDSTRING], sbuf2[MAXPDSTRING], *sp;
      char *lastslash; 
! #if UNISTD
      struct stat statbuf;
  #endif
--- 489,493 ----
      char sbuf[MAXPDSTRING], sbuf2[MAXPDSTRING], *sp;
      char *lastslash; 
! #ifdef UNISTD
      struct stat statbuf;
  #endif
***************
*** 874,878 ****
          {
              sys_printtostderr = 1;
-             fprintf(stderr, "set it\n");
              argc--; argv++;
          }
--- 874,877 ----

Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.4.4.10.2.5
retrieving revision 1.4.4.10.2.6
diff -C2 -d -r1.4.4.10.2.5 -r1.4.4.10.2.6
*** u_main.tk	12 Jul 2005 15:11:12 -0000	1.4.4.10.2.5
--- u_main.tk	16 Jul 2005 11:02:37 -0000	1.4.4.10.2.6
***************
*** 339,346 ****
      global pd_guidir
      global pd_myversion
! 	global pd_font3
      set name [format ".help%d" $doc_number]
      toplevel $name
!     text $name.text -relief raised -bd 2 -font $pd_font3 \
      	-yscrollcommand "$name.scroll set" -background white
      scrollbar $name.scroll -command "$name.text yview"
--- 339,346 ----
      global pd_guidir
      global pd_myversion
! #    global pd_font3
      set name [format ".help%d" $doc_number]
      toplevel $name
!     text $name.text -relief raised -bd 2 -font -*-times-regular--normal--14-* \
      	-yscrollcommand "$name.scroll set" -background white
      scrollbar $name.scroll -command "$name.text yview"
***************
*** 3119,3123 ****
  
      text $name.text -relief raised -bd 2 -height 40 -width 60 \
!     	-yscrollcommand "$name.scroll set" -font pd_font3
      scrollbar $name.scroll -command "$name.text yview"
      pack $name.scroll -side right -fill y
--- 3119,3123 ----
  
      text $name.text -relief raised -bd 2 -height 40 -width 60 \
!     	-yscrollcommand "$name.scroll set" -font $pd_font3
      scrollbar $name.scroll -command "$name.text yview"
      pack $name.scroll -side right -fill y
***************
*** 3702,3706 ****
  }
  
! ####################### midi dialog ##################3
  
  proc midi_apply {id} {
--- 3702,3706 ----
  }
  
! ####################### midi dialog ##################
  
  proc midi_apply {id} {
***************
*** 3757,3761 ****
  
  proc pdtk_midi_dialog {id indevlist indev1 indev2 indev3 indev4 \
!     	outdevlist outdev1 outdev2 outdev3 outdev4 longform alsa} {
      global midi_indev1 midi_indev2 midi_indev3 midi_indev4 
      global midi_outdev1 midi_outdev2 midi_outdev3 midi_outdev4
--- 3757,3761 ----
  
  proc pdtk_midi_dialog {id indevlist indev1 indev2 indev3 indev4 \
!     	outdevlist outdev1 outdev2 outdev3 outdev4 longform} {
      global midi_indev1 midi_indev2 midi_indev3 midi_indev4 
      global midi_outdev1 midi_outdev2 midi_outdev3 midi_outdev4
***************
*** 3792,3800 ****
      pack $id.buttonframe.ok -side left -expand 1
      
      frame $id.in1f
      pack $id.in1f -side top
  
-   if {$alsa == 0} {
-     	# input device 1
      label $id.in1f.l1 -text "input device 1:"
      button $id.in1f.x1 -text [lindex $indevlist $midi_indev1] \
--- 3792,3799 ----
      pack $id.buttonframe.ok -side left -expand 1
      
+     	# input device 1
      frame $id.in1f
      pack $id.in1f -side top
  
      label $id.in1f.l1 -text "input device 1:"
      button $id.in1f.x1 -text [lindex $indevlist $midi_indev1] \
***************
*** 3883,3900 ****
  	frame $id.longbutton
  	pack $id.longbutton -side top
!     	button $id.longbutton.b -text {use multiple alsa devices} \
      	    -command  {pd pd midi-properties 1 \;}
      	pack $id.longbutton.b
      }
  }
-     if {$alsa} {
-     	label $id.in1f.l1 -text "In Channels:"
-     	entry $id.in1f.x1 -textvariable midi_alsain -width 4
-         pack $id.in1f.l1 $id.in1f.x1 -side left
- 	label $id.in1f.l2 -text "Out Channels:"
-     	entry $id.in1f.x2 -textvariable midi_alsaout -width 4
-         pack $id.in1f.l2 $id.in1f.x2 -side left
-     }
- }
  
  proc pdtk_alsa_midi_dialog {id indevlist indev1 indev2 indev3 indev4 \
--- 3882,3890 ----
  	frame $id.longbutton
  	pack $id.longbutton -side top
!     	button $id.longbutton.b -text {use multiple devices} \
      	    -command  {pd pd midi-properties 1 \;}
      	pack $id.longbutton.b
      }
  }
  
  proc pdtk_alsa_midi_dialog {id indevlist indev1 indev2 indev3 indev4 \

Index: s_inter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v
retrieving revision 1.5.4.10.2.4
retrieving revision 1.5.4.10.2.5
diff -C2 -d -r1.5.4.10.2.4 -r1.5.4.10.2.5
*** s_inter.c	14 Jul 2005 23:17:33 -0000	1.5.4.10.2.4
--- s_inter.c	16 Jul 2005 11:02:37 -0000	1.5.4.10.2.5
***************
*** 21,24 ****
--- 21,25 ----
  #include <sys/time.h>
  #include <sys/mman.h>
+ #include <sys/resource.h>
  #endif
  #ifdef HAVE_BSTRING_H
***************
*** 1081,1084 ****
--- 1082,1088 ----
                  char *homedir = getenv("HOME"), filename[250];
                  struct stat statbuf;
+                 sprintf(filename, "%s/../../MacOS/Pd", guidir);
+                 if (stat(filename, &statbuf) >= 0)
+                     goto foundit;
                  if (!homedir || strlen(homedir) > 150)
                      goto nohomedir;
***************
*** 1095,1108 ****
              nohomedir:
                  strcpy(filename, 
-                     "/System/Library/Frameworks/Tk.Framework/Resources/Wish Shell.app/Contents/MacOS/Wish Shell");
-                 if (stat(filename, &statbuf) >= 0)
-                     goto foundit;
- 
-                 strcpy(filename, 
-                     "/Library/Frameworks/Tk.Framework/Resources/Wish Shell.app/Contents/MacOS/Wish Shell");
-                 if (stat(filename, &statbuf) >= 0)
-                     goto foundit;
- 
-                 strcpy(filename, 
                      "/Applications/Utilities/Wish Shell.app/Contents/MacOS/Wish Shell");
                  if (stat(filename, &statbuf) >= 0)
--- 1099,1102 ----

Index: x_connective.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/x_connective.c,v
retrieving revision 1.3.4.1.2.2
retrieving revision 1.3.4.1.2.3
diff -C2 -d -r1.3.4.1.2.2 -r1.3.4.1.2.3
*** x_connective.c	12 Jul 2005 15:11:13 -0000	1.3.4.1.2.2
--- x_connective.c	16 Jul 2005 11:02:38 -0000	1.3.4.1.2.3
***************
*** 523,528 ****
      {
          float f;
!         if (!argc) {
! 	  /* JMZ: no args: treat as "bang" and thus reject */
  	  outlet_bang(x->x_rejectout);
  	  return;
--- 523,528 ----
      {
          float f;
!         if (!argc)  /* empty lists go out reject outlet */
!         {
  	  outlet_bang(x->x_rejectout);
  	  return;
***************
*** 621,625 ****
      int n;
      t_routeelement *e;
!     t_route *x = (t_route *)pd_new(route_class);
      t_atom a;
      if (argc == 0)
--- 621,626 ----
      int n;
      t_routeelement *e;
!     t_route *x;
!     
      t_atom a;
      if (argc == 0)
***************
*** 629,655 ****
          argv = &a;
      }
      x->x_type = argv[0].a_type;
      x->x_nelement = argc;
- 
-    /* JMZ: type checking: arguments must bei either floats xor symbols */
-     if (x->x_type == A_FLOAT) 
- 	{
- 		for(n=0; n<argc; n++)
- 			if (argv[n].a_type!=A_FLOAT)
- 			{
- 				pd_error(x, "route: cannot route floats and symbols at the same time");
- 				return 0;
- 			}
- 	}
-     else
- 	{
- 		for(n=0; n<argc; n++)
- 			if(argv[n].a_type==A_FLOAT)
- 			{
- 				pd_error(x, "route: cannot route symbols and floats at the same time");
- 				return 0;
- 			}
- 	}
- 
      x->x_vec = (t_routeelement *)getbytes(argc * sizeof(*x->x_vec));
      for (n = 0, e = x->x_vec; n < argc; n++, e++)
--- 630,642 ----
          argv = &a;
      }
+     for (n = 1; n < argc; n++)
+         if (argv[n].a_type != argv[0].a_type)
+     {
+         error("route: creation with mixed argument types failed");
+         return (0);
+     }
+     x = (t_route *)pd_new(route_class);
      x->x_type = argv[0].a_type;
      x->x_nelement = argc;
      x->x_vec = (t_routeelement *)getbytes(argc * sizeof(*x->x_vec));
      for (n = 0, e = x->x_vec; n < argc; n++, e++)
***************
*** 1033,1054 ****
      t_triggerout *u;
      int i;
-     t_atom at;
-     if (!argc)
-     {
-         argc = 1;
-         SETFLOAT(&at, 0);
-         argv = &at;
-     }
      for (i = x->x_n, u = x->x_vec + i; u--, i--;)
      {
          if (u->u_type == TR_FLOAT)
!             outlet_float(u->u_outlet, atom_getfloat(argv));
          else if (u->u_type == TR_BANG)
              outlet_bang(u->u_outlet);
          else if (u->u_type == TR_SYMBOL)
!             outlet_symbol(u->u_outlet, atom_getsymbol(argv));
          else if (u->u_type == TR_POINTER)
          {
!             if (argv->a_type != TR_POINTER)
                  pd_error(x, "unpack: bad pointer");
              else outlet_pointer(u->u_outlet, argv->a_w.w_gpointer);
--- 1020,1034 ----
      t_triggerout *u;
      int i;
      for (i = x->x_n, u = x->x_vec + i; u--, i--;)
      {
          if (u->u_type == TR_FLOAT)
!             outlet_float(u->u_outlet, (argc ? atom_getfloat(argv) : 0));
          else if (u->u_type == TR_BANG)
              outlet_bang(u->u_outlet);
          else if (u->u_type == TR_SYMBOL)
!             outlet_symbol(u->u_outlet, (argc ? atom_getsymbol(argv) : 0));
          else if (u->u_type == TR_POINTER)
          {
!             if (!argc || argv->a_type != TR_POINTER)
                  pd_error(x, "unpack: bad pointer");
              else outlet_pointer(u->u_outlet, argv->a_w.w_gpointer);

Index: s_midi.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_midi.c,v
retrieving revision 1.4.4.1.2.1
retrieving revision 1.4.4.1.2.2
diff -C2 -d -r1.4.4.1.2.1 -r1.4.4.1.2.2
*** s_midi.c	12 Jul 2005 15:11:11 -0000	1.4.4.1.2.1
--- s_midi.c	16 Jul 2005 11:02:37 -0000	1.4.4.1.2.2
***************
*** 704,708 ****
   "pdtk_midi_dialog %%s \
   %s %d %d %d %d %s %d %d %d %d \
!  %d 0\n",
  			indevliststring,
  			midiindev1, midiindev2, midiindev3, midiindev4, 
--- 704,708 ----
   "pdtk_midi_dialog %%s \
   %s %d %d %d %d %s %d %d %d %d \
!  %d\n",
  			indevliststring,
  			midiindev1, midiindev2, midiindev3, midiindev4, 

Index: s_audio_jack.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_jack.c,v
retrieving revision 1.5.4.8.2.2
retrieving revision 1.5.4.8.2.3
diff -C2 -d -r1.5.4.8.2.2 -r1.5.4.8.2.3
*** s_audio_jack.c	14 Jul 2005 23:17:33 -0000	1.5.4.8.2.2
--- s_audio_jack.c	16 Jul 2005 11:02:37 -0000	1.5.4.8.2.3
***************
*** 93,96 ****
--- 93,97 ----
  	if (canvas_dspstate == 0)
  	{
+ 		/* dsp is switched off, the audio is open ... */
  		for (j = 0; j < sys_outchannels;  j++) 
  		{
***************
*** 98,103 ****
  			zeroblock(out, dspticks_per_jacktick * sys_dacblocksize);
  		}
- 		
- 		sys_time += sys_time_per_dsp_tick;
  		return 0;
  	}
--- 99,102 ----
***************
*** 120,124 ****
  			return 0;
  		}
! 
  	for (i = 0; i != dspticks_per_jacktick; ++i)
  	{
--- 119,123 ----
  			return 0;
  		}
! 	
  	for (i = 0; i != dspticks_per_jacktick; ++i)
  	{
***************
*** 127,143 ****
  		{
  			t_sample * in = jack_port_get_buffer(input_port[j], nframes);
! 			copyvec_simd(sys_soundin + j * sys_dacblocksize,
! 						 in + i * sys_dacblocksize,
! 						 sys_dacblocksize);
  		}
  
  		/* run dsp */
  		sched_tick(sys_time + sys_time_per_dsp_tick);
! 
  		/* send sound to the output */
  		for (j = 0; j < sys_outchannels;  j++) 
  		{
  			t_sample * out = jack_port_get_buffer (output_port[j], nframes);
! 			copyvec_simd(out + i * sys_dacblocksize,
  						 sys_soundout + j * sys_dacblocksize,
  						 sys_dacblocksize);
--- 126,142 ----
  		{
  			t_sample * in = jack_port_get_buffer(input_port[j], nframes);
! 			copyblock(sys_soundin + j * sys_dacblocksize,
! 				in + i * sys_dacblocksize,
! 				sys_dacblocksize);
  		}
  
  		/* run dsp */
  		sched_tick(sys_time + sys_time_per_dsp_tick);
! 		
  		/* send sound to the output */
  		for (j = 0; j < sys_outchannels;  j++) 
  		{
  			t_sample * out = jack_port_get_buffer (output_port[j], nframes);
! 			copyblock(out + i * sys_dacblocksize,
  						 sys_soundout + j * sys_dacblocksize,
  						 sys_dacblocksize);
***************
*** 149,153 ****
  		
  		/* clear the output buffer */
! 		zerovec_simd(sys_soundout, j * sys_dacblocksize);
  	}
  	
--- 148,152 ----
  		
  		/* clear the output buffer */
! 		zeroblock(sys_soundout, j * sys_dacblocksize);
  	}
  	
***************
*** 363,366 ****
--- 362,378 ----
  	jack_scheduler = scheduler;
  
+ 	
+ 	/* set block copy/zero functions */
+     if(SIMD_CHKCNT(sys_dacblocksize) && simd_runtime_check()) 
+ 	{
+         copyblock = (void (*)(t_sample *,t_sample *,int))&copyvec_simd;
+         zeroblock = &zerovec_simd;
+     }
+     else 
+ 	{
+         copyblock = (void (*)(t_sample *,t_sample *,int))&copyvec;
+         zeroblock = &zerovec;
+     }
+ 
  	/* try to become a client of the JACK server (we allow two pd's)*/
  	if (!jack_client) {
***************
*** 384,391 ****
  		*/
  		if (scheduler == 1)
  			jack_set_process_callback (jack_client, cb_process, 0);
  		else
  			jack_set_process_callback (jack_client, process, 0);
! 		
  
  		jack_set_error_function (jack_error);
--- 396,408 ----
  		*/
  		if (scheduler == 1)
+ 		{
+ 			dspticks_per_jacktick = jack_get_buffer_size(jack_client)
+ 				/ sys_schedblocksize;
  			jack_set_process_callback (jack_client, cb_process, 0);
+ 		}
  		else
  			jack_set_process_callback (jack_client, process, 0);
! 
! 
  
  		jack_set_error_function (jack_error);
***************
*** 462,468 ****
  	}
  
- 	if (scheduler)
- 		dspticks_per_jacktick = jack_get_buffer_size(jack_client)
- 			/ sys_schedblocksize;
  	
  	/* tb: get advance from jack server */
--- 479,482 ----
***************
*** 470,485 ****
  		* 1000. / sys_dacsr * 1000;
  	
- 	/* set block copy/zero functions */
-     if(SIMD_CHKCNT(sys_dacblocksize) && simd_runtime_check()) 
- 	{
-         copyblock = (void (*)(t_sample *,t_sample *,int))&copyvec_simd;
-         zeroblock = &zerovec_simd;
-     }
-     else 
- 	{
-         copyblock = (void (*)(t_sample *,t_sample *,int))&copyvec;
-         zeroblock = &zerovec;
-     }
- 
  	return 0;
  		
--- 484,487 ----

Index: g_numbox.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v
retrieving revision 1.4.8.1
retrieving revision 1.4.8.2
diff -C2 -d -r1.4.8.1 -r1.4.8.2
*** g_numbox.c	12 Jul 2005 15:11:08 -0000	1.4.8.1
--- g_numbox.c	16 Jul 2005 11:02:36 -0000	1.4.8.2
***************
*** 37,41 ****
  static void my_numbox_tick_reset(t_my_numbox *x)
  {
!   if(x->x_gui.x_fsf.x_change && x->x_gui.x_glist)
      {
          x->x_gui.x_fsf.x_change = 0;
--- 37,41 ----
  static void my_numbox_tick_reset(t_my_numbox *x)
  {
! 	if(x->x_gui.x_fsf.x_change && x->x_gui.x_glist)
      {
          x->x_gui.x_fsf.x_change = 0;

Index: m_sched.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v
retrieving revision 1.5.4.35.2.4
retrieving revision 1.5.4.35.2.5
diff -C2 -d -r1.5.4.35.2.4 -r1.5.4.35.2.5
*** m_sched.c	14 Jul 2005 23:17:33 -0000	1.5.4.35.2.4
--- m_sched.c	16 Jul 2005 11:02:37 -0000	1.5.4.35.2.5
***************
*** 438,444 ****
  
  
! static int run_clock_callbacks(double next_sys_time)
  {
! 	if (clock_setlist && clock_setlist->c_settime < next_sys_time) 
  	{
  		do
--- 438,444 ----
  
  
! static void run_clock_callbacks(double next_sys_time)
  {
! 	if (clock_setlist && clock_setlist->c_settime <= next_sys_time) 
  	{
  		do
***************
*** 448,459 ****
  			outlet_setstacklim();
  			(*c->c_fn)(c->c_owner);
- 			if (sys_quit)
- 				break;
  		}
  		while (clock_setlist && clock_setlist->c_settime <= next_sys_time);
- 		return 1;
      }
- 	else 
- 		return 0;
  }
  
--- 448,454 ----
***************
*** 466,469 ****
--- 461,466 ----
      dsp_tick();
  
+ 	run_clock_callbacks(next_sys_time);
+ 
  	/* rethink: should we really do all this midi messaging in the realtime thread ? */
  	sys_pollmidiqueue();
***************
*** 551,555 ****
  				{
  					sched_tick(sys_time + sys_time_per_dsp_tick);
- 					run_clock_callbacks(sys_time);
  				}				
  				if (timeforward == SENDDACS_YES)
--- 548,551 ----
***************
*** 587,593 ****
  				sys_setmiditimediff(0, 1e-6 * sys_schedadvance);
  				
-  				if (run_clock_callbacks(sys_time))
- 					continue;
- 
  				if (sys_pollgui())
  					continue;
--- 583,586 ----





More information about the Pd-cvs mailing list