[PD-cvs] externals/frankenstein harmonizer.c,1.10,1.11

dmorelli morellid at users.sourceforge.net
Sat Feb 11 16:18:24 CET 2006


Update of /cvsroot/pure-data/externals/frankenstein
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31068

Modified Files:
	harmonizer.c 
Log Message:
notes are sorted, makefile for VCToolKit

Index: harmonizer.c
===================================================================
RCS file: /cvsroot/pure-data/externals/frankenstein/harmonizer.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** harmonizer.c	21 Jan 2006 11:22:52 -0000	1.10
--- harmonizer.c	11 Feb 2006 15:18:22 -0000	1.11
***************
*** 591,596 ****
--- 591,598 ----
  	//t_atom lista[VOICES];
  	t_atom *lista;
+ 	int *winner_notes;
  
  	lista = malloc(sizeof(t_atom)*x->voices);
+ 	winner_notes = malloc(sizeof(int)*x->voices);
  
  	// inizialize tables of notes
***************
*** 641,645 ****
  	for (i=0;i<x->voices;i++)
  	{
! 		SETFLOAT(lista+i, x->population[winner][i]);
  	}
  
--- 643,653 ----
  	for (i=0;i<x->voices;i++)
  	{
! 		winner_notes[i] = x->population[winner][i];
! 	}
! 	SGLIB_ARRAY_SINGLE_QUICK_SORT(int, winner_notes, x->voices, SGLIB_NUMERIC_COMPARATOR)
! 
! 	for (i=0;i<x->voices;i++)
! 	{
! 		SETFLOAT(lista+i, winner_notes[i]);
  	}
  
***************
*** 650,653 ****
--- 658,662 ----
  					 lista);
  	free(lista);
+ 	free(winner_notes);
  }
  
***************
*** 660,664 ****
  void set_current_voices(t_harmonizer *x, t_symbol *sl, int argc, t_atom *argv)
  {
! 	int i=0;	
  	
  	if (argc<x->voices)
--- 669,674 ----
  void set_current_voices(t_harmonizer *x, t_symbol *sl, int argc, t_atom *argv)
  {
! 	int i=0;
! 	int *input_voices;
  	
  	if (argc<x->voices)
***************
*** 667,677 ****
  		return;
  	}
  	// fill input array with actual data sent to inlet
  	for (i=0;i<x->voices;i++)
  	{
! 		x->current_voices[i] = atom_getint(argv++);
  	}
! 
  	generate_voicing(x);
  
  
--- 677,694 ----
  		return;
  	}
+ 	input_voices = malloc(sizeof(int)*x->voices);
  	// fill input array with actual data sent to inlet
  	for (i=0;i<x->voices;i++)
  	{
! 		input_voices[i] = atom_getint(argv++);
  	}
! 	SGLIB_ARRAY_SINGLE_QUICK_SORT(int, input_voices, x->voices, SGLIB_NUMERIC_COMPARATOR)
! 	for (i=0;i<x->voices;i++)
! 	{
! 		x->current_voices[i] = input_voices[i];
! 	}
! 	
  	generate_voicing(x);
+ 	free(input_voices);
  
  





More information about the Pd-cvs mailing list