Coder Social home page Coder Social logo

zeyus / touchtracker Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 29.21 MB

mousetrap csv compatible flutter (Android, iOS, Web) touch tracking implementation of Falk, Winter, and Spivey's “Candle-Candle-Candle-Candy: Continuous Attraction Toward Previously Seen Phonological Competitors.” experiment

License: Open Software License 3.0

Kotlin 0.14% Swift 0.44% Objective-C 0.04% Dart 93.92% HTML 4.25% R 1.22%
cognitive-science flutter psychology psychology-experiments experiments experiment research

touchtracker's Introduction

touchtracker

Work in progress

Flutter project for Mobile + Web.

Like mousetracking, but for touch. Output CSV / logs are compatible with the mousetrap R library.

Example data analysis can be seen in the example_data_analysis dirctory of this repo.

Tested working on Android and Web.

Current state

mousetrap csv compatible flutter (Android, iOS, Web) touch tracking implementation of Falk, Winter, and Spivey's “Candle-Candle-Candle-Candy: Continuous Attraction Toward Previously Seen Phonological Competitors.” (2013) experiment.

Try it out

You can run the latest touchtracker web release to give it a go.

Future plans

After finishing using the app for a research project, I want to decouple the experiment and make it somewhat easy to use the app as an experiment builder (or maybe just a "player") which can be customized with various assets (sounds, images, text prompts). Using the Candle-Candy experiment as a demo / tutorial.

License

Copyright (c) 2021-2022 zeyus.

OSL 3.0

touchtracker's People

Contributors

zeyus avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

touchtracker's Issues

Fix race condition and inconsistent Flutter draggable callback firing

initially I thought it was because of issue #5, but that's not the case, on closer inspection, there's a problem with Flutter not consistently calling onDragEnd, onDragComplete or onDragCancelled...
Sometimes they fire, sometimes they don't, and it's not clear why though I suspect it's because I'm making draggable and dragtarget do something they weren't made for.

This can be handled within the controller by checking if the callback has been fired once for the drag end/cancel/complete event.

Change target detection method if possible

this shouldn't be a big issue but who knows now...

currently the drag indicator is slightly bigger than a finger, so it has lead to occasional dropping of the Draggable inside the dragtarget but not quite half way so it doesn't trigger the events...

the behaviour / target event should fire as soon as the edge of the indicator touches the dragtarget box

align csv to mousetrap / opensesame

The bare minimum needed is the columns required by the mousetrap R package import http://pascalkieslich.github.io/mousetrap/reference/mt_import_mousetrap.html

mt_import_mousetrap(
  raw_data,
  xpos_label = "xpos",
  ypos_label = "ypos",
  timestamps_label = "timestamps",
  mt_id_label = NULL,
  split = ",",
  duplicates = "remove_first",
  unordered = "warn",
  reset_timestamps = TRUE,
  digits = NULL,
  verbose = FALSE
)

Sensible default suggested mapping for starters:

Csv column Details
log_sequence sequential id
timestamp normal timestamp
experiment experiment name
practice 1 or 0
experiment_start_time timestamp
experiment_end_time timestamp
experiment_elapsed_time microseconds
subject_id subject id
condition overarching condition
target_stimulus stimulitarget.a or b, (pair target)
target_position a or b (l / r)
non_target_stimulus stimulitarget.a or b, (pair non-target)
non_target_position a or b (l / r)
stimulus_a_times_displayed number of times stim displayed
stimulus_b_times_displayed number of times stim displayed
trial_type condition descriptor
trial_subtype additional condition descriptor
trial_sequence trial id 0+
trial_start_time timestamp
trial_end_time timestamp
trial_elapsed_time microseconds
correct 1 or 0
response_time microseconds
response_time_average calculate average
velocity_average calculate average
distance_step_average calculate average
distance_total calculate total
distance_direct calculate total from start to finish point
timestamps_tracking [ t1, t2, ... , tn ] in microseconds
xpos_tracking [ x1, x2, ... , xn ] tracking x coordinate
ypos_tracking [ y1, y2, ... , yn ] tracking y coordinate
velocity_tracking [ v1, v2, ... , vn ] tracking step velocity
distance_tracking [ d1, d2, ... , dn ] tracking step distance
angle_tracking [ θ1, θ2, ... , θn ] tracking step angle
fullscreen 1 or 0 (hopefully always true on mobile)
viewport_height screen height
viewport_width screen width
device_dpi screen dpi
device_info all available deviceinfo

replace audioplayers with just_audio

Sadly audioplayers has met its end with this project it seems that there's no way to work around its inconsistent start timing and patchy callback firing...

the start timing issue occurs even when every audio file is precached using AudioCache, the timing issue is absolutely critical because if you want to use this for an experiment, each trial should load in the same amount of time and right now it can be from instant to 10 seconds per trial which feels very jarring while being a subject and breaks up any motor rythym.

https://pub.dev/packages/just_audio

just_audio should also allow calculation of duration on all supported platforms so we don't need to rely on a clunky future.delayed

resample audio to 44.1kHz

this will fix a compatibility issue with AudioTrack: AUDIO_OUTPUT_FLAG_FAST warning which disables low latency audio playback and ends up playing nothing on nexus 10 tablet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.