' this little program converts an event channel with spike events to a sequencer file with stimuli ' max. 250 spike events, because every spike needs 4 lines of code in the sequencer, and spike2 ' can only handle 1025 lines of sequencer code... var kanal,n,z,dacport,spike[10000],delay$,pulsedura,zaehl,logfilename$,pulseamp, log%; n:=1; WindowVisible (3); 'sets the time view to the front kanal:=input("which channel do you want to convert?",1); ' holds channel to convert events from dacport:=input("which DAC port of the 1401?",1); ' the port of the 1401 that is used for stimulation delay$:=input$("give character for start of sequencer","a"); 'character key to start stimulation in the sequencer pulsedura:=input("pulseduration for single event in ms?",5); 'pulseduration in sequencer pulsedura:=pulsedura/1000; pulseamp:=input("pulseamplitude for stimulation?",1); 'pulseamplitude for stimulation (should be superthresold) 'make new Cursors Cursordelete(-1); Cursornew(); Cursornew(Cursor(1)+1); ' check for too many spikes repeat interact("set Cursors to begin and end of events to export",1023); zaehl:=count(kanal,Cursor(1),Cursor(2)); if zaehl>249 then interact("there are too many spikes, make sure you have less than 250",1023); endif; until zaehl<250; 'put spike events from channel in an array (spike[n]) while Cursor(1)