﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 7  » How to Make a Sound Play during a trial</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Mon, 23 Nov 2026 23:18:43 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to Make a Sound Play during a trial</title><link>https://forums.millisecond.com/Topic41450.aspx</link><description>&lt;blockquote data-id="41449" class="if-quote-wrapper" unselectable="on" data-guid="1753912503426" contenteditable="false" id="if_insertedNode_1753912502675"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41449" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41449" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41449" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41449"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41448" class="if-quote-wrapper" unselectable="on" data-guid="1753912503426" contenteditable="false" id="if_insertedNode_1753908456933"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41448" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41448" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41448" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41448"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41447" class="if-quote-wrapper" unselectable="on" data-guid="1753912503426" contenteditable="false" id="if_insertedNode_1753906002651"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41447" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41447" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41447" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41447"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41446" class="if-quote-wrapper" unselectable="on" data-guid="1753912503426" contenteditable="false" id="if_insertedNode_1753905738399"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41446" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41446" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41446" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41446"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41445" class="if-quote-wrapper" unselectable="on" data-guid="1753912503426" contenteditable="false" id="if_insertedNode_1753905275024"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41445" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41445" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41445" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41445"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41444" class="if-quote-wrapper" unselectable="on" data-guid="1753912503426" contenteditable="false" id="if_insertedNode_1753904925993"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41444" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41444" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41444" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41444"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41443" class="if-quote-wrapper" unselectable="on" data-guid="1753912503426" contenteditable="false" id="if_insertedNode_1753904196692"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41443" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41443" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41443" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41443"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41442" class="if-quote-wrapper" unselectable="on" data-guid="1753912503426" contenteditable="false" id="if_insertedNode_1753902185494"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41442" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41442" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41442" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41442"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello! I am currently trying to code a trial where participants press a key at a specific moment in a trial. There is a moving bar that loops, and they need to press the space bar when it lines up with certain shapes in the background. Depending on where they press the spacebar, a different sound is played. And each loop does not have the same sounds as the previous loop. There are 6 loops total. How can I code Inquisit to play a different sound based on the frequency of key presses, and how do I link that to a particular key?&lt;a class="if-quote-goto quote-link" href="#" data-id="41442"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide example code. It's entirely unclear what you refer to as "loop" and how you implemented it.&lt;a class="if-quote-goto quote-link" href="#" data-id="41443"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial instructions&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=tasktext; 1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ responseTrial = (" ", synchrony)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;Right now I'm trying to have noteCount increase by 1 for every key pressed. And I would like to use the number of key presses to control which sound is coming out. So if noteCount is 1, 2, or 14 for example, it plays soundA.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41444"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide code one can actually run, i.e. that includes the definitions for all elements referenced. Also, if your code requires any files (images, sound files) you should provide those as well. Further, please comment your code and provide more than vague one or two sentence descriptions of what it is supposed to do.&lt;a class="if-quote-goto quote-link" href="#" data-id="41445"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The block to run:&lt;br/&gt;&amp;lt;block task&amp;gt;&lt;br/&gt;/ trials = [1=synchrony] &lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;The bar that moves across the screen:&lt;br/&gt;&amp;lt;shape musicline&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = crimson&lt;br/&gt;/ size = (2%,100%)&lt;br/&gt;/ animation = path(7250, 6, 5%, 50%, 85%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;7 shapes that the bar will pass over:&lt;br/&gt;&amp;lt;shape line1&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (20%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line2&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (30%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line3&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (40%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line4&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line5&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (60%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line6&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (70%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line7&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (80%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;noteCount value:&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;The trial where the bar moves across the rectangles, and should be playing a sound.&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;if (values.noteCount &amp;lt; 50) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;The sound files to play:&lt;br/&gt;&amp;lt;sound noteC&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_C.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteG&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_G.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteA&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_A.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteF&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_F.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteE&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_E.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteD&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_D.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;Unfortunately the program is not letting me upload the specific sound files, but any can be used for testing.&lt;a class="if-quote-goto quote-link" href="#" data-id="41446"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You can put files in a ZIP and attach it. You sitll have not provided any sufficient explanation of what this is intended to do, what sound to play when, etc. &lt;a class="if-quote-goto quote-link" href="#" data-id="41447"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;This is intended to run a trial where the musicline shape is moving in a path over 7 rectangles (the line shapes). When the musicline overlaps with the first and second rectangle, the participant should press the spacebar each time and it should play noteC. When the musicline overlaps with the third and fourth rectangle, it should play noteG. The participant is essentially trying to play the rhythm of a song by pressing the spacebar at the right time, which is indicated by the rectangles.&amp;nbsp;&lt;a class="if-quote-goto quote-link" href="#" data-id="41448"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;That's not going to work this way. You'll essentially have to break up the trials and animation in to one per line, a continuous animation in a single trial cannot work because you cannot change what the trial does once it's runing (e.g. play a different sound depending on where the animation is when the space bar is pressed).&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41449"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Here's a rough sketch of how this *might* work:&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;block task&amp;gt;&lt;br/&gt;/ trials = [1=synchrony]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ repCount = 0&lt;br/&gt;/ xAtResponse = 0&lt;br/&gt;/ musicLineStartX = 5% // start x coordinate of animation&lt;br/&gt;/ musicLineEndX = 85% // end x coordinate of animation&lt;br/&gt;/ musicLineDuration = 7250 // duration of full animation&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;The bar that moves across the screen:&lt;br/&gt;&amp;lt;shape musicline&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = crimson&lt;br/&gt;/ size = (2%,100%)&lt;br/&gt;/ animation = path(values.musicLineDuration, -1, values.musicLineStartX, 50%, values.musicLineEndX, 50%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;7 shapes that the bar will pass over:&lt;br/&gt;&amp;lt;shape line1&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (20%, 50%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line2&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (30%, 50%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line3&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (40%, 50%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line4&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line5&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (60%, 50%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line6&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (70%, 50%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line7&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (80%, 50%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text debug&amp;gt;&lt;br/&gt;/ items = ("X position at time of response: &amp;lt;%values.xAtResponse%&amp;gt; | Remaining duration: &amp;lt;%values.musicLineDuration%&amp;gt; | Repetition: &amp;lt;%values.repCount%&amp;gt;")&lt;br/&gt;/ position = (50%, 10%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;The trial where the bar moves across the rectangles, and should be playing a sound.&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ onTrialBegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// we start out playing no note, skipping all of them&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sound.noteA.skip = true;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sound.noteC.skip = true;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sound.noteD.skip = true;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sound.noteE.skip = true;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sound.noteF.skip = true;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sound.noteG.skip = true;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// if animation over line 1 or 2 at the time of response, we enable noteC&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((values.xAtResponse &amp;gt;= 19pct &amp;amp;&amp;amp; values.xAtResponse &amp;lt;= 21pct) || (values.xAtResponse &amp;gt;= 29pct &amp;amp;&amp;amp; values.xAtResponse &amp;lt;= 31pct)) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sound.noteC.skip = false;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// if over line 3, 4, or 7 we enable note G&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((values.xAtResponse &amp;gt;= 39pct &amp;amp;&amp;amp; values.xAtResponse &amp;lt;= 41pct) || (values.xAtResponse &amp;gt;= 49pct &amp;amp;&amp;amp; values.xAtResponse &amp;lt;= 51pct) || (values.xAtResponse &amp;gt;= 79pct &amp;amp;&amp;amp; values.xAtResponse &amp;lt;= 81pct)) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sound.noteG.skip = false;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// if over line 5 or 6, we enable note A&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if ((values.xAtResponse &amp;gt;= 59pct &amp;amp;&amp;amp; values.xAtResponse &amp;lt;= 61pct) || (values.xAtResponse &amp;gt;= 69pct &amp;amp;&amp;amp; values.xAtResponse &amp;lt;= 71pct)) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sound.noteA.skip = false;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1=clearScreen, musicline, line1, line2, line3, line4, line5, line6, line7, &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;noteA, noteC, noteD, noteE, noteF, noteG,&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;debug]&lt;br/&gt;/ beginResponseTime = -1&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ isValidResponse = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (trial.synchrony.response == 57) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.xAtResponse = shape.musicline.xPct; // store X coordinate of music line at time of response&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.musicLineDuration -= trial.synchrony.latency; // calculate remaining animation duration&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.musicLineStartX = values.xAtResponse; // set new start point, picking back up where we were at time of last response&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return true;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br/&gt;]&lt;br/&gt;/ onTrialEnd = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (values.musicLineDuration &amp;lt;= 0 || trial.synchrony.response == 0) { // if trial times out, we reset everything&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.musicLineStartX = 5%; // back to the original start position&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.musicLineDuration = 7250; // back to original duration&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.xAtResponse = 0%; // we don't have any response yet&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.repCount += 1; // we increase the repetition count&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br/&gt;]&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (values.repCount &amp;lt; 5) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return trial.synchrony&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;]&lt;br/&gt;/ timeout = values.musicLineDuration&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;The sound files to play:&lt;br/&gt;&amp;lt;sound noteC&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_C.mp3")&lt;br/&gt;/ playThrough = false&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteG&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_G.mp3")&lt;br/&gt;/ playThrough = false&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteA&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_A.mp3")&lt;br/&gt;/ playThrough = false&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteF&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_F.mp3")&lt;br/&gt;/ playThrough = false&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteE&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_E.mp3")&lt;br/&gt;/ playThrough = false&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteD&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_D.mp3")&lt;br/&gt;/ playThrough = false&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/sound&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;You'll have to toy around with how little or how much wiggle room you want to allow to consider a response a hit, i.e. how exact you want the line-up at the time of respose to be.</description><pubDate>Wed, 30 Jul 2025 22:52:45 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>How to Make a Sound Play during a trial</title><link>https://forums.millisecond.com/Topic41442.aspx</link><description>Hello! I am currently trying to code a trial where participants press a key at a specific moment in a trial. There is a moving bar that loops, and they need to press the space bar when it lines up with certain shapes in the background. Depending on where they press the spacebar, a different sound is played. And each loop does not have the same sounds as the previous loop. There are 6 loops total. How can I code Inquisit to play a different sound based on the frequency of key presses, and how do I link that to a particular key?</description><pubDate>Wed, 30 Jul 2025 22:26:18 GMT</pubDate><dc:creator>krmanning10</dc:creator></item><item><title>RE: How to Make a Sound Play during a trial</title><link>https://forums.millisecond.com/Topic41449.aspx</link><description>&lt;blockquote data-id="41448" class="if-quote-wrapper" unselectable="on" data-guid="1753908457855" contenteditable="false" id="if_insertedNode_1753908456933"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41448" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41448" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41448" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41448"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41447" class="if-quote-wrapper" unselectable="on" data-guid="1753908457855" contenteditable="false" id="if_insertedNode_1753906002651"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41447" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41447" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41447" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41447"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41446" class="if-quote-wrapper" unselectable="on" data-guid="1753908457855" contenteditable="false" id="if_insertedNode_1753905738399"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41446" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41446" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41446" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41446"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41445" class="if-quote-wrapper" unselectable="on" data-guid="1753908457855" contenteditable="false" id="if_insertedNode_1753905275024"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41445" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41445" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41445" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41445"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41444" class="if-quote-wrapper" unselectable="on" data-guid="1753908457855" contenteditable="false" id="if_insertedNode_1753904925993"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41444" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41444" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41444" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41444"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41443" class="if-quote-wrapper" unselectable="on" data-guid="1753908457855" contenteditable="false" id="if_insertedNode_1753904196692"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41443" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41443" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41443" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41443"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41442" class="if-quote-wrapper" unselectable="on" data-guid="1753908457855" contenteditable="false" id="if_insertedNode_1753902185494"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41442" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41442" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41442" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41442"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello! I am currently trying to code a trial where participants press a key at a specific moment in a trial. There is a moving bar that loops, and they need to press the space bar when it lines up with certain shapes in the background. Depending on where they press the spacebar, a different sound is played. And each loop does not have the same sounds as the previous loop. There are 6 loops total. How can I code Inquisit to play a different sound based on the frequency of key presses, and how do I link that to a particular key?&lt;a class="if-quote-goto quote-link" href="#" data-id="41442"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide example code. It's entirely unclear what you refer to as "loop" and how you implemented it.&lt;a class="if-quote-goto quote-link" href="#" data-id="41443"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial instructions&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=tasktext; 1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ responseTrial = (" ", synchrony)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;Right now I'm trying to have noteCount increase by 1 for every key pressed. And I would like to use the number of key presses to control which sound is coming out. So if noteCount is 1, 2, or 14 for example, it plays soundA.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41444"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide code one can actually run, i.e. that includes the definitions for all elements referenced. Also, if your code requires any files (images, sound files) you should provide those as well. Further, please comment your code and provide more than vague one or two sentence descriptions of what it is supposed to do.&lt;a class="if-quote-goto quote-link" href="#" data-id="41445"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The block to run:&lt;br/&gt;&amp;lt;block task&amp;gt;&lt;br/&gt;/ trials = [1=synchrony] &lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;The bar that moves across the screen:&lt;br/&gt;&amp;lt;shape musicline&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = crimson&lt;br/&gt;/ size = (2%,100%)&lt;br/&gt;/ animation = path(7250, 6, 5%, 50%, 85%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;7 shapes that the bar will pass over:&lt;br/&gt;&amp;lt;shape line1&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (20%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line2&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (30%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line3&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (40%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line4&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line5&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (60%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line6&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (70%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line7&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (80%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;noteCount value:&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;The trial where the bar moves across the rectangles, and should be playing a sound.&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;if (values.noteCount &amp;lt; 50) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;The sound files to play:&lt;br/&gt;&amp;lt;sound noteC&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_C.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteG&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_G.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteA&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_A.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteF&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_F.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteE&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_E.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteD&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_D.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;Unfortunately the program is not letting me upload the specific sound files, but any can be used for testing.&lt;a class="if-quote-goto quote-link" href="#" data-id="41446"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You can put files in a ZIP and attach it. You sitll have not provided any sufficient explanation of what this is intended to do, what sound to play when, etc. &lt;a class="if-quote-goto quote-link" href="#" data-id="41447"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;This is intended to run a trial where the musicline shape is moving in a path over 7 rectangles (the line shapes). When the musicline overlaps with the first and second rectangle, the participant should press the spacebar each time and it should play noteC. When the musicline overlaps with the third and fourth rectangle, it should play noteG. The participant is essentially trying to play the rhythm of a song by pressing the spacebar at the right time, which is indicated by the rectangles.&amp;nbsp;&lt;a class="if-quote-goto quote-link" href="#" data-id="41448"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;That's not going to work this way. You'll essentially have to break up the trials and animation in to one per line, a continuous animation in a single trial cannot work because you cannot change what the trial does once it's runing (e.g. play a different sound depending on where the animation is when the space bar is pressed).&lt;br/&gt;</description><pubDate>Wed, 30 Jul 2025 20:56:25 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to Make a Sound Play during a trial</title><link>https://forums.millisecond.com/Topic41448.aspx</link><description>&lt;blockquote data-id="41447" class="if-quote-wrapper" unselectable="on" data-guid="1753906002782" contenteditable="false" id="if_insertedNode_1753906002651"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41447" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41447" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41447" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41447"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41446" class="if-quote-wrapper" unselectable="on" data-guid="1753906002782" contenteditable="false" id="if_insertedNode_1753905738399"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41446" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41446" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41446" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41446"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41445" class="if-quote-wrapper" unselectable="on" data-guid="1753906002782" contenteditable="false" id="if_insertedNode_1753905275024"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41445" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41445" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41445" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41445"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41444" class="if-quote-wrapper" unselectable="on" data-guid="1753906002782" contenteditable="false" id="if_insertedNode_1753904925993"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41444" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41444" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41444" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41444"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41443" class="if-quote-wrapper" unselectable="on" data-guid="1753906002782" contenteditable="false" id="if_insertedNode_1753904196692"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41443" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41443" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41443" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41443"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41442" class="if-quote-wrapper" unselectable="on" data-guid="1753906002782" contenteditable="false" id="if_insertedNode_1753902185494"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41442" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41442" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41442" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41442"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello! I am currently trying to code a trial where participants press a key at a specific moment in a trial. There is a moving bar that loops, and they need to press the space bar when it lines up with certain shapes in the background. Depending on where they press the spacebar, a different sound is played. And each loop does not have the same sounds as the previous loop. There are 6 loops total. How can I code Inquisit to play a different sound based on the frequency of key presses, and how do I link that to a particular key?&lt;a class="if-quote-goto quote-link" href="#" data-id="41442"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide example code. It's entirely unclear what you refer to as "loop" and how you implemented it.&lt;a class="if-quote-goto quote-link" href="#" data-id="41443"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial instructions&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=tasktext; 1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ responseTrial = (" ", synchrony)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;Right now I'm trying to have noteCount increase by 1 for every key pressed. And I would like to use the number of key presses to control which sound is coming out. So if noteCount is 1, 2, or 14 for example, it plays soundA.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41444"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide code one can actually run, i.e. that includes the definitions for all elements referenced. Also, if your code requires any files (images, sound files) you should provide those as well. Further, please comment your code and provide more than vague one or two sentence descriptions of what it is supposed to do.&lt;a class="if-quote-goto quote-link" href="#" data-id="41445"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The block to run:&lt;br/&gt;&amp;lt;block task&amp;gt;&lt;br/&gt;/ trials = [1=synchrony] &lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;The bar that moves across the screen:&lt;br/&gt;&amp;lt;shape musicline&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = crimson&lt;br/&gt;/ size = (2%,100%)&lt;br/&gt;/ animation = path(7250, 6, 5%, 50%, 85%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;7 shapes that the bar will pass over:&lt;br/&gt;&amp;lt;shape line1&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (20%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line2&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (30%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line3&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (40%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line4&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line5&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (60%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line6&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (70%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line7&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (80%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;noteCount value:&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;The trial where the bar moves across the rectangles, and should be playing a sound.&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;if (values.noteCount &amp;lt; 50) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;The sound files to play:&lt;br/&gt;&amp;lt;sound noteC&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_C.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteG&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_G.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteA&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_A.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteF&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_F.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteE&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_E.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteD&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_D.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;Unfortunately the program is not letting me upload the specific sound files, but any can be used for testing.&lt;a class="if-quote-goto quote-link" href="#" data-id="41446"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You can put files in a ZIP and attach it. You sitll have not provided any sufficient explanation of what this is intended to do, what sound to play when, etc. &lt;a class="if-quote-goto quote-link" href="#" data-id="41447"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;This is intended to run a trial where the musicline shape is moving in a path over 7 rectangles (the line shapes). When the musicline overlaps with the first and second rectangle, the participant should press the spacebar each time and it should play noteC. When the musicline overlaps with the third and fourth rectangle, it should play noteG. The participant is essentially trying to play the rhythm of a song by pressing the spacebar at the right time, which is indicated by the rectangles.&amp;nbsp;</description><pubDate>Wed, 30 Jul 2025 20:14:33 GMT</pubDate><dc:creator>krmanning10</dc:creator></item><item><title>RE: How to Make a Sound Play during a trial</title><link>https://forums.millisecond.com/Topic41447.aspx</link><description>&lt;blockquote data-id="41446" class="if-quote-wrapper" unselectable="on" data-guid="1753905739483" contenteditable="false" id="if_insertedNode_1753905738399"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41446" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41446" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41446" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41446"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41445" class="if-quote-wrapper" unselectable="on" data-guid="1753905739483" contenteditable="false" id="if_insertedNode_1753905275024"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41445" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41445" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41445" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41445"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41444" class="if-quote-wrapper" unselectable="on" data-guid="1753905739483" contenteditable="false" id="if_insertedNode_1753904925993"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41444" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41444" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41444" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41444"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41443" class="if-quote-wrapper" unselectable="on" data-guid="1753905739483" contenteditable="false" id="if_insertedNode_1753904196692"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41443" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41443" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41443" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41443"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41442" class="if-quote-wrapper" unselectable="on" data-guid="1753905739483" contenteditable="false" id="if_insertedNode_1753902185494"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41442" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41442" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41442" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41442"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello! I am currently trying to code a trial where participants press a key at a specific moment in a trial. There is a moving bar that loops, and they need to press the space bar when it lines up with certain shapes in the background. Depending on where they press the spacebar, a different sound is played. And each loop does not have the same sounds as the previous loop. There are 6 loops total. How can I code Inquisit to play a different sound based on the frequency of key presses, and how do I link that to a particular key?&lt;a class="if-quote-goto quote-link" href="#" data-id="41442"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide example code. It's entirely unclear what you refer to as "loop" and how you implemented it.&lt;a class="if-quote-goto quote-link" href="#" data-id="41443"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial instructions&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=tasktext; 1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ responseTrial = (" ", synchrony)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;Right now I'm trying to have noteCount increase by 1 for every key pressed. And I would like to use the number of key presses to control which sound is coming out. So if noteCount is 1, 2, or 14 for example, it plays soundA.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41444"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide code one can actually run, i.e. that includes the definitions for all elements referenced. Also, if your code requires any files (images, sound files) you should provide those as well. Further, please comment your code and provide more than vague one or two sentence descriptions of what it is supposed to do.&lt;a class="if-quote-goto quote-link" href="#" data-id="41445"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The block to run:&lt;br/&gt;&amp;lt;block task&amp;gt;&lt;br/&gt;/ trials = [1=synchrony] &lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;The bar that moves across the screen:&lt;br/&gt;&amp;lt;shape musicline&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = crimson&lt;br/&gt;/ size = (2%,100%)&lt;br/&gt;/ animation = path(7250, 6, 5%, 50%, 85%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;7 shapes that the bar will pass over:&lt;br/&gt;&amp;lt;shape line1&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (20%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line2&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (30%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line3&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (40%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line4&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line5&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (60%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line6&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (70%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line7&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (80%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;noteCount value:&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;The trial where the bar moves across the rectangles, and should be playing a sound.&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;if (values.noteCount &amp;lt; 50) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;The sound files to play:&lt;br/&gt;&amp;lt;sound noteC&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_C.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteG&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_G.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteA&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_A.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteF&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_F.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteE&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_E.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteD&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_D.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;Unfortunately the program is not letting me upload the specific sound files, but any can be used for testing.&lt;a class="if-quote-goto quote-link" href="#" data-id="41446"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;You can put files in a ZIP and attach it. You sitll have not provided any sufficient explanation of what this is intended to do, what sound to play when, etc. </description><pubDate>Wed, 30 Jul 2025 20:03:37 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to Make a Sound Play during a trial</title><link>https://forums.millisecond.com/Topic41446.aspx</link><description>&lt;blockquote data-id="41445" class="if-quote-wrapper" unselectable="on" data-guid="1753905275488" contenteditable="false" id="if_insertedNode_1753905275024"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41445" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41445" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41445" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41445"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41444" class="if-quote-wrapper" unselectable="on" data-guid="1753905275488" contenteditable="false" id="if_insertedNode_1753904925993"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41444" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41444" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41444" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41444"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41443" class="if-quote-wrapper" unselectable="on" data-guid="1753905275488" contenteditable="false" id="if_insertedNode_1753904196692"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41443" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41443" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41443" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41443"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41442" class="if-quote-wrapper" unselectable="on" data-guid="1753905275488" contenteditable="false" id="if_insertedNode_1753902185494"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41442" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41442" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41442" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41442"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello! I am currently trying to code a trial where participants press a key at a specific moment in a trial. There is a moving bar that loops, and they need to press the space bar when it lines up with certain shapes in the background. Depending on where they press the spacebar, a different sound is played. And each loop does not have the same sounds as the previous loop. There are 6 loops total. How can I code Inquisit to play a different sound based on the frequency of key presses, and how do I link that to a particular key?&lt;a class="if-quote-goto quote-link" href="#" data-id="41442"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide example code. It's entirely unclear what you refer to as "loop" and how you implemented it.&lt;a class="if-quote-goto quote-link" href="#" data-id="41443"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial instructions&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=tasktext; 1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ responseTrial = (" ", synchrony)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;Right now I'm trying to have noteCount increase by 1 for every key pressed. And I would like to use the number of key presses to control which sound is coming out. So if noteCount is 1, 2, or 14 for example, it plays soundA.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41444"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide code one can actually run, i.e. that includes the definitions for all elements referenced. Also, if your code requires any files (images, sound files) you should provide those as well. Further, please comment your code and provide more than vague one or two sentence descriptions of what it is supposed to do.&lt;a class="if-quote-goto quote-link" href="#" data-id="41445"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The block to run:&lt;br/&gt;&amp;lt;block task&amp;gt;&lt;br/&gt;/ trials = [1=synchrony] &lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;The bar that moves across the screen:&lt;br/&gt;&amp;lt;shape musicline&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = crimson&lt;br/&gt;/ size = (2%,100%)&lt;br/&gt;/ animation = path(7250, 6, 5%, 50%, 85%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;7 shapes that the bar will pass over:&lt;br/&gt;&amp;lt;shape line1&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (20%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line2&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (30%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line3&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (40%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line4&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (50%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line5&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (60%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line6&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (70%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape line7&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = black&lt;br/&gt;/ size = (2%,50%)&lt;br/&gt;/ position = (80%, 50%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;noteCount value:&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;The trial where the bar moves across the rectangles, and should be playing a sound.&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;if (values.noteCount &amp;lt; 50) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;The sound files to play:&lt;br/&gt;&amp;lt;sound noteC&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_C.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteG&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_G.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteA&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_A.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteF&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_F.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteE&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_E.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;sound noteD&amp;gt;&lt;br/&gt;/ items = ("Twinkle_Twinkle_Little_Star_D.mp3")&lt;br/&gt;&amp;lt;/sound&amp;gt;&lt;br/&gt;&lt;br/&gt;Unfortunately the program is not letting me upload the specific sound files, but any can be used for testing.</description><pubDate>Wed, 30 Jul 2025 19:59:38 GMT</pubDate><dc:creator>krmanning10</dc:creator></item><item><title>RE: How to Make a Sound Play during a trial</title><link>https://forums.millisecond.com/Topic41445.aspx</link><description>&lt;blockquote data-id="41444" class="if-quote-wrapper" unselectable="on" data-guid="1753904927243" contenteditable="false" id="if_insertedNode_1753904925993"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41444" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41444" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41444" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41444"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41443" class="if-quote-wrapper" unselectable="on" data-guid="1753904927243" contenteditable="false" id="if_insertedNode_1753904196692"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41443" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41443" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41443" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41443"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41442" class="if-quote-wrapper" unselectable="on" data-guid="1753904927243" contenteditable="false" id="if_insertedNode_1753902185494"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41442" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41442" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41442" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41442"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello! I am currently trying to code a trial where participants press a key at a specific moment in a trial. There is a moving bar that loops, and they need to press the space bar when it lines up with certain shapes in the background. Depending on where they press the spacebar, a different sound is played. And each loop does not have the same sounds as the previous loop. There are 6 loops total. How can I code Inquisit to play a different sound based on the frequency of key presses, and how do I link that to a particular key?&lt;a class="if-quote-goto quote-link" href="#" data-id="41442"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide example code. It's entirely unclear what you refer to as "loop" and how you implemented it.&lt;a class="if-quote-goto quote-link" href="#" data-id="41443"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial instructions&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=tasktext; 1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ responseTrial = (" ", synchrony)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;Right now I'm trying to have noteCount increase by 1 for every key pressed. And I would like to use the number of key presses to control which sound is coming out. So if noteCount is 1, 2, or 14 for example, it plays soundA.&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="41444"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide code one can actually run, i.e. that includes the definitions for all elements referenced. Also, if your code requires any files (images, sound files) you should provide those as well. Further, please comment your code and provide more than vague one or two sentence descriptions of what it is supposed to do.</description><pubDate>Wed, 30 Jul 2025 19:51:33 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to Make a Sound Play during a trial</title><link>https://forums.millisecond.com/Topic41444.aspx</link><description>&lt;blockquote data-id="41443" class="if-quote-wrapper" unselectable="on" data-guid="1753904196866" contenteditable="false" id="if_insertedNode_1753904196692"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41443" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41443" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41443" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41443"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="41442" class="if-quote-wrapper" unselectable="on" data-guid="1753904196866" contenteditable="false" id="if_insertedNode_1753902185494"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41442" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41442" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41442" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41442"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello! I am currently trying to code a trial where participants press a key at a specific moment in a trial. There is a moving bar that loops, and they need to press the space bar when it lines up with certain shapes in the background. Depending on where they press the spacebar, a different sound is played. And each loop does not have the same sounds as the previous loop. There are 6 loops total. How can I code Inquisit to play a different sound based on the frequency of key presses, and how do I link that to a particular key?&lt;a class="if-quote-goto quote-link" href="#" data-id="41442"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide example code. It's entirely unclear what you refer to as "loop" and how you implemented it.&lt;a class="if-quote-goto quote-link" href="#" data-id="41443"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ noteCount = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial instructions&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=tasktext; 1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ responseTrial = (" ", synchrony)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial synchrony&amp;gt;&lt;br/&gt;/ preTrialPause = 500&lt;br/&gt;/ stimulusframes = [1=musicline; 2=line1; 3=line2; 4=line3; 5=line4; 6=line5; 7=line6; 8=line7]&lt;br/&gt;/ validResponse = (" ")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.noteCount += 1&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;Right now I'm trying to have noteCount increase by 1 for every key pressed. And I would like to use the number of key presses to control which sound is coming out. So if noteCount is 1, 2, or 14 for example, it plays soundA.&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 30 Jul 2025 19:40:25 GMT</pubDate><dc:creator>krmanning10</dc:creator></item><item><title>RE: How to Make a Sound Play during a trial</title><link>https://forums.millisecond.com/Topic41443.aspx</link><description>&lt;blockquote data-id="41442" class="if-quote-wrapper" unselectable="on" data-guid="1753902186647" contenteditable="false" id="if_insertedNode_1753902185494"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="41442" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="41442" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="41442" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;krmanning10 - 7/30/2025&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-41442"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello! I am currently trying to code a trial where participants press a key at a specific moment in a trial. There is a moving bar that loops, and they need to press the space bar when it lines up with certain shapes in the background. Depending on where they press the spacebar, a different sound is played. And each loop does not have the same sounds as the previous loop. There are 6 loops total. How can I code Inquisit to play a different sound based on the frequency of key presses, and how do I link that to a particular key?&lt;a class="if-quote-goto quote-link" href="#" data-id="41442"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Please provide example code. It's entirely unclear what you refer to as "loop" and how you implemented it.</description><pubDate>Wed, 30 Jul 2025 19:04:09 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>