'script creates waveform channel from event channel. It converts events to instantaneous firing frequency plot var evchan,smoothtime,samplefreq,maxfrequ,newchan, ask$,curs,ok; smoothtime:=0; samplefreq:=10000; maxfrequ:=1000; 'select event channel from which trigger will be get DlgCreate("Parameters for conversion"); DlgChan(1,"Give event Channel",2); DlgReal(2,"Smoothing time (sec, sine shape rise/decay)? 0 for inst. frequ.!",0,1000); Dlgreal(3,"Sampling frequency in Hz?",0,100000); Dlgreal(4,"Maximum frequency in new plot?",0,100000); DlgChan(5,"Channel to write to?",128); 'give list of unused channels ok:=DlgShow(evchan,smoothtime,samplefreq,maxfrequ,newchan); if ok <> 0 then samplefreq:=1/samplefreq; 'convert to time if Cursor(1)<0 then curs:=(Xhigh()-Xlow())/4; CursorNew(XLow()+curs,1); endif; if Cursor(2)<0 then curs:=(Xhigh()-Xlow())/4; CursorNew(Xhigh()-curs,2); endif; interact("Set Cursors around area to convert",1023); 'now convert. Will only convert with cosine shape rise / decay function of frequency [if smoothing time is not 0]. eventtowaveform(smoothtime,evchan,newchan,samplefreq,Cursor(1),Cursor(2),maxfrequ,0); chanshow(newchan); optimise(newchan); endif;