> For the complete documentation index, see [llms.txt](https://docs.lmms.io/developer-guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lmms.io/developer-guides/core/play-handles.md).

# Play handles

In LMMS, play handles manage playback of notes, instruments, or sample clips. All play handles are managed by subclasses of `PlayHandle`.

### Types of play handles

There are several types of `PlayHandle`s defined:

* [`NotePlayHandle`](/developer-guides/core/play-handles/noteplayhandle.md): manages `Note`s being played, and get audio output for specific note
* [`InstrumentPlayHandle`](/developer-guides/core/play-handles/instrumentplayhandle.md): manages instruments which provides per-instrument audio output(single-streamed instruments)
* [`SamplePlayHandle`](/developer-guides/core/play-handles/sampleplayhandle.md): manages sample playback
* `PresetPreviewHandle`
* `SampleRecordHandle`

### Important member variables and functions

* `m_offset`(type `f_cnt_t`): The number remaining of audio frames before the play handle starts to produce audio, evaluated at the beginning of a rendering period

### Functions which subclasses should implement

`PlayHandle` itself can't be used directly because it doesn't implement some of the required functionalities.

* `play(sampleFrame *buf)`: Render a period of audio buffer to `buf` and check/manage the playback state of the managed object
* `isFinished()`: Return whether the managed object finished playing and `this` can be deleted
* `isFromTrack(const Track *track)`: Check if the play handle plays objects in the given `track`
