# reverses single selected waveform within consecutive chunks after Saberi (1999) # corrected to contain new-style syntax 1/9/00 - cjd form Saberi reversal comment Reverses waveform within consecutive chunks after Saberi (1999) positive Chunk_length_ms 20 boolean Play_after_synthesis 1 boolean Keep_window_open 1 boolean Cut_at_zero_crossings 1 endform chunk_length = chunk_length_ms/1000 fend = Get finishing time sound$ = selected$("Sound",1) Copy... 'sound$'r'chunk_length_ms' Edit editor Sound 'sound$'r'chunk_length_ms' Move B to... 0.0 Move E to... 0.0 repeat Move B to E Move E by... 'chunk_length' if cut_at_zero_crossings = 1 Move E to nearest zero crossing endif epos = Get E Reverse selection until fend - epos <= chunk_length if keep_window_open = 0 Close endif endeditor if play_after_synthesis = 1 Play endif