Skip to content

Instantly share code, notes, and snippets.

View RyoKosaka's full-sized avatar

Ryo Kosaka RyoKosaka

View GitHub Profile
boolean piezo = false;
void setup() {
Serial.begin(38400);
}
void loop() {
int sensorValue = analogRead(A0);
boolean piezo = false;
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
void setup() {
MIDI.begin(10);
}
void loop() {
void setup() {
Serial.begin(38400);
}
void loop() {
int sensorValue = analogRead(A0);
int sensorValue1 = analogRead(A1);
Serial.print(sensorValue);
Serial.print(",");
Serial.println(sensorValue1);
// YAMAHA PCY135/155
// 3-ZONE RIDE SENSING TEST
// with EZdrummer2
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
int RIDE[4] = {500, 50, 51, 0}; // {sensitivity, threshold, note, velocity}*** NOTICE *** velocity must be zero.
boolean rideFlag = false;
boolean rideChokeFlag = false;
unsigned long time_hit_ride;
@RyoKosaka
RyoKosaka / rim.py
Last active December 23, 2017 16:45
#Author-Ryo Kosaka
#Description-Create Pad
import adsk.core, adsk.fusion, traceback
import math
defaultPadName = 'Pad'
defaultFilletRadius = 2
defaultShellHeight = 5
defaultRimOut = 23.6
/*
"TCRT5000 TEST "
Created Feb 21, 2018
by Ryo Kosaka
*/
/* NOTICE
#include <hellodrum.h>
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
//Please name your pad and controller.
HelloDrum kick(0);
HelloDrum snare(1);
HelloDrum hihat(2);
HelloDrum hihatControl(3);
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
uint8_t note = 38;
int SNARE[6] = {150, 4000, 38, 3, 0, 0}; //{threshold, sensitivity, note(no use), flag, velocity, last peakValue}
boolean snareFlag = false;
BLECharacteristic *pCharacteristic;
#include <hellodrum.h>
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
//Please name your piezo.
//The piezo named snare is connected to the A0 pin
HelloDrum snare(0);
//Setting
byte SNARE[6] = {
// Pin Definitions
const int selectPins[3] = {2, 3, 4}; // S0~2, S1~3, S2~4
const int zInput = A0; // Connect common (Z) to A0 (analog input)
void setup() {
Serial.begin(38400); // Initialize the serial port
// Set up the select pins as outputs:
for (int i=0; i<3; i++)
{
pinMode(selectPins[i], OUTPUT);