resonance 1.0.1
Loading...
Searching...
No Matches
pitchpicker.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "app/msgsink.h"
6#include "app/msgsource.h"
7#include "game/trackdata.h"
8#include "mid/tick.h"
9#include "msg/message.h"
10#include "msg/multimusemsg.h"
11#include "msg/stdmidimsg.h"
12#include "msg/sustainnotemsg.h"
13
14class Player;
15
31class PitchPicker : public MsgSink, public MsgSource {
32public:
38 PitchPicker(const TrackData *pTrackData);
39
52 virtual void DispatchPriv(Message *pMsg);
53
60 struct NoteMapping {
61 int mNote;
62 unsigned char mPitch;
63 };
64
65private:
73 void OnMsg(const MultiMuseMsg &msg);
74
82 void PostSustainNoteMsg(SustainNoteMsg *pMsg);
83
91 void PostNoteOn(int nTick, unsigned char nStatus, unsigned char nNote, unsigned char nVelocity);
92
102 void PostNoteOff(int nTick, unsigned char nStatus, unsigned char nNote);
103
110 unsigned char GetSustainPitch(int nTick, unsigned char nNote);
111
121 void OnStdMidi(StdMidiMsg *pMsg);
122
132 unsigned char PickPitch(int nTick, unsigned char nNote);
133
134 const TrackData *mTrackData; // +0x18
135 int mAxis; // +0x1c, the axis position scaled to 0..1024
136 int mReserved; // +0x20, never read or written
137 std::vector<NoteMapping> mHeldNotes; // +0x24
138 std::vector<NoteMapping> mSustainNotes; // +0x30
139 Sch::Tick mSustainTick; // +0x3c
140 int mRiffLow; // +0x40
141 int mRiffHigh; // +0x44
142 int mTrack; // +0x48, copied from TrackData::mIndex
143 Player *mPlayer; // +0x4c, NullPlayer::sInstance until a TrackSelectMsg
144};
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Receiver of engine messages.
Definition msgsink.h:37
Sender of engine messages, which stores the list of sinks that receive them.
Definition msgsource.h:26
Event the game passes between a MsgSource and a MsgSink.
Definition multimusemsg.h:31
PitchPicker(const TrackData *pTrackData)
virtual void DispatchPriv(Message *pMsg)
Act on a message.
One participant in a session, local or remote.
Definition player.h:39
Song position in MIDI ticks, printed as measure, beat, and tick.
Definition tick.h:70
Event the game passes between a MsgSource and a MsgSink.
Definition stdmidimsg.h:27
Event the game passes between a MsgSource and a MsgSink.
Definition sustainnotemsg.h:27
Converted events of one track of a level.
Definition trackdata.h:52
A note number paired with the pitch it was played as.
Definition pitchpicker.h:60
int mNote
Definition pitchpicker.h:61
unsigned char mPitch
Definition pitchpicker.h:62