Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Help needed: sampler

edited April 2015 in OpenSesame

Dear Community,

I am entirely new to open sesame and have no experience whatsoever with programming. I'm a bit desperate at the moment because I can't figure out a probably simple element of the experiment I need to make:
A 5 minutes long sound file is supposed to be playing and whenever the mouse (or a key, that doesn't really matter) is pressed, a 5 seconds long noise is supposed to be heard. But since the experiment is run in a sequence I can't figure out how to implement the short sound into the long sound in a way that it would be played whenever the mouse (or key) is pressed.
I kind of have the same problem with a little text that is supposed to appear on the screen while the long sound is playing. I want them to start at the same time but right now the sound doesn't start but after the text has been displayed alone for a while.

Can somebody please help me with that?
I would be so grateful.

Thanks

Comments

  • edited 4:38PM

    Hi Mona,

    How to go about this depends on a couple of things. For one, do people need to be allowed to press a button (and initialize the 5 second noise) multiple times during those 5 minutes, or just once in order to move on? And secondly, does the 5minute long soundfile have to be played from beginning to end regardless of when a button is pressed (only to be interrupted for 5 seconds by the noise, for instance)?

    It may be good to know that you can set the duration of the sampler item to 'keypress' or 'mouseclick' as well; in other words, the sound would play until a button is pressed. (if you click on the sampler item, you see the 'duration' parameter at the bottom).
    In case the 5 second sound should be played multiple times with multiple button presses, the 5 second sampler item should be placed in a sequence, which in itself is placed in a loop item. This loop could then repeat the sequence for, say, 5 minutes, so that during these 5 minutes the button press and 5 second sound item can occur multiple times. If you click on the loop item, you can check a box to show advanced options, revealing a 'break-if' parameter. Here you could, for instance, insert something that makes you break out of the loop when a timer has reached 5 minutes. You would have to make a variable (in an inline_script item, placed before the loop) that keeps track of time; see http://osdoc.cogsci.nl/python/inline-script/#function-inline_scripttime ).

    Inside the sequence, you can place a keyboard_response item (and in this item, be sure to tick the button with the question balloon to learn how it works!). After the keyboard_response, you can place the 5 second sample item. Now clicking the sequence item, a window will open showing the items you put in the sequence, with the 'run-if' column set to 'always' for all items. Of course you only want to play the sound file if a button is pressed, so you would insert: =self.get('response') != 'none' (meaning the sampler would be activated if the keyboard response was NOT equal to 'none', i.e. if a button was pressed). Lastly, you would place another inline_script item in the sequence, that updates the timer variable.

    Undoubtedly you'll encounter some problems here and there - therefore it's recommended to browse through this site: http://osdoc.cogsci.nl/ , and visit some tutorials in particular.
    And of course I'm willing to answer any follow-up question you have.

    Good luck!

    Cheers,

    Josh

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games