# MIDIBUS: Does using note.setTicks() still require "note off"?

**URL:** <https://discourse.processing.org/t/midibus-does-using-note-setticks-still-require-note-off/15667>\
**Category:** Libraries\
**Created:** [November 20, 2019, 8:13pm UTC](https://discourse.processing.org/t/midibus-does-using-note-setticks-still-require-note-off/15667 "2019-11-20T20:13:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark\_orion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mark_orion/32/7180_2.png) [@mark\_orion](https://discourse.processing.org/u/mark_orion)\
**Post date:** [November 20, 2019, 8:13pm UTC](https://discourse.processing.org/t/midibus-does-using-note-setticks-still-require-note-off/15667/1 "2019-11-20T20:13:59Z")

</div>

The Midibus library contains a “note” object with an associated method “setTicks()”.  
Does this mean that midibus automatically sends “note off” when the ticks have passed or is it still required to send the “note off” message to end the note ?

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [November 23, 2019, 7:29pm UTC](https://discourse.processing.org/t/midibus-does-using-note-setticks-still-require-note-off/15667/2 "2019-11-23T19:29:31Z")

</div>

> [@mark\_orion](#):
>
> a “note” object with an associated method “setTicks()”

Do you mean Note.setTicks()? This is a variable setter. `ticks` is defined in the Note constructor as “the length in ticks of the Note.”

> <https://github.com/sparks/themidibus/blob/ac37832ad316ad258c1706277b0f902852285b5a/src/themidibus/Note.java#L196-L203>

Have you tested sending a Notes with different ticks lengths and seeing what happens?

---

<div class="post-metadata">

**Author:** ![mark\_orion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mark_orion/32/7180_2.png) [@mark\_orion](https://discourse.processing.org/u/mark_orion)\
**Post date:** [November 23, 2019, 8:46pm UTC](https://discourse.processing.org/t/midibus-does-using-note-setticks-still-require-note-off/15667/3 "2019-11-23T20:46:10Z")

</div>

I tried it today. At least in my setup I cannot see any effect of the “ticks” parameter. Regardless what I set there, the synthesizer keeps going until it gets a proper NoteOff message.  
I had a look at the documentation on [midi.org](http://midi.org) and a midi note-on message only contains two bytes - pitch and velocity. Maybe the “ticks” parameter is meant for use within processing.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [November 24, 2019, 12:05am UTC](https://discourse.processing.org/t/midibus-does-using-note-setticks-still-require-note-off/15667/4 "2019-11-24T00:05:59Z")

</div>

Seems right – it doesn’t look like there is any implementation of `tick` in the library code. I believe it is based on javax.sound.midi –

[https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/MidiEvent.html](https://docs.oracle.com/javase/7/docs/api/javax/sound/midi/MidiEvent.html)
