This GitLab instance reached the end of its service life. It won't be possible to create new users or projects.

Please read the deprecation notice for more information concerning the deprecation timeline

Visit migration.git.tu-berlin.de (internal network only) to import your old projects to the new GitLab platform 📥

Commit b7e35a80 by Henrik von Coler

Added doc for midi_tester!

parent 088342bd
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
* *
* \date $Date: 2005/04/14 14:16:20 $ * \date $Date: 2005/04/14 14:16:20 $
* *
* Contact: von_coler@intelligent-noise-solutions.de
* *
* *
*/ */
......
midi_tester {#mainpage}
=======================
# BRIEF
# Libraries
The following libraries are used within this project:
* librtmidi
# Usage
1: plug in your USB MID device
2: find the ID of your device
3: start program
```console
~/examples/midi_tester/midi_tester -ID 1
```
PROJECT_NAME = "Midi_Tester"
PROJECT_BRIEF = "Use the MIDI class without audio for reverse-engineering your MIDI controllers."
OUTPUT_DIRECTORY = "./"
INPUT = "../" README.md
FILE_PATTERNS = *.cpp *.h
RECURSIVE = YES
FILTER_SOURCE_FILES = NO
# deactivate when done with major changes
EXTRACT_PRIVATE = YES
HAVE_DOT = YES
UML_LOOK = YES
USE_MOFILE_AS_MAINPAGE = README.md
\ No newline at end of file
...@@ -38,8 +38,8 @@ MidiMan::midiMessage MidiMan::get_midi_messages() ...@@ -38,8 +38,8 @@ MidiMan::midiMessage MidiMan::get_midi_messages()
int nBytes = 1; int nBytes = 1;
/// this is kind of a dirty workaroud - // this is kind of a dirty workaroud -
/// we loop over all in-massages and take the last one: // we loop over all in-massages and take the last one:
while(nBytes>0) while(nBytes>0)
{ {
...@@ -47,11 +47,11 @@ MidiMan::midiMessage MidiMan::get_midi_messages() ...@@ -47,11 +47,11 @@ MidiMan::midiMessage MidiMan::get_midi_messages()
nBytes = a.size(); nBytes = a.size();
/// only do something if bytes are received // only do something if bytes are received
if(nBytes!=0) if(nBytes!=0)
{ {
/// only give feedback if 'verbose-mode' is active // only give feedback if 'verbose-mode' is active
if(isVerbose == true ) if(isVerbose == true )
{ {
std::cout << "Received " << nBytes << " Bytes: " ; std::cout << "Received " << nBytes << " Bytes: " ;
...@@ -75,13 +75,6 @@ MidiMan::midiMessage MidiMan::get_midi_messages() ...@@ -75,13 +75,6 @@ MidiMan::midiMessage MidiMan::get_midi_messages()
return mm; return mm;
} }
//////////////////////////////////////////////////////////////////
// FLUSH
//////////////////////////////////////////////////////////////////
void MidiMan::flushProcessedMessages() void MidiMan::flushProcessedMessages()
{ {
...@@ -91,14 +84,6 @@ void MidiMan::flushProcessedMessages() ...@@ -91,14 +84,6 @@ void MidiMan::flushProcessedMessages()
} }
int MidiMan::getNumFaderMessages()
{
int v = (int) val.size();
return v;
}
...@@ -2,14 +2,15 @@ ...@@ -2,14 +2,15 @@
* \class MidiMan * \class MidiMan
* *
* *
* \brief Class which parses and stores the incoming MIDI messages. * \brief Reduced version of the MIDI manager class
* for controller mappings.
* *
* *
* \author Henrik von Coler * \author Henrik von Coler
* *
* \version $Revision: 0.5 $ * \version $Revision: 0.5 $
* *
* \date $Date: 2005/04/14 14:16:20 $ * \date $Date: 2019/04/30 14:16:20 $
* *
* Contact: von_coler@tu-berlin.de * Contact: von_coler@tu-berlin.de
* *
...@@ -41,6 +42,7 @@ class MidiMan ...@@ -41,6 +42,7 @@ class MidiMan
public: public:
/// struct for holding a MIDI message
typedef struct { typedef struct {
int byte1 = -1; int byte1 = -1;
int byte2 = -1; int byte2 = -1;
...@@ -49,60 +51,53 @@ public: ...@@ -49,60 +51,53 @@ public:
}midiMessage; }midiMessage;
///
/// \brief MidiMan
/// \param device_ID
///
MidiMan(int device_ID); MidiMan(int device_ID);
~MidiMan();
std::vector<std::string> returnAllNames();
void updateMidiMessages(void *port_buf);
void parseMidiMessages();
void addNoteOnMessage(int in[3]);
std::vector<noteMessage> getNoteOnMessages();
void clearNoteOnMessages();
void addNoteOffMessage(int in[3]);
std::vector<noteMessage> getNoteOffMessages();
void clearNoteOffMessages();
void eraseNoteOnMessage(int position); ///
~MidiMan();
void addFaderMessage(ctlMessage m);
void markOnMessageProcessed(int pos);
void markOffMessageProcessed(int pos);
///
/// \brief flushProcessedMessages
///
void flushProcessedMessages(); void flushProcessedMessages();
ctlMessage getLastFaderMessage(); ///
/// \brief get_midi_messages
int getNumFaderMessages(); /// \return
///
static void finish(int ignore);
midiMessage get_midi_messages(); midiMessage get_midi_messages();
///
/// \brief setVerbose
///
void setVerbose(); void setVerbose();
private: private:
// rtmidi ///
/// \brief done
///
static bool done; static bool done;
///
/// \brief midiin
///
RtMidiIn *midiin; RtMidiIn *midiin;
int nBytes, i;
double stamp; ///
/// \brief isVerbose
///
bool isVerbose = true; bool isVerbose = true;
///
/// \brief val
///
std::vector<int> val; std::vector<int> val;
noteMessage *tmpNote;
void mycallback( double deltatime, std::vector< unsigned char > *message, void *userData );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment