// two octaves starting at A
// from low to high
// mp3s used in this example via
https://www.reddit.com/r/piano/comments/3u6ke7/heres_some_midi_and_mp3_files_for_individual/<item notes>
/ 1 = "a4.mp3"
/ 2 = "a-4.mp3"
/ 3 = "b4.mp3"
/ 4 = "c4.mp3"
/ 5 = "c-4.mp3"
/ 6 = "d4.mp3"
/ 7 = "d-4.mp3"
/ 8 = "e4.mp3"
/ 9 = "f4.mp3"
/ 10 = "f-4.mp3"
/ 11 = "g4.mp3"
/ 12 = "g-4.mp3"
/ 13 = "a5.mp3"
/ 14 = "a-5.mp3"
/ 15 = "b5.mp3"
/ 16 = "c5.mp3"
/ 17 = "c-5.mp3"
/ 18 = "d5.mp3"
/ 19 = "d-5.mp3"
/ 20 = "e5.mp3"
/ 21 = "f5.mp3"
/ 22 = "f-5.mp3"
/ 23 = "g5.mp3"
/ 24 = "g-5.mp3"
</item>
<values>
/ seq_number = 0
/ note_count = 0
/ notes_in_sequence = 0
/ differing_note_number = 0
/ note = 1
</values>
<list seq_number>
/ poolsize = 4 // four sequence comparisons in this example
/ selectionmode = sequence // set to random if you want to sample sequences in random order
</list>
// two 4-note sequences, two 5-note sequences
// sequence A (first)
<list seq_a_list>
/ items = (list.4a1.nextvalue, list.4a2.nextvalue, list.5a1.nextvalue, list.5a2.nextvalue)
/ select = values.seq_number
</list>
// sequence B (second)
<list seq_b_list>
/ items = (list.4b1.nextvalue, list.4b2.nextvalue, list.5b1.nextvalue, list.5b2.nextvalue)
/ select = values.seq_number
</list>
// two 4-note sequences, two 5-note sequences
<list notes_in_sequence>
/ items = (4,4,5,5)
/ select = values.seq_number
</list>
// note number that differs between sequence A and B
<list differing_note_number>
/ items = (2,4,1,5)
/ select = values.seq_number
</list>
// first four note comparison
// sequence A
<list 4a1>
/ items = (1,13,2,14) // 'A4', 'A5', 'A#4', 'A#5'
/ selectionmode = sequence
</list>
// sequence B
<list 4b1>
/ items = (1,3,2,14) // 'A4', 'B4', 'A#4', 'A#5'
/ selectionmode = sequence
</list>
// second four note comparison
// sequence A
<list 4a2>
/ items = (8,10,12,14)
/ selectionmode = sequence
</list>
// sequence B
<list 4b2>
/ items = (8,10,12,15)
/ selectionmode = sequence
</list>
// first five note comparison
// sequence A
<list 5a1>
/ items = (8,4,19,14,6)
/ selectionmode = sequence
</list>
// sequence B
<list 5b1>
/ items = (12,4,19,14,6)
/ selectionmode = sequence
</list>
// second five note comparison
// sequence A
<list 5a2>
/ items = (23,5,7,19,20)
/ selectionmode = sequence
</list>
// sequence B
<list 5b2>
/ items = (23,5,7,19,18)
/ selectionmode = sequence
</list>
<sound note>
/ items = notes
/ select = values.note
/ playthrough = true
/ erase = false
</sound>
<trial start>
/ ontrialbegin = [
values.seq_number = list.seq_number.nextindex;
values.note_count = 0;
values.notes_in_sequence = list.notes_in_sequence.nextvalue;
values.differing_note_number = list.differing_note_number.nextvalue;
trial.seq_a.resetstimulusframes();
trial.seq_b.resetstimulusframes();
trial.getresponse.resetstimulusframes();
list.txt_list.reset();
var i = 0;
while (i < values.notes_in_sequence) {
trial.seq_a.insertstimulusframe(list.txt_list.nextvalue,1);
trial.seq_b.insertstimulusframe(list.txt_list.currentvalue, 1);
trial.getresponse.insertstimulusframe(list.txt_list.currentvalue, 1);
i += 1;
};
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (0)
/ trialduration = 500
/ branch = [
return trial.seq_a;
]
/ recorddata = false
</trial>
// plays sequence 1
<trial seq_a>
/ ontrialbegin = [
values.note_count += 1;
values.note = list.seq_a_list.nextvalue;
text.1.textbgcolor = black;
text.2.textbgcolor = black;
text.3.textbgcolor = black;
text.4.textbgcolor = black;
text.5.textbgcolor = black;
text.6.textbgcolor = black;
text.7.textbgcolor = black;
text.8.textbgcolor = black;
text.9.textbgcolor = black;
if (values.note_count == 1) {
text.1.textbgcolor = darkgray;
} else if (values.note_count == 2) {
text.2.textbgcolor = darkgray;
} else if (values.note_count == 3) {
text.3.textbgcolor = darkgray;
} else if (values.note_count == 4) {
text.4.textbgcolor = darkgray;
} else if (values.note_count == 5) {
text.5.textbgcolor = darkgray;
} else if (values.note_count == 6) {
text.6.textbgcolor = darkgray;
} else if (values.note_count == 7) {
text.7.textbgcolor = darkgray;
} else if (values.note_count == 8) {
text.8.textbgcolor = darkgray;
} else if (values.note_count == 9) {
text.9.textbgcolor = darkgray;
};
]
/ stimulusframes = [1=clearscreen, note]
/ trialduration = 650
/ validresponse = (0)
/ branch = [
if (values.note_count < values.notes_in_sequence) {
return trial.seq_a;
} else {
return trial.iti;
}
]
/ recorddata = false
</trial>
// plays sequence 2
<trial seq_b>
/ ontrialbegin = [
values.note_count += 1;
values.note = list.seq_b_list.nextvalue;
text.1.textbgcolor = red;
text.2.textbgcolor = red;
text.3.textbgcolor = red;
text.4.textbgcolor = red;
text.5.textbgcolor = red;
text.6.textbgcolor = red;
text.7.textbgcolor = red;
text.8.textbgcolor = red;
text.9.textbgcolor = red;
if (values.note_count == 1) {
text.1.textbgcolor = lightcoral;
} else if (values.note_count == 2) {
text.2.textbgcolor = lightcoral;
} else if (values.note_count == 3) {
text.3.textbgcolor = lightcoral;
} else if (values.note_count == 4) {
text.4.textbgcolor = lightcoral;
} else if (values.note_count == 5) {
text.5.textbgcolor = lightcoral;
} else if (values.note_count == 6) {
text.6.textbgcolor = lightcoral;
} else if (values.note_count == 7) {
text.7.textbgcolor = lightcoral;
} else if (values.note_count == 8) {
text.8.textbgcolor = lightcoral;
} else if (values.note_count == 9) {
text.9.textbgcolor = lightcoral;
};
]
/ stimulusframes = [1=clearscreen, note]
/ trialduration = 650
/ validresponse = (0)
/ branch = [
if (values.note_count < values.notes_in_sequence) {
return trial.seq_b;
} else {
return trial.getresponse;
}
]
/ recorddata = false
</trial>
// 1300 ms pause between sequence 1 and 2
<trial iti>
/ ontrialbegin = [
values.note_count = 0;
]
/ stimulusframes = [1=clearscreen]
/ trialduration = 1300
/ recorddata = false
/ branch = [
return trial.seq_b;
]
/ recorddata = false
</trial>
<trial getresponse>
/ ontrialbegin = [
text.1.textbgcolor = red;
text.2.textbgcolor = red;
text.3.textbgcolor = red;
text.4.textbgcolor = red;
text.5.textbgcolor = red;
text.6.textbgcolor = red;
text.7.textbgcolor = red;
text.8.textbgcolor = red;
text.9.textbgcolor = red;
]
/ stimulusframes = [1=clearscreen, question]
/ inputdevice = mouse
/ validresponse = (1,2,3,4,5,6,7,8,9)
/ iscorrectresponse = [
trial.getresponse.response == values.differing_note_number;
]
</trial>
<block example>
/ trials = [1-4 = start]
</block>
<text question>
/ items = ("Click on the note that differed between the two melodies.")
/ txbgcolor = white
/ txcolor = black
/ erase = true(white)
/ size = (90%, 30%)
/ position = (50%, 18%)
/ vjustify = center
/ erase = true(white)
/ fontstyle = ("Avenir", 4%, false, false, false, false, 5, 0)
</text>
<list txt_list>
/ items = (text.1, text.2, text.3, text.4, text.5, text.6, text.7, text.8, text.9)
/ selectionmode = sequence
/ selectionrate = always
</list>
<text 1>
/ items = ("1")
/ fontstyle = ("Avenir", 3%, true, false, false, false, 5, 1)
/ txbgcolor = lightcoral
/ txcolor = white
/ size = (5%, 5%)
/ position = (20%, 50%)
/ vjustify = center
/ erase = false
</text>
<text 2>
/ items = ("2")
/ fontstyle = ("Avenir", 3%, true, false, false, false, 5, 1)
/ txbgcolor = lightcoral
/ txcolor = white
/ size = (5%, 5%)
/ position = (27%, 50%)
/ vjustify = center
/ erase = false
</text>
<text 3>
/ items = ("3")
/ fontstyle = ("Avenir", 3%, true, false, false, false, 5, 1)
/ txbgcolor = lightcoral
/ txcolor = white
/ size = (5%, 5%)
/ position = (34%, 50%)
/ vjustify = center
/ erase = false
</text>
<text 4>
/ items = ("4")
/ fontstyle = ("Avenir", 3%, true, false, false, false, 5, 1)
/ txbgcolor = lightcoral
/ txcolor = white
/ size = (5%, 5%)
/ position = (41%, 50%)
/ vjustify = center
/ erase = false
</text>
<text 5>
/ items = ("5")
/ fontstyle = ("Avenir", 3%, true, false, false, false, 5, 1)
/ txbgcolor = lightcoral
/ txcolor = white
/ size = (5%, 5%)
/ position = (48%, 50%)
/ vjustify = center
/ erase = false
</text>
<text 6>
/ items = ("6")
/ fontstyle = ("Avenir", 3%, true, false, false, false, 5, 1)
/ txbgcolor = lightcoral
/ txcolor = white
/ size = (5%, 5%)
/ position = (55%, 50%)
/ vjustify = center
/ erase = false
</text>
<text 7>
/ items = ("7")
/ fontstyle = ("Avenir", 3%, true, false, false, false, 5, 1)
/ txbgcolor = lightcoral
/ txcolor = white
/ size = (5%, 5%)
/ position = (62%, 50%)
/ vjustify = center
/ erase = false
</text>
<text 8>
/ items = ("8")
/ fontstyle = ("Avenir", 3%, true, false, false, false, 5, 1)
/ txbgcolor = lightcoral
/ txcolor = white
/ size = (5%, 5%)
/ position = (69%, 50%)
/ vjustify = center
/ erase = false
</text>
<text 9>
/ items = ("9")
/ fontstyle = ("Avenir", 3%, true, false, false, false, 5, 1)
/ txbgcolor = lightcoral
/ txcolor = white
/ size = (5%, 5%)
/ position = (76%, 50%)
/ vjustify = center
/ erase = false
</text>
<defaults>
/ screencolor = white
/ txbgcolor = transparent
/ txcolor = black
/ canvasaspectratio = (4,3)
/ inputdevice = mouse
/ fontstyle = ("Avenir", 5%, false)
</defaults>