View testnativefilters.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Native Event Filters for Keyboard Events | |
* Copyright © 2022 Pedro López-Cabanillas | |
* | |
* testnativefilters.pro: | |
* TEMPLATE = app | |
* QT += core gui widgets | |
* | |
* SOURCES += \ | |
* testnativefilters.cpp | |
* |
View CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.14) | |
project(integrate_uchardet LANGUAGES CXX) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
set(CMAKE_AUTOUIC ON) | |
set(CMAKE_AUTOMOC ON) | |
set(CMAKE_AUTORCC ON) |
View CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.5) | |
project(instenum LANGUAGES C) | |
find_package ( PkgConfig REQUIRED ) | |
pkg_check_modules ( FLUIDSYNTH REQUIRED IMPORTED_TARGET fluidsynth ) | |
if (FLUIDSYNTH_FOUND) | |
add_executable(instenum fluidsynth_inst2.c) | |
target_link_libraries ( instenum PRIVATE PkgConfig::FLUIDSYNTH ) | |
endif () |
View CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.5) | |
project(fluidenums LANGUAGES CXX) | |
set(CMAKE_CXX_STANDARD 11) | |
set(CMAKE_CXX_STANDARD_REQUIRED ON) | |
# this was the old method before modernization, using pkg-config | |
# find_package ( PkgConfig REQUIRED ) | |
# pkg_check_modules ( FLUIDSYNTH REQUIRED IMPORTED_TARGET fluidsynth ) | |
#if (FLUIDSYNTH_FOUND) |
View keysig.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
int main(int argc, char* argv[]) | |
{ | |
if (argc == 3) { | |
int sf = atoi(argv[1]); | |
int mi = atoi(argv[2]); |
View movablelabel.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QLabel> | |
#include <QMouseEvent> | |
#include <QMainWindow> | |
#include <QApplication> | |
class MovableLabel : public QLabel | |
{ | |
public: | |
MovableLabel(QWidget* parent = nullptr): QLabel(parent) | |
{ |
View testpygame.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame.midi | |
import time | |
pygame.midi.init() | |
#list all midi devices | |
for x in range( 0, pygame.midi.get_count() ): | |
print(x,"=",pygame.midi.get_device_info(x)) | |
player = pygame.midi.Output(2) |
View gist:543c01b9a812bca4293e2c4f44cab1c9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// kMusicDeviceProperty_SoundBankURL since 10.5 | |
QByteArray utf8file = fileName.toUtf8(); | |
CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(utf8file.data()), utf8file.length(), false); | |
if (url) { | |
error = AudioUnitSetProperty(dls_synth, kMusicDeviceProperty_SoundBankURL, kAudioUnitScope_Global, 0, &url, sizeof(url)); | |
CFRelease(url); | |
} |
View input2seq.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
compile with: | |
gcc -o input2seq -lasound input2seq.c | |
*/ | |
#include <linux/input.h> | |
#include <alsa/asoundlib.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
//#define INPUT_DEVICE "/dev/input/by-path/platform-i8042-serio-0-event-kbd" |
View fluidsynth_instr.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* FluidSynth Instruments - An example of using fluidsynth | |
* | |
* This code is in the public domain. | |
* | |
* To compile: | |
* gcc -o fluidsynth_instr fluidsynth_instr.c -lfluidsynth | |
* | |
* To run | |
* fluidsynth_instr soundfont | |
* |