 
 
 f o r m   C a l c u l a t e   d u r a t i o n s   o f   l a b e l e d   s e g m e n t s 
 
 	 c o m m e n t   W h e r e   a r e   y o u r   w a v / T e x t G r i d / P i t c h   f i l e s ? 
 
 	 t e x t   o p e n p a t h  W(kdQeXhleN[Xe>veNY9W0W@ 
 
 	 c o m m e n t   W h i c h   t i e r   o f   t h e   T e x t G r i d   o b j e c t   w o u l d   y o u   l i k e   t o   a n a l y s e ? 
 
 	 i n t e g e r   T i e r   1 
 
 	 c o m m e n t   H o w   m a n y   p i t c h   p o i n t   n u m b e r s   w o u l d   y o u   l i k e   t o   e x t r a c t ? 
 
 	 i n t e g e r   p o i n t n u m   3 0 
 
 	 c o m m e n t   W h e r e   d o   y o u   w a n t   t o   s a v e   t h e   r e s u l t s ? 
 
 	 t e x t   t e x t f i l e   p i t c h o u t p u t . c s v 
 
 e n d f o r m 
 
 
 
 i f   l e f t $ ( o p e n p a t h $ , 1 ) < > " \ " 
 
 	 o p e n p a t h $ = o p e n p a t h $ + " \ " 
 
 e n d i f 
 
 
 
 C r e a t e   S t r i n g s   a s   f i l e   l i s t . . .   f i l e L i s t   ' o p e n p a t h $ ' * . T e x t G r i d 
 
 n u m b e r O f F i l e s = G e t   n u m b e r   o f   s t r i n g s 
 
 f i l e d e l e t e   ' t e x t f i l e $ ' 
 
 f i l e a p p e n d   " ' t e x t f i l e $ ' "   l a b e l , d u r a t i o n , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 , 1 1 , 1 2 , 1 3 , 1 4 , 1 5 , 1 6 , 1 7 , 1 8 , 1 9 , 2 0 , 2 1 , 2 2 , 2 3 , 2 4 , 2 5 , 2 6 , 2 7 , 2 8 , 2 9 , 3 0 , ' n e w l i n e $ ' 
 
 f o r   i f i l e   f r o m   1   t o   n u m b e r O f F i l e s 
 
 s e l e c t   S t r i n g s   f i l e L i s t 
 
 f i l e N a m e $ = G e t   s t r i n g . . .   ' i f i l e ' 
 
 s i m p l e N a m e $ = f i l e N a m e $ - " . T e x t G r i d " 
 
 w a v N a m e $ = s i m p l e N a m e $ + " . w a v " 
 
 p i t c h N a m e $ = s i m p l e N a m e $ + " . P i t c h " 
 
 
 
 R e a d   f r o m   f i l e . . .   ' o p e n p a t h $ ' ' p i t c h N a m e $ ' 
 
 s e l e c t   P i t c h   ' s i m p l e N a m e $ ' 
 
 D o w n   t o   P i t c h T i e r 
 
 R e a d   f r o m   f i l e . . .   ' o p e n p a t h $ ' ' w a v N a m e $ ' 
 
 R e a d   f r o m   f i l e . . .   ' o p e n p a t h $ ' ' f i l e N a m e $ ' 
 
 
 
 
 
 n u m b e r O f I n t e r v a l s   =   G e t   n u m b e r   o f   i n t e r v a l s . . .   t i e r 
 
 
 
 f o r   i n t e r v a l   f r o m   1   t o   n u m b e r O f I n t e r v a l s 
 
 	 s e l e c t   T e x t G r i d   ' s i m p l e N a m e $ ' 
 
 	 l a b e l $   =   G e t   l a b e l   o f   i n t e r v a l . . .   t i e r   i n t e r v a l 
 
 	 #   i f   t h e   i n t e r v a l   h a s   s o m e   t e x t   a s   a   l a b e l ,   t h e n   c a l c u l a t e   t h e   d u r a t i o n . 
 
 	 i f   l a b e l $   < >   " " 
 
 	 	 s t a r t   =   G e t   s t a r t i n g   p o i n t . . .   t i e r   i n t e r v a l 
 
 	 	 e n d   =   G e t   e n d   p o i n t . . .   t i e r   i n t e r v a l 
 
 	 	 d u r a t i o n   =   e n d   -   s t a r t 
 
 	 	 f i l e a p p e n d   " ' t e x t f i l e $ ' "   ' l a b e l $ ' , ' d u r a t i o n ' , 
 
 	 	 s e l e c t   P i t c h T i e r   ' s i m p l e N a m e $ ' 
 
 	 	 s t e p n u m = p o i n t n u m - 1 
 
 	 	 t e m p s t e p = d u r a t i o n / s t e p n u m 
 
 	 	 f o r   i i   f r o m   0   t o   s t e p n u m 
 
 	 	 	 t e m p T i m e = s t a r t + t e m p s t e p * i i 
 
 	 	 	 t e m p V a l u e = G e t   v a l u e   a t   t i m e . . .   ' t e m p T i m e ' 
 
 	 	 	 t e m p V a l u e = ' t e m p V a l u e : 0 ' 
 
 	 	 	 f i l e a p p e n d   " ' t e x t f i l e $ ' "   ' t e m p V a l u e ' , 
 
 	 	 e n d f o r 
 
 	 	 f i l e a p p e n d   " ' t e x t f i l e $ ' "   ' n e w l i n e $ ' 
 
 	 	 #   a p p e n d   t h e   l a b e l   a n d   t h e   d u r a t i o n   t o   t h e   e n d   o f   t h e   t e x t   f i l e ,   s e p a r a t e d   w i t h   a   t a b : 	 	 
 
 	 	 # r e s u l t l i n e $   =   " ' l a b e l $ ' 	 ' d u r a t i o n ' ' n e w l i n e $ ' " 
 
 	 	 # f i l e a p p e n d   " ' t e x t f i l e $ ' "   ' r e s u l t l i n e $ ' 
 
 	 	 
 
 	 e n d i f 
 
 e n d f o r 
 
 s e l e c t   P i t c h   ' s i m p l e N a m e $ ' 
 
 p l u s   P i t c h T i e r   ' s i m p l e N a m e $ ' 
 
 R e m o v e 
 
 s e l e c t   S o u n d   ' s i m p l e N a m e $ ' 
 
 p l u s   T e x t G r i d   ' s i m p l e N a m e $ ' 
 
 R e m o v e 
 
 e n d f o r 
 
 s e l e c t   a l l 
 
 R e m o v e 
 
 e x i t  Wepcn]~cS ! 
 
 
 
 #   F i n a l   v e r s i o n :   Q i b i n   R a n ,   2 0 1 8 - 1 2 - 1 0