if (NoteData[i].Pitch)\r
                {\r
                        /* Use the top 8 bits of the table position as the sample table index */\r
-                       uint8_t TableIndex = ((uint8_t*)&NoteData[i].TablePosition)[3];\r
+                       uint8_t TableIndex = (NoteData[i].TablePosition >> 24);\r
                        \r
                        /* Add the new tone sample to the accumulator and increment the table position */\r
                        MixedSample += SineTable[TableIndex];\r