         values = [Float]()
         let slope = Float(2.0) / Float(size)
         for i in 0..<size {
-            if i < size / 2 {
-                values.append(slope * Float(i))
-            } else {
-                values.append(slope * Float(-i) + 2.0)
+            let phsOffset = (Int)(phase*size)
+            if (i+phsOffset)%size < size / 2 {
+                values.append(slope * Float((i+phsOffset)%size))
+            } else {
+                values.append(slope * Float((-i-phsOffset)%size) + 2.0)
             }
         }
     }

    /// Instantiate the table as a sawtooth wave
    mutating func positiveSawtoothWave() {
        values = [Float]()
        for i in 0..<size {
            values.append(Float(i)/Float(size))
        }
    }

    /// Instantiate the table as a reverse sawtooth wave
    mutating func positiveReverseSawtoothWave() {
        values = [Float]()
        for i in 0..<size {
            values.append(1.0 - Float(i)/Float(size))
        }
    }

    /// Instantiate the table as a sine wave
    mutating func positiveSineWave() {
        values = [Float]()
        for i in 0..<size {
            values.append(0.5 + 0.5 * sin(2 * 3.14159265 * Float(i)/Float(size)))
        }
    }
}

    /// Instantiate the table as a sawtooth wave
    mutating func standardSawtoothWave() {
        values = [Float]()
        let phsOffset = (Int)(phase*size)
        for i in 0..<size {
            values.append(-1.0 + 2.0*Float((i+phsOffset)%size)/Float(size))
        }
    }

    /// Instantiate the table as a reverse sawtooth wave
    mutating func standardReverseSawtoothWave() {
        values = [Float]()
        let phsOffset = (Int)(phase*size)
        for i in 0..<size {
            values.append(1.0 - 2.0*Float((i+phsOffset)%size)/Float(size))
        }
    }

    /// Instantiate the table as a sine wave
    mutating func standardSineWave() {
        values = [Float]()
        let phsOffset = (Int)(phase*size)
        for i in 0..<size {
            values.append(sin(2 * 3.14159265 * Float(i+phsOffset)/Float(size)))
        }
    }

