﻿<?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 5  » Randomizing Animations</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 16 Sep 2026 11:42:44 GMT</lastBuildDate><ttl>20</ttl><item><title>Randomizing Animations</title><link>https://forums.millisecond.com/Topic27460.aspx</link><description>Hi,&lt;br/&gt;I have a series of picture elements with 2 kinds of animations. I want to randomize between these two animations, so that each picture will randomly have either a circle animation or a path animation. I couldn't find a function that could do this, so I tried hard coding it like so:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial panda&amp;gt;&lt;br/&gt;/ stimulusframes = [1=noreplace(picture.pandapath, picture.pandacircle), video.panda_audio; 200=next1]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ validresponse = (next1)&lt;br/&gt;/ beginresponsetime = 2000&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture pandapath&amp;gt;&lt;br/&gt;/ items = ("distractor23.jpg")&lt;br/&gt;/ size = (900, 900)&amp;nbsp;&lt;br/&gt;/ animation = path(2000, 1, 45, 50, 55, 50, 50, 50)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture pandacircle&amp;gt;&lt;br/&gt;/ items = ("distractor23.jpg")&lt;br/&gt;/ size = (900, 900)&amp;nbsp;&lt;br/&gt;/ animation = circle(2000, 1, 0, 600, 375, 50)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;(This is just an example of one of the pictures, but I have more).&amp;nbsp;&lt;br/&gt;But when I do this, the panda_audio won't play during the trial, so there's silence when there should be (the same) audio file playing each time the trial is played, no matter if it's a path or circle animation. Any idea of how I could randomize between these two animations while also playing audio?&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;br/&gt;</description><pubDate>Mon, 15 Jul 2019 10:17:03 GMT</pubDate><dc:creator>L O</dc:creator></item><item><title>RE: Randomizing Animations</title><link>https://forums.millisecond.com/Topic27461.aspx</link><description>&lt;div data-id="27460" class="if-quote-wrapper" unselectable="on" data-guid="1563210616665"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="27460" 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="27460" 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="27460" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;L O - 7/15/2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27460"&gt;&lt;div class="if-quote-message-margin"&gt;Hi,&lt;br/&gt;I have a series of picture elements with 2 kinds of animations. I want to randomize between these two animations, so that each picture will randomly have either a circle animation or a path animation. I couldn't find a function that could do this, so I tried hard coding it like so:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial panda&amp;gt;&lt;br/&gt;/ stimulusframes = [1=noreplace(picture.pandapath, picture.pandacircle), video.panda_audio; 200=next1]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ validresponse = (next1)&lt;br/&gt;/ beginresponsetime = 2000&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture pandapath&amp;gt;&lt;br/&gt;/ items = ("distractor23.jpg")&lt;br/&gt;/ size = (900, 900)&amp;nbsp;&lt;br/&gt;/ animation = path(2000, 1, 45, 50, 55, 50, 50, 50)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;picture pandacircle&amp;gt;&lt;br/&gt;/ items = ("distractor23.jpg")&lt;br/&gt;/ size = (900, 900)&amp;nbsp;&lt;br/&gt;/ animation = circle(2000, 1, 0, 600, 375, 50)&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;(This is just an example of one of the pictures, but I have more).&amp;nbsp;&lt;br/&gt;But when I do this, the panda_audio won't play during the trial, so there's silence when there should be (the same) audio file playing each time the trial is played, no matter if it's a path or circle animation. Any idea of how I could randomize between these two animations while also playing audio?&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="27460"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;The problem is that you can't have a selection mode (here: noreplace() for the two picture elements) AND a static stimulus (here: the video) in the &lt;strong&gt;same &lt;/strong&gt;frame specified in /stimulusframes. You can either &lt;br/&gt;&lt;br/&gt;(1) use the /inserstimulusframe() function instead to achieve the equivalent result &lt;br/&gt;&lt;br/&gt;&amp;lt;block exampleblock&amp;gt;&lt;br/&gt;/ trials = [1-10 = panda]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial panda&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;trial.panda.insertstimulusframe(list.pandaanims.nextvalue, 1);&lt;br/&gt;]&lt;br/&gt;/ ontrialend = [&lt;br/&gt;trial.panda.resetstimulusframes();&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1=video.panda_audio; 200=next1]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ validresponse = (next1)&lt;br/&gt;/ beginresponsetime = 2000&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list pandaanims&amp;gt;&lt;br/&gt;/ items = (picture.pandapath, picture.pandacircle)&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ replace = false&lt;br/&gt;/ poolsize = 10&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;OR &lt;br/&gt;&lt;br/&gt;(2) you can separate things out into two adjacent frames:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial panda&amp;gt;&lt;br/&gt;/ stimulusframes = [1=noreplace(picture.pandapath, picture.pandacircle); 2=video.panda_audio; 200=next1]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ validresponse = (next1)&lt;br/&gt;/ beginresponsetime = 2000&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;</description><pubDate>Mon, 15 Jul 2019 10:17:03 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>