-
Notifications
You must be signed in to change notification settings - Fork 13
waitForTrigerr, from KbPressWait to KbCheck #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
marcobarilari
merged 6 commits into
cpp-lln-lab:dev
from
marcobarilari:marco_waitForTrigger-update
Oct 5, 2020
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bc5ff23
change kbPressWait to KbCheck
marcobarilari a410e6f
modify the demo for best practice
marcobarilari 6dc9542
delete the check for all key released
marcobarilari 29254b2
fix md dead link
marcobarilari eb34ca3
Apply suggestions from code review
marcobarilari dbf563b
Update src/waitForTrigger.m
marcobarilari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,19 @@ | ||
| addpath(genpath(fullfile(pwd, '..', 'src'))); | ||
| % add parent/src directory to the path (to make sure we can access the CPP_PTB functions) | ||
|
|
||
| %% | ||
| cfg.testingDevice = 'mri'; | ||
| addpath(genpath(fullfile(pwd, '..', 'src'))); | ||
|
|
||
| cfg.mri.triggerNb = 2; | ||
| cfg.mri.triggerNb = 5; | ||
|
|
||
| cfg.mri.triggerKey = 'space'; | ||
| cfg.mri.triggerKey = 't'; | ||
|
|
||
| KbName('UnifyKeyNames'); | ||
|
|
||
| %% | ||
| % waitForTrigger(cfg); | ||
|
|
||
| %% | ||
| quietMode = true; | ||
| quietMode = false; | ||
| % waitForTrigger(cfg, [], quietMode); | ||
|
|
||
| %% | ||
| nbTriggersToWait = 1; | ||
| waitForTrigger(cfg, [], quietMode, nbTriggersToWait); | ||
| waitForTrigger(cfg, [], quietMode, cfg.mri.triggerNb); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @marcobarilari, I know you close this issue/merged this PR. But I want to ask two things.
[sec, keyCode] = KbPressWait(deviceNumber);and have the
secas output of this function.sec = waitForTrigger(varargin)Then I call in my main exp script:
cfg.experimentStart = waitForTrigger(cfg)Question here is do you see any logic mistake for storing onsets with this way of using the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello!
(1) I don't think that there is any "logic mistake" in using such secondary measures unless they are not in the right place in a script. (primary one would be like
startTime = PsychPortAudio(‘Start’, ...). It depends what is your purpose.Though, I understand now why updating the submodels breaks your scripts :) and maybe here is the annoying thing that might tell you to not change function this way.
If I can suggest, you have the original
waitForTriggerthat, if I understand correctly, will pace your stimulation and right after that you can usewaitForTrigger(cfg) onset = GetSecs; *stimulation* estStopTime = GetSecs; duration = estStopTime - onset;There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look who is being mean now.. I only changed this function - only today. all the other submodule issues are due to submodule itself 👯
I'm using like this and it makes puurfect onsets (e.g. it's precisely right after my onsetDelay the stim starts) - without annoying decimal .00345 sort of things:
See my point? if I use GetSecs, then everything will be slightly weirdly numbered...
Also @marcobarilari I see that you do not use any buffer for your audio exp, so no audio cracks? That's good but I wonder you are buffering somewhere in your audio-mot localiser?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is actually a fair point.....
we fill the buffer here
subfun/doAuditoryMotion.m line 46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup i saw that one and i was using that as well
FillBufferandStart... then in every first run, in the very first block there were audio cracks, so I'm usingStartwith option (see below). Then I remembered during my aud-mot exp, i was also inserting such option:Just to warn you to pay attention to audio 。◕‿◕。
btw, if you see my point,...does it mean you would consider changing the
waitForTriggerfor such optional use? ♥‿♥There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big dilemma :) can we pause this discussion for a couple of days? Maybe let me move this conversation in an issue and let's come back to it later.