Commit 769fc0c3 authored by alireza tbp's avatar alireza tbp

Update audioseqq.js

parent fff54078
......@@ -110,7 +110,61 @@ var routineTimer;
function experimentInit() {
// Initialize components for Routine "code1"
code1Clock = new util.Clock();
function num1_to_sec(n) {
ran = (Math.floor((Math.random() * ((6 - 1) + 1))) + 1);
total = [[[2, 2, 4, 1, 3, 0.4], [2, 2, 4, 1, 3, 0.4], [2, 2, 4, 3, 1, 0.4]], [[3, 1, 4, 1, 3, 0.4], [3, 1, 4, 1, 3, 0.4], [3, 1, 4, 3, 1, 0.4]], [[3, 1, 4, 2, 2, 0.4], [3, 1, 4, 2, 2, 0.4], [1, 3, 4, 2, 2, 0.4]], [[4, 1, 3, 3, 1, 0.4], [4, 1, 3, 3, 1, 0.4], [4, 3, 1, 3, 1, 0.4]], [[4, 3, 1, 1, 3, 0.4], [4, 3, 1, 1, 3, 0.4], [4, 1, 3, 1, 3, 0.4]], [[4, 3, 1, 2, 2, 0.4], [4, 3, 1, 2, 2, 0.4], [4, 1, 3, 2, 2, 0.4]], [[1, 1, 2, 3, 1, 4, 0.4], [1, 1, 2, 3, 1, 4, 0.4], [1, 1, 2, 1, 3, 4, 0.4]], [[1, 1, 2, 4, 2, 2, 0.4], [1, 1, 2, 4, 2, 2, 0.4], [2, 1, 1, 4, 2, 2, 0.4]], [[2, 1, 1, 1, 3, 4, 0.4], [2, 1, 1, 1, 3, 4, 0.4], [2, 1, 1, 3, 1, 4, 0.4]], [[2, 2, 2, 1, 1, 4, 0.4], [2, 2, 2, 1, 1, 4, 0.4], [2, 2, 1, 1, 2, 4, 0.4]], [[2, 2, 3, 1, 1, 3, 0.4], [2, 2, 3, 1, 1, 3, 0.4], [2, 2, 3, 1, 3, 1, 0.4]], [[3, 1, 1, 3, 2, 2, 0.4], [3, 1, 1, 3, 2, 2, 0.4], [3, 1, 3, 1, 2, 2, 0.4]], [[2, 1, 1, 2, 2, 4, 0.4], [2, 1, 1, 2, 2, 4, 0.4], [1, 1, 2, 2, 2, 4,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0.4], [1, 1, 2, 3, 1, 1, 3, 0.4], [1, 1, 2, 3, 1, 3, 1, 0.4]], [[2, 2, 1, 1, 1, 1, 4, 0.4], [2, 2, 1, 1, 1, 1, 4, 0.4], [2, 1, 1, 2, 1, 1, 4, 0.4]], [[3, 1, 2, 1, 1, 1, 3, 0.4], [3, 1, 2, 1, 1, 1, 3, 0.4], [3, 1, 2, 1, 1, 3, 1, 0.4]], [[3, 1, 2, 2, 1, 1, 2, 0.4], [3, 1, 2, 2, 1, 1, 2, 0.4], [1, 3, 2, 2, 1, 1, 2, 0.4]]];
a = 0;
b = 0;
c = 0;
list = shuffle_list(total);
intervall = list[a][b].length;
// Initialize components for Routine "Intro"
IntroClock = new util.Clock();
text_2 = new visual.TextStim({
win: psychoJS.window,
name: 'text_2',
text: '<Auditory Sequence Judgment>\n\nYou will hear three auditory stimuli in the form of a sequence. One of these sequences is different from others in terms of the duration pattern. \n\nAt the end of the three presentations, you will be asked to indicate which stimulus you found to be different from the other two by pressing either 1, 2, or 3 on the keyboard.\n\nWhenever ready press any key to continue.',
font: 'Arial',
units: undefined,
pos: [0, 0], height: 0.04, wrapWidth: undefined, ori: 0,
color: new util.Color('white'), opacity: 1,
depth: 0.0
});
key_resp_2 = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
// Initialize components for Routine "SOUND"
SOUNDClock = new util.Clock();
sound_1 = new sound.Sound({
win: psychoJS.window,
value: 'A',
secs: (- 1),
});
sound_1.setVolume(1);
// Initialize components for Routine "code2"
code2Clock = new util.Clock();
// Initialize components for Routine "question"
questionClock = new util.Clock();
text = new visual.TextStim({
win: psychoJS.window,
name: 'text',
text: 'Which one was different?\n\nFirst presentation > Key "1"\nSecond presentation > Key "2"\nThird presentation > Key "3"\n',
font: 'Arial',
units: undefined,
pos: [0, 0], height: 0.07, wrapWidth: undefined, ori: 0,
color: new util.Color('white'), opacity: 1,
depth: 0.0
});
key_resp = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
// Create some handy timers
globalClock = new util.Clock(); // to track the time since experiment started
routineTimer = new util.CountdownTimer(); // to track time remaining of each (non-slip) routine
return Scheduler.Event.NEXT;
}
function num1_to_sec(n) {
return Number.parseFloat(((0.22 * n) - 0.05));
}
function num2_to_sec(n) {
......@@ -136,12 +190,7 @@ function experimentInit() {
}
return list;
}
total = [[[2, 2, 4, 1, 3, 0.4], [2, 2, 4, 1, 3, 0.4], [2, 2, 4, 3, 1, 0.4]], [[3, 1, 4, 1, 3, 0.4], [3, 1, 4, 1, 3, 0.4], [3, 1, 4, 3, 1, 0.4]], [[3, 1, 4, 2, 2, 0.4], [3, 1, 4, 2, 2, 0.4], [1, 3, 4, 2, 2, 0.4]], [[4, 1, 3, 3, 1, 0.4], [4, 1, 3, 3, 1, 0.4], [4, 3, 1, 3, 1, 0.4]], [[4, 3, 1, 1, 3, 0.4], [4, 3, 1, 1, 3, 0.4], [4, 1, 3, 1, 3, 0.4]], [[4, 3, 1, 2, 2, 0.4], [4, 3, 1, 2, 2, 0.4], [4, 1, 3, 2, 2, 0.4]], [[1, 1, 2, 3, 1, 4, 0.4], [1, 1, 2, 3, 1, 4, 0.4], [1, 1, 2, 1, 3, 4, 0.4]], [[1, 1, 2, 4, 2, 2, 0.4], [1, 1, 2, 4, 2, 2, 0.4], [2, 1, 1, 4, 2, 2, 0.4]], [[2, 1, 1, 1, 3, 4, 0.4], [2, 1, 1, 1, 3, 4, 0.4], [2, 1, 1, 3, 1, 4, 0.4]], [[2, 2, 2, 1, 1, 4, 0.4], [2, 2, 2, 1, 1, 4, 0.4], [2, 2, 1, 1, 2, 4, 0.4]], [[2, 2, 3, 1, 1, 3, 0.4], [2, 2, 3, 1, 1, 3, 0.4], [2, 2, 3, 1, 3, 1, 0.4]], [[3, 1, 1, 3, 2, 2, 0.4], [3, 1, 1, 3, 2, 2, 0.4], [3, 1, 3, 1, 2, 2, 0.4]], [[2, 1, 1, 2, 2, 4, 0.4], [2, 1, 1, 2, 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0.4]], [[1, 1, 2, 3, 1, 1, 3, 0.4], [1, 1, 2, 3, 1, 1, 3, 0.4], [1, 1, 2, 3, 1, 3, 1, 0.4]], [[2, 2, 1, 1, 1, 1, 4, 0.4], [2, 2, 1, 1, 1, 1, 4, 0.4], [2, 1, 1, 2, 1, 1, 4, 0.4]], [[3, 1, 2, 1, 1, 1, 3, 0.4], [3, 1, 2, 1, 1, 1, 3, 0.4], [3, 1, 2, 1, 1, 3, 1, 0.4]], [[3, 1, 2, 2, 1, 1, 2, 0.4], [3, 1, 2, 2, 1, 1, 2, 0.4], [1, 3, 2, 2, 1, 1, 2, 0.4]]];
a = 0;
b = 0;
c = 0;
list = shuffle_list(total);
intervall = list[a][b].length;
function repetitionn(intervall) {
if ((intervall === 6)) {
return 18;
......@@ -172,7 +221,7 @@ function experimentInit() {
}
}
}
ran = (Math.floor((Math.random() * ((6 - 1) + 1))) + 1);
function stop(ran) {
if ((ran === 1)) {
return num1_to_sec(list[a][b][c]);
......@@ -198,55 +247,6 @@ function experimentInit() {
}
}
}
// Initialize components for Routine "Intro"
IntroClock = new util.Clock();
text_2 = new visual.TextStim({
win: psychoJS.window,
name: 'text_2',
text: '<Auditory Sequence Judgment>\n\nYou will hear three auditory stimuli in the form of a sequence. One of these sequences is different from others in terms of the duration pattern. \n\nAt the end of the three presentations, you will be asked to indicate which stimulus you found to be different from the other two by pressing either 1, 2, or 3 on the keyboard.\n\nWhenever ready press any key to continue.',
font: 'Arial',
units: undefined,
pos: [0, 0], height: 0.04, wrapWidth: undefined, ori: 0,
color: new util.Color('white'), opacity: 1,
depth: 0.0
});
key_resp_2 = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
// Initialize components for Routine "SOUND"
SOUNDClock = new util.Clock();
sound_1 = new sound.Sound({
win: psychoJS.window,
value: 'A',
secs: (- 1),
});
sound_1.setVolume(1);
// Initialize components for Routine "code2"
code2Clock = new util.Clock();
// Initialize components for Routine "question"
questionClock = new util.Clock();
text = new visual.TextStim({
win: psychoJS.window,
name: 'text',
text: 'Which one was different?\n\nFirst presentation > Key "1"\nSecond presentation > Key "2"\nThird presentation > Key "3"\n',
font: 'Arial',
units: undefined,
pos: [0, 0], height: 0.07, wrapWidth: undefined, ori: 0,
color: new util.Color('white'), opacity: 1,
depth: 0.0
});
key_resp = new core.Keyboard({psychoJS: psychoJS, clock: new util.Clock(), waitForStart: true});
// Create some handy timers
globalClock = new util.Clock(); // to track the time since experiment started
routineTimer = new util.CountdownTimer(); // to track time remaining of each (non-slip) routine
return Scheduler.Event.NEXT;
}
var t;
var frameN;
var continueRoutine;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment