summaryrefslogtreecommitdiff
path: root/example3.c
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-10-07 19:30:56 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-10-07 19:30:56 +0200
commit40a899bd6ee536eae093337bf2d0dcc8db4e46f1 (patch)
tree485ace3e6fd28b91f394efd277732651e10824d8 /example3.c
parent6fc4bddfdf8e056469f316c1a0fe488efbb4253a (diff)
downloadttdaw-40a899bd6ee536eae093337bf2d0dcc8db4e46f1.tar.gz
Moved example code examples folder
Diffstat (limited to 'example3.c')
-rw-r--r--example3.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/example3.c b/example3.c
deleted file mode 100644
index a2103f2..0000000
--- a/example3.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "portmidi/pm_common/portmidi.h"
-
-#define NUM_INPUTS 16
-
-int main() {
- PmError err;
- PmStream *stream;
- PmEvent events[128];
- int i, num_events;
-
- // Initialize PortMIDI
- err = Pm_Initialize();
- if (err != pmNoError) {
- fprintf(stderr, "Error initializing PortMIDI: %s\n", Pm_GetErrorText(err));
- exit(1);
- }
-
- /* // Open a MIDI input device */
- stream = (PortMidiStream *)Pm_OpenInput(&err, NULL, NULL, NUM_INPUTS, NULL, 0);
- if (err != pmNoError) {
- fprintf(stderr, "Error opening MIDI input device: %s\n", Pm_GetErrorText(err));
- Pm_Terminate();
- exit(1);
- }
-
- /* // Read MIDI messages from the input device */
- /* while (1) { */
- /* num_events = Pm_Read(stream, events, 128); */
- /* if (num_events > 0) { */
- /* for (i = 0; i < num_events; i++) { */
- /* if (events[i].message & 0xff00) { */
- /* // This is a status message (note on, note off, etc.) */
- /* printf("Message: 0x%02x\n", events[i].message); */
- /* /1* printf("Status: 0x%02x, Data 1: 0x%02x, Data 2: 0x%02x\n", *1/ */
- /* /1* events[i].message & 0xf0, events[i].message[0], events[i].message[1]); *1/ */
- /* } */
- /* } */
- /* } */
- /* } */
-
- /* // Close the MIDI input device */
- Pm_Close(stream);
-
- // Terminate PortMIDI
- Pm_Terminate();
-
- return 0;
-}
-