     let minorScaleSemis = [2, 7, 14, 19]
     let major = "major"
     let minor = "minor"
+    let rhythm = "rhythm"
+    let mono = "mono"
+    let poly = "poly"
+    let drumPitchOne = 1
+    let drumPitchTwo = 2
     let musicOctave = 12
-    let drumOctave = 2
-    let harmony = "harmony"
-    let melody = "melody"
-    let rhythm = "rhythm"
     
     //This function performs the procedural loop generation method
-    func notesEngine(compositionType: String) {
-        
-        if compositionType == self.harmony || compositionType == self.melody {
-            var octave = self.musicOctave
-            if compositionType == self.melody {
+    func notesEngine(voiceMode: String, intervalOne: Int, intervalTwo: Int, iterations: Int, sequenceLength: Int) {
+        var iterations = iterations
+        var processLoop = [Int]()
+        var beat = 0
+        var processInterval = intervalOne
+        var currentPitch = self.tonicNote
+        while iterations > 0 {
+            if processInterval == intervalOne {
+                processInterval = intervalTwo
+            } else {
+                processInterval = intervalOne
+            }
+            processLoop[beat] += 1
+            if voiceMode == self.mono{
                 //delete any lower notes in the event of a collision
+                trackHandle.clearBeat(beat)
             }
-        } else if compositionType == self.rhythm {
-            var octave = self.drumOctave
-            
-        } else {
-            println("[NotesAndScales - notesEngine]: compositionType must be 'harmony', 'melody' or 'rhythm'")
-            exit(-1)
+            trackHandle.addNote(0, trackChannel: 0, pitch: currentPitch, beat: beat, duration: 1, volume: 1)    //Need to add methods to populate (and control) all this shit...
+            currentPitch = self.scalesGenerator(currentPitch)
+            beat += processInterval
+            iterations -= 1
+            if beat > sequenceLength {
+                beat -= sequenceLength + 1
+            }
         }
     }
     
     //This function provides notesEngine with the next note in the sequence.
-    func scalesGenerator(currentPitch: Int) {
+    func scalesGenerator(currentPitch: Int) -> Int{
         
         var nextPitch = currentPitch
-        
+        //in the case of melody and harmony
         if self.baseScale == self.major || self.baseScale == self.minor {
             var currentInterval = currentPitch - self.tonicNote
             while currentInterval > self.musicOctave {

        } else if baseScale == self.minor {
            self.tones = self.minorScaleTones
            self.semis = self.minorScaleSemis
        } else {
            println("[NotesAndScales - init]: baseScale must be 'major' or 'minor'")
            exit(-1)
        }
    }

    var baseScale = ""
    var tempoBPM = 120
    var tonicNote = 0
    var trackHandle = TrackHandle()
    
    //Class Constants
    let majorScaleTones = [0, 2, 5, 7, 9, 12, 14, 17, 21, 24]
