OpenSesame 3.2.0 "Kafkaesque Koffka" released!
OpenSesame 3.2.0 Kafkaesque Koffka is the first release in the 3.2 cycle, and brings a lot improved functionality and polish! The 3.2 series is fully backwards compatible with the 3.1 series.
As always, you can download OpenSesame from here:
A better, PEP-8-compliant Python API
PEP-8 is a style guide for Python. Much modern Python software follows the PEP-8 guidelines—but, for historical reasons, OpenSesame didn't. As of 3.2, the public API now follows the guideline that the names of classes (and factory functions that generate classes) should be CamelCase
, while names of objects and functions should be underscore_case
. Practically speaking, this means that you now create Canvas
object as follows:
my_canvas = Canvas() # Note the capital C!
my_canvas.fixdot()
my_canvas.show())
Of course, the old underscore_case
names are still available as aliases, so backwards compatibility is preserved.
The API for forms has also been simplified. You no longer need to import libopensesame.widgets
, and you no longer need to pass exp
as the first argument:
form = Form()
button = Button(text=u'Ok!')
form.set_widget(button, (0, 0))
form._exec()
Improvements to the sketchpad and Canvas
Access and modify Canvas elements
Elements of a Canvas
are now objects that can be named, accessed, and modified. This means that you no longer need to redraw an entire canvas to change a single element. For example, you can draw a rotating arm as follows:
my_canvas = Canvas()
my_canvas['arm'] = Line(0, 0, 0, 0)
for x, y in xy_circle(n=100, rho=100):
my_canvas['arm'].ex = x
my_canvas['arm'].ey = y
my_canvas.show()
clock.sleep(10)
The SKETCHPAD also allows you to name elements.
For more information, see:
Improved support for HTML and non-Latin script
Text is now rendered by Qt, which is a modern library (the same library that is also used for the graphical interface). This means that you can now use real HTML in your text. This also means that left-to-right script and other non-Latin scripts are rendered much better.
Images can be rotated
Images can now be rotated. This work both in SKETCHPAD items and Canvas
objects.
Work with polar coordinates
If you right-click on a SKETCHPAD elements, you can select 'Specify polar coordinates'. This allows you to calculate cartesian (x, y) coordinates based on polar coordinates, which is especially useful if you want to create circular configurations.
Form improvements
Improved form performance
Forms are now much faster when using the psycho and xpyriment backends. This is due to the fact that Canvas
elements can now be updated individually, as described above.
Validation of form input
You can now validate the input of a form; that is, you can prevent a form from closing until certain criteria are met. In addition, you can exclude characters as input from TextInput
widgets.
For more information, see:
Keyboard Improvements
Support for key-release events
The Keyboard()
object now has a get_key_release()
function, which allows you to collect key releases. Due to limitations of the underlying libraries, the function has two important limitations:
- The returned
key
may be incorrect on non-QWERTY keyboard layouts - The function has not been implemented for the psycho backend
For more information, see:
Mouse Improvements
Support for mouse-release events
The Mouse()
object now has a get_click_release()
function, which allows you to collect mouse-click releases. This function is currently not implemented for the psycho backend.
For more information, see:
Use sketchpads to define regions of interest
You can now define a linked SKETCHPAD in a mouse_response
item. If you do this, the names of the elements on the SKETCHPAD will be automatically used as regions of interest (ROIs) for the mouse clicks.
Forcibly end your experiment
You can now forcibly end your experiment by clicking on the Kill button in the main toolbar. This means that you no longer need to open a process/ task manager to end run-away experiments!
Improved Mac OS support
The Mac OS packages have been rebuilt from the ground up by @Daniel . The Mac OS experience should now be much smoother, faster, and less crash-prone.
A Turkish translation
A complete Turkish translation has been contributed by aytackarabay. This means that OpenSesame is now fully translated into French, German, and Turkish. A partial translation is available in several other languages.
Comments
Great news!
I want to know more about the regions of interest functionality. Is this new functionality enable us to implement mouse movements while a sketchpad is present without using mousetrap plugin???
Would be great if you add a small tutorial to explain this feature..
Thanks
Vatsal
Hi Vatsal (cc @Pascal),
That would depend on what you want to do exactly. But if you want to do mouse-tracking, then I would stick to the
mousetrap
plug-in, which in turn will probably make use of OpenSesame's new functionality in the future.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hey Sebastian!
We'll I am trying to implement a corsi block tapping task. Where a series of boxes flash in a random order and participant has to tap those boxes in the same sequence as they were flashed. I came across the mouse trap functionality. I am just curious whether this new region of interest functionality can be used in my case or not.
Thanks
Vatsal
Hi Vatsal, hi Sebastiaan,
really cool that OS 3.2 is released!
I am currently working on an update of the mousetrap plugin that will use the new functionalities so you can define buttons in the mousetrap_response plugin just by using the named elements on the sketchad (i.e., you don't have to specify the coordinates anymore for each button). I will push a test version on GitHub some time early next week (https://github.com/pascalkieslich/mousetrap-os).
Best,
Pascal
Hey everyone
Thank you very much for this awesome release!
I really like the new functions, they come in handy.
However, there seems to be a problem for me with variable font colors.
I defined the color with [color] (the name of the column in the table) and with jazzy james it all worked fine, however OpenSesame gives an error and somehow crashes in the new version. I can't even change the script, because it crashes.
After downgrading, it all works fine again... So I suppose something changed in the way variables are allowed to define?
Do you have an Idea why that happens? I would be very happy for any inputs on this!
Thank you in advance!
Best wishes,
Tim
Hi Tim,
There's indeed a bug in using variables in text elements. This will be fixed in the next maintenance release (3.2.1). For now, you can upgrade
python-opensesame
to the latest snapshot through the Python package manager (under Menu → Tools) and the issue should go away.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Git Sebastiaaan
Wow, that was a quick answer!
Thank you very much for the tip, I'll try that.
Best
Tim