Commit dda94227 authored by Saskia Wepner's avatar Saskia Wepner

removed hard-coded file paths and names. added some comments and made some...

removed hard-coded file paths and names. added some comments and made some minor improvements. should be continued one day.
parent f68fb707
...@@ -13,6 +13,14 @@ function ita_listeningtest_JND(soundPath, soundPathTrain, fileType) ...@@ -13,6 +13,14 @@ function ita_listeningtest_JND(soundPath, soundPathTrain, fileType)
% ita_write(morseNumbers(iNumber), fullfile(soundPath, sprintf('Morse Code Number %i.ita', rem(iNumber, 10)))); % ita_write(morseNumbers(iNumber), fullfile(soundPath, sprintf('Morse Code Number %i.ita', rem(iNumber, 10))));
% end % end
% Usage:
% ita_listeningtest_JND(soundPath, soundPathTrain, fileType)
% soundPath is the path with your sound files are of file type fileType
% soundPathTrain is the path containing your training files
% BE AWARE that files will be taken pair wise; means that always two
% subsequent files will be taken as a couple that is compared during the
% experiment.
%% %%
%%% INITIALIZATION OF GUI INPUT DATA %%% INITIALIZATION OF GUI INPUT DATA
br = newline; br = newline;
...@@ -249,19 +257,25 @@ switch gData.nextPhase ...@@ -249,19 +257,25 @@ switch gData.nextPhase
end end
close(wbh) close(wbh)
% show text
set( gData.h.text , 'string', gData.ltData.compareQuestion)
% show buttons and disable them
set([gData.h.buttonA gData.h.buttonB gData.h.text ] , 'visible', 'on');
set([gData.h.buttonA gData.h.buttonB] , 'enable', 'off');
% % play A % set colour of currently played sound to green
% currSounds(1).play set(gData.h.buttonA, 'BackgroundColor', 'g');
% % pause % play stimulus
% pause(gData.ltData.pauseBetween)
% % play B
% currSounds(2).play
ita_portaudio_run(currSounds(1), 'OutputChannels', 1:2, 'Block') ita_portaudio_run(currSounds(1), 'OutputChannels', 1:2, 'Block')
ita_portaudio_run(currSounds(2), 'OutputChannels', 1:2, 'Block') % reset colour again
set(gData.h.buttonA, 'BackgroundColor', [0.94 0.94 0.94]);
set([gData.h.buttonA gData.h.buttonB gData.h.text ] , 'visible', 'on'); % ... and the same for the second stimulus / button
set( gData.h.text , 'string', gData.ltData.compareQuestion) set(gData.h.buttonB, 'BackgroundColor', 'g');
ita_portaudio_run(currSounds(2), 'OutputChannels', 1:2, 'Block')
set(gData.h.buttonB, 'BackgroundColor', [0.94 0.94 0.94]);
% enable both buttons
set([gData.h.buttonA gData.h.buttonB] , 'enable', 'on');
gData.currentSet = gData.currentSet + 1; gData.currentSet = gData.currentSet + 1;
end end
...@@ -337,19 +351,22 @@ switch gData.nextPhase ...@@ -337,19 +351,22 @@ switch gData.nextPhase
close(wbh) close(wbh)
% % play A set( gData.h.text , 'string', gData.ltData.compareQuestion)
% currSounds(1).play set([gData.h.buttonA gData.h.buttonB gData.h.text ] , 'visible', 'on');
% % pause set([gData.h.buttonA gData.h.buttonB] , 'enable', 'off');
% pause(gData.ltData.pauseBetween)
% % play B
% currSounds(2).play
% first stimulus
set(gData.h.buttonA, 'BackgroundColor', 'g');
ita_portaudio_run(currSounds(1), 'OutputChannels', 1:2, 'Block') ita_portaudio_run(currSounds(1), 'OutputChannels', 1:2, 'Block')
ita_portaudio_run(currSounds(2), 'OutputChannels', 1:2, 'Block') set(gData.h.buttonA, 'BackgroundColor', [0.94 0.94 0.94]);
% second stimulus
set(gData.h.buttonB, 'BackgroundColor', 'g');
ita_portaudio_run(currSounds(2), 'OutputChannels', 1:2, 'Block')
set(gData.h.buttonB, 'BackgroundColor', [0.94 0.94 0.94]);
set([gData.h.buttonA gData.h.buttonB gData.h.text ] , 'visible', 'on'); % enable both buttons
set( gData.h.text , 'string', gData.ltData.compareQuestion) set([gData.h.buttonA gData.h.buttonB] , 'enable', 'on');
gData.currentSet = gData.currentSet + 1; gData.currentSet = gData.currentSet + 1;
......
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