Howdy, Stranger!

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

Supported by

Experiment with Midi Keyboard

Hello!
I'm looking after a software for doing experiments in music cognition. For my current experiment, I need a solution for gathering input by using a midi keyboard. Is it possible for "expyriment" to record musicians' performance behavior on a midi keyboard? If so, how? I would appreciate any bits of advice! Thanks in advance!
Friedrich

Comments

  • Hi Friedrich,

    there is no particular code for recording musical performances, but there is MIDI input and output available as a plugin (see http://stash.expyriment.org). I am not sure what the latencies will be like, though.

    Best,
    Florian

    Thanked by 1platzf

    Florian Krause (Developer)
    http://www.expyriment.org

  • Hi Florian!

    Thanks for the quick replay. I'm new to Python as well as too expyriment. How can I access/install those plugins you mentioned? Could you give some hints about the code to use for getting midi information of my keyboard?

    Best,
    Friedrich

  • As my question has been closed in the OpenSesame forum (which was my mistake, excuse me), is there a way to implement a Midi-Input in Sesame? And how would this routine looks like?
    Best,
    Friedrich

  • Here is a description of the plugin system in Expyriment: http://docs.expyriment.org/Plugins.html.

    You can use the MIDI input like this:

    import expyriment.io.extras
    
    midi_in = expyriment.io.extras.MidiIn(device, buffer_size=1024)
    

    To get a list of MIDI devices on your system, do:

    expyriment.io.extras.MidiIn.get_devices()
    

    To see what you can do with the midi_in object, do:

    help(midi_in)
    

    There are basically two things to look at, read and wait, which do exactly what they sound like. One is reading (polling) from the buffer, returning [status, data1, data2, data3, timestamp], while the other one is waiting (blocking) until a midi command is received and then returns [status, data1, data2, data3].

    I hope this helps.

    Thanked by 1platzf

    Florian Krause (Developer)
    http://www.expyriment.org

  • Thank you very much. Is it possible to integrate this approach in opensesame? Or is it only possible to implement this Routine in expyriement? If it is possible to include this, how would this be done in opensesame?

    Best,
    Friedrich

  • Don't know. Best to ask in the OpenSesame forum. Or maybe @sebastiaan can chime in?

    Florian Krause (Developer)
    http://www.expyriment.org

  • Hi guys,

    Yes, if you use the xpyriment backend in OpenSesame, then you can use all the expyriment routines in an inline_script item.

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

Sign In or Register to comment.