1 : <?php
2 :
3 : /**
4 : * \Midi\Event\NoteOnEvent
5 : *
6 : * @package Midi
7 : * @subpackage Event
8 : * @copyright © 2009 Tommy Montgomery <http://phpmidiparser.com/>
9 : * @since 1.0
10 : */
11 :
12 : namespace Midi\Event;
13 :
14 : /**
15 : * Represents a note on channel event
16 : *
17 : * Turns a note for a channel on. To achieve polyphony, use
18 : * a delta time of zero with consecutive note on events.
19 : *
20 : * This event can be used in lieu of a note off event by repeating
21 : * the same note on the same channel with a velocity of zero.
22 : *
23 : * @package Midi
24 : * @subpackage Event
25 : * @since 1.0
26 : */
27 1 : class NoteOnEvent extends ChannelEvent {
28 :
29 : /**
30 : * @since 1.0
31 : * @uses Note::getNoteName()
32 : *
33 : * @return string
34 : */
35 : public function getParamDescription() {
36 1 : return \Midi\Util\Note::getNoteName($this->param1) . ' with velocity ' . $this->param2;
37 : }
38 :
39 : /**
40 : * @since 1.0
41 : * @uses EventType::NOTE_ON
42 : *
43 : * @return int
44 : */
45 : public function getType() {
46 1 : return EventType::NOTE_ON;
47 : }
48 :
49 : }
50 :
|