Z-quencer

a MIDI sequencer for the NeXT computer
by Ralph Zazula
zazula@bonehead.tucson.az.us

Version 1.0
June 1991

	
	This program is a very basic MIDI sequencer.  It allows you to :
	
		o	read/write MIDI files
		o	read/write Score files
		o	graphically edit the notes contained in MIDI and Score files
		o	create new parts and add notes to them
		o	play the edited Score* via the MIDI interface (on port B)
		o	change the MIDI channel of parts in a MIDI (Score) file
	
	*the internal representation of a MIDI or Score file is a MusicKit Score object
	
	Reading Files
	As mentioned above, Z-quencer will read either MIDI files or Score files.  The open panel will only display files with either a ".midi" or ".score" extension.  If the selected file has a".midi" extension, it will be read as a MIDI file, if the selected file has any other extension it will be read as a Score file.
	
	Writing Files
	The default file type for writing is a MIDI file.  By giving the output file a ".score" extension in the SavePanel, the file will be written as a Score file.
	
	Main Window Functions
	Once a file has been read in, you have the following options:
	
		o	Play the file (Play button)
		o	Stop a performance in progress (Stop button)
		o	Pause a performance in progress (Pause button)
		o	Change the MIDI channel for output for a part (MIDI Chan form)
		o	Edit a part (Part menu - select the part number from the submenu)
		
	Part Edit Window Functions
	Once you have selected a part to view, you have the following options:
	
		o	Move a note in pitch or time (Click-Drag the note with the mouse)
		o	Delete a note (Double-Click on the note to delete)
		o	Add a note (Double-Click on an empty portion of the view)
		o	Change the duration of a note (Click on a note, hold down the Shift
			key and drag to change the duration)
		o	Add a measure to the part (press the "Add a measure" button)
	
	Creating a new Part
	Use Edit->New Part (Command-n) to create a new empty part and add it to the current Score.  (This is poorly implemented.  See "Features" below for a discussion on it's effects).	
	Preferences
	The Info->Preferences window has 2 options:
	
		o	Quantization - the default quantization for the start time of edited notes 
			(notes are not quantized as they are read in from a file).  The quantization
			will be one over the number specified (ie. 1/N, where N is the number
			specified) times four beats.  For example, if you want to quantize the start
			of notes to the nearest 16th note, enter 16 - to the nearest 8th note triplet,
			enter 12.
			
		o	new note duration - the default length for newly added notes.  This number
			is specified using the same scheme as the Quantization (eg. 8 for 8th 		notes).
			
	"Features"
	Well, as I said, this is a basic ("toy" if you like) sequencer.  It is just the beginning of what I
	plan to do with MIDI sequencing on the NeXT computer.  When using Z-quencer you will undoubtedly find may "features" that seem peculiar.  I have not had enough different types of MIDI files to run through the program to check for problems.  I expect to hear from people like you about what things are going wrong.  Some things I've noticed while writing and playing with this program are:
		
		o	Moving notes in the PartEditView is SLOW.  (I coded this in the most 		straight-forward, simple way I could find.  This is the first area I'm going 		to work on improving.   I've been told using Bitmaps is the answer...  		We'll see).
		
		o	Recording doesn't work! (Right, haven't gotten to that yet.  There are other 		programs on the NeXT that handle MIDI input right now so I didn't feel 		pressed to get that working.  It'll be in the next round... for the meantime, 		use Ensemble or some of the other programs in				/NextDeveloper/Examples/MusicKit)
		
		o	The PartEditView sometimes displays weird stuff! (There's something 		wrong with the PS code in the PartEditView that draws the lines...  		Sometimes they draw through the notes (buttons really) and sometimes 		don't draw at all...  Just scroll the view back-forth/up-down and they 		should settle in.  Another thing on my list for 2.0 (1.1 whatever...)
		
		o	The performance sounds shaky during the first few beats. (Well, I haven't 		figured out how I want to do the managing of the Conductor and 		ScorePerformer yet.  There is a tradeoff between accuracy (MIDI timing or 		Conductor timing) and being able to Stop and Pause (Can't if I do 		[Conductor setClocked:NO]).  I know there is a way to get both but I 		haven't sat down and worked it out yet.  Don't fret, :-) I'll have it figured 		out in no time.)
		
		o	My MIDI file has only 2 parts but I see all 16 in the MainWindow or it 		only has 2 parts but they are in parts 4 and 8... (This is related to how the 		Score object converts level 0 MIDI files to Parts.  Just write the MIDI file 		back out and read it in again.  Then the parts will be sequential starting at 		part 1.  See the readMidifileStream: method of the Score class for more 		details).
		
		o	Newly created parts are added to the end of the Score's parts List.  If you 		have a level 0 file (see above) that has a lot of "missing" parts, follow the 		above steps to compact them and re-read the file.  Now newlay added parts 		will start where the others left off.
		
	To Do
	This is a HUGE list - Just about everything you can think of!!  Here's a short version (in no particular order - except for the first one...):
	
		o	speed up the PartEditView  
		o	MIDI recording 
		o	features like Quanization, Transposition
		o	Looping/Muting/Naming parts
		o	sounding notes when you add them
		o	more preferences
		o	better editing scheme - ability to select notes and cut/copy/paste them 		individually or in groups
		o	implement a Note inspector (velocity, duration, pitch ...)
		o	Arranging facility - editing on a Part level
		o	volume, pan, MIDI controller sliders
		o	anything else I (or you) can think of

	Do have fun with this program and feel free to send any suggestions you have to me (see the top of this file for an E-mail address).  I really want to get involved with other people using the NeXT to do music, MIDI or otherwise, and I hope this program provides a good starting piont for sequencing on this platform.  
	
	I would also like to thank NeXT and the authors of the Music Kit for making this program and the fun I've had writing/using it possible!!!!!

	Ralph Zazula