Getting ready to write pack_waves_simple.  Copied it from pack_waves_fast for now.
codevariant3 is using pack_waves_simple now instead of pack_waves_fast.  There has to be a cleaner way to compute write_wave and read_wave rather than what I am doing in handle_write.