head	1.4;
access;
symbols
	rel-0-2-1:1.3
	before_adj_struct:1.3
	jack:1.3.0.2
	rel-0-1-0:1.2
	rel-0-0-0:1.1;
locks; strict;
comment	@ * @;


1.4
date	2007.03.22.20.55.43;	author robertatwood;	state Exp;
branches;
next	1.3;

1.3
date	2005.08.20.18.26.42;	author robertatwood;	state Exp;
branches;
next	1.2;

1.2
date	2005.04.03.20.05.39;	author robertatwood;	state Exp;
branches;
next	1.1;

1.1
date	2004.04.16.11.36.56;	author robertatwood;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Updated GPL text to reflect new address of Free Software foundation
Prepare to move repository to savannah.nongnu.org
@
text
@/**************************************************************
This file is part of the Variseq program.
Variseq -- a variable pitch and step sample sequencer
Copyright (C) 2004  Robert Atwood r.atwood (at) imperial (dot) ac (dot) uk

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 
See the file COPYING for more information
**************************************************************/


#ifndef PATTERN_H
#define PATTERN_H
#include <math.h>
#include <stdio.h>
#include "notes.h"
typedef struct patpub_str{ 
		int nnotes; /*number of separate notes in the pattern */
		float vol;  /*master volume */
		float pan;
		float speed; /* beats per minute (4 note beats by default)*/
		float smooth; /* amount of end smoothing of the note */
		int my_num;
		int frames_per_note;
		int frames_per_tick; /* default 8, max 16 ticks per note .. TODO: make variable */
		int totalframes; /* may be rounded down */
		int totalticks; 
}patpub;

class pattern:public patpub {
  public:

	note * notes;

   void init_pattern(int n,int s);

   /* constructors for the pattern */
   pattern(){ init_pattern(8,120); };
   pattern(int n){ init_pattern(n,120); };
   pattern(int n,int s){ init_pattern(n,s); };

   ~pattern(){ delete (notes);};

   /* inlines for small adjusments to the settings */
   void setvol(float v){ vol = v;};
   void setvol(int notenum,float v){ notes[notenum].setvol(v);};
   void setclip(int notenum,float v){ notes[notenum].setclip(v);};
   void setpan(float p){pan=p;};
   void setpan(int notenum,float p){ notes[notenum].setpan(p);};

   /* routines to tinker with the notes */
   void setnotestate(int notenum,int p){ notes[notenum].setstate(p);};
   void setnotesample(int notenum,int snum){
       notes[notenum].setsample(snum);
   }
   void setnoteoctave(int notenum,int oct){
       notes[notenum].setoctave(oct);
   }
   void change_note_length(int nn, int nl);
   void setnote(int notenum,int nlevel){
       notes[notenum].setnote(nlevel);
   }

   int mynum(){return my_num;};
   int mynum (int newnum){ my_num = newnum; return my_num;}

   void calcticks();
   void calcframes();

   void write (sbuf * buf,int start);
   void writenote(sbuf * buf,int n);
   void setspeed(float s);
   void setsmooth(float s);

   void savepat(FILE * fp);
   void loadpat(FILE * fp);
   void dumppat(FILE * fp);
 };
#endif

/* $Id: pattern.h,v 1.3 2005/08/20 18:26:42 robertatwood Exp $ */
@


1.3
log
@Added a save/restore workspace function
Added window to display names of samples
@
text
@d18 1
a18 1
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
d22 1
d92 1
a92 1
/* $Id: pattern.h,v 1.1.1.1 2004/07/11 19:02:55 robert Exp $ */
@


1.2
log
@Changed the buffer writing so that samples extend into unused notes.
Altered file choose usage to correctly use the FLTK chooser
@
text
@@


1.1
log
@Initial version uploaded to Sourceforge
@
text
@d28 1
a28 1
		int nnotes; /*number of 1/4 beats in teh measure */
d91 1
a91 1
/* $Id: pattern.h,v 1.7 2004/04/12 13:22:33 robert Exp $ */
@

