Skip to content

Tips for using LSL4Unity

Markus edited this page May 18, 2016 · 10 revisions

Grouping Markers with one timestamp

double thisMoment = liblsl.local_Clock(); provides a time stamp from a high precision clock. Use this to write multiple marker within the same moment in your code.

Postpone marker to the end of a rendering frame

An example snipptit from the LSLMarkerStream script.

    public void WriteBeforeFrameIsDisplayed(string marker)
    {
        pendingMarker = marker;
        StartCoroutine(WriteMarkerAfterImageIsRendered());
    }

    IEnumerator WriteMarkerAfterImageIsRendered()
    {
        yield return new WaitForEndOfFrame();

        Write(pendingMarker);

        yield return null;
    }
Clone this wiki locally