<?php
	include 'ars2head.php';
?>
	<div class="bold">Technical overview</div>
	<br/>
	<div class="justify">
		The ARS2 can roughly be divided into three "portions"; the analog portion, the digital portion and
		the software portion.<br/>
		<br/>
		The ARS2 started out as a analog project but has developed in to a analog synthesizer with
		digital control. The synthesis portion is still analog and is built up in a 
		<div class="italic">modular</div> sense so that modifying one function does not imply having to 
		change the whole internal circuitry. Thus, when adding the digital portion of the synthesizer,
		none of the analog functions where changed, they were merely interfaced on some critical points
		with a digital CV generator instead of a analog. 
		<br/><br/>
	</div>
	<div class="bold" id="analogportion">The analog portion</div>
	<br/>
	<div class="center"><a href="schematics/analogportion.ps"><img class="blockdia" alt="" src="schematics/analogportion.gif" /></a></div>
	<div class="imagetextleft">Click the picture for a more detailed postscript file</div>
	<div class="justify">
		<br/>
		Above is a function diagram of the analog portion of the synthesizer. As can be seen in the diagram,
		the synthesizer contains the usual building blocks you would expect to find in a analog synthesizer; 
		Two VCOs, a VCF, two ADSRs, a LFO, a mixer, a VCA and a output stage. Additional circuitry includes a
		simple ringmodulator, a suboctave generator and a "signal matrix".
		In the middle of the diagram, spanning from the VCOs, the mixer, the VCF, the VCA and finally the output 
		stage is the soundpath. All the other lines are Control Voltage connections. <br/>
		<br/>
		The digital interfacing is done via the	Quad S&amp;H, the GATE signal is generated directly by the PIC. 
		The digital portion does not change any of the contents in the soundpath, it only generates 
		four Control Voltages.<br/>
		<br/>
		The signal matrix is a circuit which compensates for the fact that the SP3T switches i used have a
		NC (no connection) state as the middle state. To be able to route the signal three directions instead
		of two, i cooked up a small routing circuit (hence matrix) that uses FET switches and the SP3T outputs
		as digital controls to route the signal in question.
	</div>
	<br/>
	<div class="bold" id="digitalportion">The digital portion</div>
	<br/>
	<div class="center"><a href="schematics/digitalportion.ps"><img class="blockdia" alt="" src="schematics/digitalportion.gif" /></a></div>
	<div class="imagetextleft">Click the picture for a more detailed postscript file</div>
	<div class="justify">
		<br/>
		Above is a function diagram of the digital portion of the synthesizer.
		This part is separated from the analog in the way that all the
		communication <div class="italic">from</div> the PIC interface to the analog
		circuitry is done via the Quad S&amp;H, with exception for the GATE signal.
		<br/><br/>
		The function of the Quad S&amp;H is to sample the value currently presented at the D/A output and store
		it in one of the four S&amp;H's. The PIC decides what value to output and which S&amp;H that is allowed
		to sample, thus from one input being able to output four analog lines.
		The refresh of the S&amp;H's is fairly critical and the design allways leaves one S&amp;H charging.
		<br/><br/>
		The VCO's are conncted back to the PIC inteface to allow for the frequency counting that is a (THE) vital
		part of the tuning function.
		<br/><br/>
		Since choosing a PIC with a limited number of output- and input-pins, all datacommunication is
		done via a small set of shared outputs/inputs with the exception that each function has a dedicated 
		<div class="italic">enable</div> pin.
	</div>
	<br/>
	<div class="bold" id="softwareportion">The software portion</div>
	<br/>
	<div class="center"><a href="schematics/softwareportion.ps"><img class="blockdia" alt="" src="schematics/softwareportion.gif" /></a></div>
	<div class="imagetextleft">Click the picture for a more detailed postscript file</div>
	<div class="justify">
		<br/>
		The software is based upon the USB/CDC example code supplied by Microchip. It started out as a simple
		USB MIDI to CV for controlling the VCO's pitch but quickly evolved into a small software library.<br/>
		<br/>
		The main ARS2 functionality can be divided into two different phases; the initialization phase and the
		looping phase. During initialization all variables are setup and necessary hardware initializations
		are done. <br/>
		<br/>
		The main loop is divided into different <div class="italic">modes</div>, this is used to define specific behaviour
		for processor-heavy functions that needs the CPUs (almost) undivided attention. This statement needs to
		be clarified; "almost" undivided attention means simply that there is no way of escaping the USB-communication
		overhead, this is done deliberately to avoid usb hosts to interpret the synthesizer as malfunctioning or
		not turned on. The only existing <div class="italic">modes</div> so far is "normal" and "tune".<br/>
		<br/>
		In normal mode the sequence of operation goes as follows:<br/>
		<ol>
			<li>Fetch USB MIDI data. If any, store it as incoming MIDI message</li>
			<li>Scan keyboard for change. If any, store it  as incoming MIDI message</li>
			<li>Add any incoming MIDI message to the MIDI Monitor history</li>
			<li>Process menusystem - this can entail displaying a message, a menu, a setting or a selected function
				it can also entail a on-the-fly change of any setting</li>
			<li>Check if any external controllers have changed value.
				<div class="underline">this is not implemented yet</div></li>
			<li>Process incoming MIDI message - takes care of key queing and decides on new values to
				be outputed to VCO1, VCO2, VCF, VCA and GATE.</li>
			<li>Process arpeggios - this function overrides the VCO1 and/or VCO2 pitch setting set by
				the previous stage if the arpeggio for the VCO in question is turned on.</li>
			<li>Send new values to S&amp;H or update old values</li>
		</ol>
		<!-- TODO
		
			* MIDI Monitor is missing in flowchart
			* All flowcharts needs their texts re-aligned
		
		
		-->
	</div>
<?php
	include $myroot . 'footer.html';
?>
