How to set a pause after each round of flashings in P300?

Forum for discussion on different user applications
Locked
Ray Ma
Posts: 14
Joined: 15 Feb 2010, 16:39

How to set a pause after each round of flashings in P300?

Post by Ray Ma » 23 Jul 2010, 12:52

Hi,

We would like to set a pause of 500ms after each round of flashings. For example, in a 6x6 menu, there are 12 flashes in each round, we'd like to pause for 500ms after the flash of the 12th stimulus code.

We've tried to modify the code in OnNextStimulusCode, so it looks like:

Code: Select all

....
        if( mSequencePos == mSequence.end() )
        {
		int numBlocks = 0.5 * 400 / 8;
		int endSeq = mSequence.size()-1;
		Associations()[ endSeq ].SetISIMaxDuration( numBlocks );
		Associations()[ endSeq ].SetISIMinDuration( numBlocks );

                int prevStimulusCode = *mSequence.rbegin();
                // the rest are not changed
....
It seems to have added a 500ms pause after the first round of flashings, however, BCI2000 said "Warning: DataIOFilter::EvaluateTiming: Roundtrip time approaches block duration (currently 83.44%)." and the following rounds of flashings are messed up, where instead of flashing 12 rows/columns, it only flashed a few of the 12 stimuli. We guessed it might be due to BCI2000 trying to skip some of the flashings in order to make up for the pause and keep the total duration of a round consistent with what it calculated from the ISI.

We are wondering how we should go about this. Could you give us some suggestions? Thanks very much!

Ray

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

duration

Post by gschalk » 23 Jul 2010, 13:40

Hi,

I think what you are trying to do can be done with the parameter PostSequenceDuration. Please check the documentation of the P3Speller on the wiki or in the BCI2000 book.

Gerv

Ray Ma
Posts: 14
Joined: 15 Feb 2010, 16:39

Post by Ray Ma » 23 Jul 2010, 13:54

Hi Gerv,

Thanks for the reply! Actually we've tried setting that parameter, but it's not working the way we expected.

For example, suppose we have 6x6 matrix, 20 repetitions. What we wanted is to have a pause after the 12 intensifications of each repetition (or say sequence). But PostSequenceDuration actually only adds a pause after all the 20 repetitions, ie after the 240 flashings.

I hope this clarifies the issue a little. Thanks!

Ray

mellinger
Posts: 1097
Joined: 12 Feb 2003, 11:06

Post by mellinger » 26 Jul 2010, 09:43

Ray,

your approach should work in principle. However, you will need to implement it differently. After the sequence has been shuffled, obtain the stimulus code at the last sequence position, and set its ISI to the desired value. Also, you will need to reset that stimulus' ISI to its prior value before the sequence is shuffled.

Thus I suggest the following:

Code: Select all

if( mSequencePos == mSequence.end() )
{
  int prevStimulusCode = *mSequence.rbegin();
  // insert this before the while loop
  Associations[prevStimulusCode].SetISIMinDuration( -1 );
  Associations[prevStimulusCode].SetISIMaxDuration( -1 );
  // end of insertion
  do
  {
  } while( ... );
  // insert this after the while loop
  int lastStimulus = *mSequence.rbegin();
  int numBlocks = ...; // desired ISI duration after last stimulus
  Associations[lastStimulus].SetISIMinDuration( numBlocks );
  Associations[lastStimulus].SetISIMaxDuration( numBlocks );
  // end of insertion
  ...
}
HTH,
Juergen

EDIT: changed standard ISI duration to -1

Locked

Who is online

Users browsing this forum: No registered users and 1 guest