Fabrication industrielle
Internet des objets industriel | Matériaux industriels | Entretien et réparation d'équipement | Programmation industrielle |
home  MfgRobots >> Fabrication industrielle >  >> Manufacturing Technology >> Processus de fabrication

MIDI pour orgues numériques

Composants et fournitures

Arduino Mega 2560
× 1
Prise Midi DIN
× 1
Résistance 220 ohm
× 1
Câble USB-A vers B
× 1
Câble AWM
× 1
En-tête masculin 40 position 1 rangée (0,1")
× 1
Potentiomètre, Slide
10K linéaire
× 1
Socket IDC
(Facultatif)
× 1
Câbles de raccordement mâle/mâle
(Facultatif)
× 1

Outils et machines nécessaires

Fer à souder (générique)
Fil à souder, sans plomb
Flux de soudure, soudure
Dénudeur de fil, nez de pince dentelé
Pince, coupe latérale
Pince à bec plat

Applications et services en ligne

Arduino IDE

À propos de ce projet

Ce projet montre comment convertir une ancienne console d'orgue afin qu'elle puisse être utilisée pour envoyer des messages MIDI matériels à partir des manuels et des pédales à l'aide d'un seul Arduino Mega.

Le projet a commencé comme une tentative d'envoyer des messages midi alors que la génération sonore d'origine était encore intacte, mais les circuits d'origine se sont avérés assez difficiles à rétroconcevoir. Après avoir passé du temps avec le code, j'ai développé du code pour les manuels de type buss et ceux de type matriciel.

Remarques :

  • Ce projet modifie l'orgue afin que le changement de clavier d'origine ne fonctionne plus.
  • À l'intérieur d'un vieil orgue, il y a des composants électriques qui peuvent être dangereux. Travaillez toujours avec l'orgue débranché et assurez-vous d'avoir l'expérience et les compétences nécessaires pour travailler sur ce projet en toute sécurité. En cas de doute, consultez un technicien en électronique local qualifié avant de tenter ce projet.
  • Les composants à l'intérieur des anciens organes sont souvent assez anciens et sur le point de mal fonctionner, de sorte que toute modification peut endommager l'organe. Suivre les instructions fournies ici se fait aux risques et périls de l'utilisateur, et l'auteur de cet article n'assume aucune responsabilité pour tout dommage survenant à un organe, à tout équipement ou à des personnes à la suite d'une tentative de suivre ces instructions.

Étape 1 :Examiner l'organe

  • Mon premier code posté supposait que l'orgue que vous souhaitez modifier possède déjà un clavier matriciel, avec des commutateurs discrets et des diodes déjà en place. Depuis la publication de cette première version, j'ai également développé du code qui fonctionnera avec les conceptions de claviers à bus. Suivez simplement les instructions et utilisez le code de la version qui s'applique à vous (Matrixed vs. Bussed). Pour les deux conceptions, cependant, vous aurez besoin de diodes attachées à chaque interrupteur. Ceux-ci peuvent être obtenus à moindre coût. Cependant, le code téléchargé sur l'Arduino Mega est différent avec une conception matricielle par rapport à une conception à bus.
  • L'orgue particulier qui a été midifié dans cet exemple a des commutateurs normalement ouverts (NO) pour les claviers et des commutateurs normalement fermés (NC) pour les pédales. À l'aide d'un multimètre, vous pouvez vérifier le type de commutateurs dont dispose l'orgue que vous envisagez de convertir. Si le type d'interrupteur est différent de ce qui a été fait pour cet orgue, vous devrez modifier le code en fonction du type d'interrupteur (exemples donnés dans le code)
  • Découvrez comment ouvrir l'orgue pour accéder aux claviers et aux contacts du pédalier, et cherchez un endroit approprié pour attacher l'Arduino à l'intérieur de l'orgue. Vous devrez peut-être percer des trous ou installer des fiches pour alimenter l'Arduino et monter la fiche Midi. Dans cet exemple, une prise d'alimentation à 3 broches a été câblée à un petit boîtier d'alimentation à l'intérieur de l'orgue pour alimenter l'Arduino, et un trou a été percé et une prise Midi DIN a été fixée au trou.
  • L'orgue particulier montré ici avait deux claviers avec des matrices 6x11 et un pédalier avec une matrice 6x7. Si vous envisagez d'emprunter la voie matricielle et que l'organe en question possède déjà une matrice 8x8, soit le code et le câblage devront être modifiés pour s'adapter à une matrice 8x8, soit la matrice d'origine devra être recâblée pour prendre en charge une matrice 6x11.

Étape 2 : Connectez Arduino

-Mon Arduino Mega est venu avec une petite plaque en plastique pour le monter sur le bois de l'orgue. Je l'ai fixé avec de petites vis à bois n° 4 et des vis à métaux n° 4 pour fixer l'Arduino à la plaque. C'est une bonne idée de placer l'Arduino en premier, afin que vous puissiez estimer la longueur de chaque câble. À ce stade, vous pouvez également trouver un moyen d'alimenter l'Arduino.

Étape 3 : préparer les câbles

Clavier matriciel :

Chaque clavier aura 61 commutateurs. Dans l'exemple utilisé ici, chaque clavier avait 6 rangées, avec un fil allant de la première borne de chaque interrupteur à la première borne de chaque autre interrupteur à 6 interrupteurs. La deuxième borne de l'interrupteur est ensuite allée à une diode, puis aux colonnes, dont les interrupteurs ont été divisés en 11 colonnes pour les manuels, et 7 colonnes pour les pédales. Pour chaque manuel et les pédales ensuite, deux longueurs de fil AWM recommandées doivent être coupées afin qu'elles atteignent de chaque division à la carte Arduino, de préférence en suivant un chemin qui peut être soigneusement organisé, et en laissant toujours plus de latitude que nécessaire. Pour les colonnes, il est préférable de faire rallonger le câble sur toute la longueur du clavier ou du pédalier avant de passer à l'Arduino. Mesurez chaque longueur de câble et coupez à la bonne taille. À l'aide des petites pinces, séparez les brins individuels du câble aux extrémités et dénudez le plastique recouvrant les extrémités des fils à l'aide des pinces à dénuder.

Clavier pris en charge :

Le clavier peut être divisé en 6 câbles AWM, avec un fil ordinaire pour le 61ème interrupteur. Séparez les brins individuels du câble aux extrémités, puis dénudez le plastique recouvrant les extrémités à l'aide des pinces à dénuder.

Étape 4 :souder les extrémités du câble aux embases mâles

Claviers matriciels et à bus :Soudez les extrémités de câble appropriées aux broches mâles de l'en-tête, ou si vous utilisez le bornier à vis, fixez les câbles appropriés aux bornes à vis.

Étape 5 :Soudez l'autre extrémité du câble aux commutateurs

Clavier matriciel :

-Si l'orgue a déjà chaque contact câblé, vous devrez dessouder ou couper les fils d'origine pour que ce projet fonctionne. Si l'orgue a une matrice 6x11, il est judicieux de conserver les lignes de fils qui vont de chaque interrupteur au suivant 6 vers le haut. Retirez donc les fils de rangée allant du premier ensemble de six à l'ordinateur d'origine et soudez les fils de 6 rangées à la position où se trouvaient les 6 autres. Pour les colonnes, si elles ont déjà des diodes en place, alors clippez ou dessoudez le fil allant de l'autre extrémité des diodes à l'ordinateur d'origine, puis soudez le fil de colonne allant à votre Arduino à sa place. À l'aide de serre-câbles en plastique, vous pouvez organiser les câbles de manière à ce qu'ils passent parfaitement le long de l'endroit où passent les autres câbles de l'orgue. Pour le pédalier de l'orgue illustré ci-dessus, le panneau à l'avant de l'orgue contenant les commutateurs à lames a dû être retiré en enlevant les vis le maintenant, et les câbles acheminés à travers le petit trou au centre du panneau avant du orgue.

Clavier avec bus :

Dans le code du clavier à bus, il est nécessaire de souder une diode du côté non bus de chaque interrupteur, puis de la souder à l'un des 10 fils du câble, puis de répéter pour chacun des 6 câbles, puis de répéter pour le dernier fil (#61)

Étape 6 :Soudez la résistance à la prise MIDI et soudez les autres fils à l'Arduino.

Étape 7 :connectez les en-têtes à Arduino

-Branchez tous les en-têtes dans l'Arduino comme indiqué dans le schéma.

-Une solution alternative pour souder les fils sur les en-têtes mâles consiste à acheter des prises IDC à dix broches et à les connecter aux extrémités des câbles AWM, puis à utiliser des cavaliers mâles à mâles pour se connecter à l'Arduino. Bien que cette solution ne soit pas aussi permanente que la soudure, il est conseillé si vous avez l'intention d'essayer de modifier le code publié, au cas où un recâblage serait nécessaire.

Étape 8 : Télécharger le logiciel sur Arduino

-Connectez un câble USB de l'Arduino à votre ordinateur et assurez-vous que le logiciel Arduino est installé sur votre ordinateur. Sélectionnez la version du code qui s'applique à vous (Matrixed vs. Bussed). Exécutez le logiciel Arduino, copiez et collez le code fourni dans une nouvelle esquisse vierge. Assurez-vous que l'Arduino est connecté via USB série, et cliquez sur le bouton "Télécharger" en haut de l'esquisse.

Étape 9 :Testez

  • Si ce n'est déjà fait, connectez votre adaptateur MIDI à l'ordinateur et connectez la sortie MIDI de l'orgue à l'adaptateur MIDI.
  • En utilisant un logiciel pour surveiller les signaux MIDI, assurez-vous que chaque touche et pédale envoie le message MIDI approprié lorsque vous appuyez sur la touche, et appuyez sur chaque touche.
  • Si vous prévoyez d'utiliser sans être connecté à votre ordinateur, vous pouvez connecter une petite alimentation 5v au port d'alimentation de l'Arduino, ou connecter une prise d'alimentation USB à l'extrémité du câble USB que vous avez utilisé, et branchez-la dans une prise murale pour alimenter l'Arduino.

Remarques :

  • Le code publié pour les claviers bus n'a pas encore été testé, mais il devrait fonctionner. Veuillez poster dans les commentaires si vous avez essayé le code bussé et avez trouvé un problème avec celui-ci.
  • Notez que pour la version bussée du code, des diodes sont nécessaires pour qu'elle fonctionne correctement. De plus, lors de la soudure des diodes sur les commutateurs, il est important de souder la diode avec le pôle négatif vers le commutateur. Pour la conception matricielle, le pôle négatif de la diode doit être éloigné du commutateur.
  • En plus d'ajouter le design bussed, j'ai également mis à jour le design et le code d'origine pour inclure des potentiomètres, tels que ceux utilisés dans les pédales d'expression.
  • Pour que la conception à bus fonctionne correctement à la broche 13, il est nécessaire de désactiver d'une manière ou d'une autre la LED intégrée de l'Arduino. Pour ce faire, vous pouvez soit l'enlever à l'aide de deux fers à souder, soit utiliser une paire de pinces à pointe fine pour l'écraser soigneusement.
  • Bien que la conception à bus fonctionne pour de nombreux orgues avec un clavier à bus, elle peut ne pas fonctionner de manière fiable si le bus est fait de matériau « bronze phosphoreux ». Le câblage de tous les bus pour un seul manuel et le câblage de tous les contacts pour une seule clé aideront à éviter les contacts intermittents, mais pour les barres omnibus en bronze phosphoreux, il est recommandé d'utiliser un détrompage 12V (ce que ce projet ne pourrait pas faire).

Matériel de pédale d'expression pour potentiomètres

À l'avenir, j'espère ajouter plus de détails à ce sujet, mais pour l'instant, j'expliquerai brièvement la conception vue ci-dessus. La connexion à la pédale d'expression est un support en "L" peu coûteux disponible dans une quincaillerie locale. Il est ici connecté à un support existant, mais un deuxième support en L fixé directement sur la pédale peut également être utilisé. Il s'articule sur une vis mécanique maintenue légèrement desserrée à l'aide d'un contre-écrou et de deux rondelles. Sur la photo, j'ai utilisé une très longue vis à métaux, mais une aussi longue n'est pas nécessaire, c'était juste ce que j'avais sous la main. Pour la tige métallique, j'ai utilisé une "soudure JB" pour fixer un boulon à œil à une extrémité et j'ai utilisé une vis à métaux de taille appropriée pour la fixer au support "L" à l'autre extrémité.

Pour le support du potentiomètre lui-même, j'ai acheté des feuilles acryliques transparentes, je les ai marquées avec un cutter, puis je les ai cassées le long de la ligne à l'aide de pinces et de pinces. Pour fixer le potentiomètre, j'ai fabriqué un petit morceau d'acrylique pour le soulever du plus gros morceau, j'ai poncé la surface du plus petit morceau d'acrylique et j'ai également poncé la surface du potentiomètre à monter et la surface du plus gros morceau pour auquel tout serait attaché, puis appliqué la soudure JB et utilisé une petite pince pour maintenir le tout ensemble jusqu'à ce que la soudure JB sèche. Les trous dans les pièces en acrylique ont été percés avec une perceuse électrique et des forets standard.

Le bas de la plus grande pièce d'acrylique est fixé à une petite charnière de meuble à l'aide de vis à métaux n° 4, et l'autre extrémité de la charnière de meuble est fixée au bas de l'orgue à l'aide de vis à bois courtes n° 4. J'ai fabriqué un support en acrylique pour maintenir la charnière du meuble hors du parquet, mais selon la conception de la charnière du meuble, cela pourrait ne pas être nécessaire.

Le bloc blanc dans lequel glisse la tige est un bloc PFTE que j'ai acheté à un fournisseur de pièces de robot. La pièce a été découpée dans la plus grande pièce à l'aide d'une scie de loisir et les trois trous ont été percés à l'aide d'une perceuse électrique et de forets de différentes tailles. Le bloc PFTE a été fixé au support en acrylique à l'aide de vis mécaniques.

Instructions détaillées pour le support de pédale d'expression :

(Mise à jour le 9 décembre 2021)

-8x10 pouces feuille acrylique

-Bloc Téflon

-Tige en aluminium (1/4 pouce, disponible dans une quincaillerie locale ou un magasin de métal)

-JB Soudure

-Potentiomètre linéaire

-Charnière de petit meuble

-Petit meuble entretoise

-Petit boulon à oeil

-Vis à bois courtes #4

-Matériel assorti :

- Rondelle frein X1 (de préférence en téflon) et vis à métaux assortie à fixer à la pédale (diamètre et longueur correspondant à la pédale actuelle)

-Vis mécaniques x2, rondelles x4 et écrous x2 pour fixer le téflon à la feuille acrylique (diamètre et longueur en fonction du diamètre du trou percé)

-Vis mécanique pour fixer le renfort à la tige en aluminium 1/4 (diamètre en fonction de la taille du trou interne)

-Vis mécaniques x2, rondelles x4 et écrous x2 pour fixer la charnière au bas de la feuille acrylique.

Outils :

-Couteau de loisir

-Bord droit

- Tournevis de bijoutier/tournevis ordinaire (bijoutiers pour les plus petites vis)

-Clé à molette (pour serrer les vis et écrous mécaniques)

-Pinces

-Perceuse électrique et forets.

-Scie amateur

-Étau d'établi

-Petite pince à bois

-Papier de verre à grain fin

-Bâtons de popsicle et carton de rebut.

-Chiffon humide

Mode d'emploi :

-Examiner la pédale actuelle. S'il y a un trou de rechange sur le support de montage, vous pouvez l'utiliser, sinon vous pouvez utiliser un trou existant qui est utilisé et obtenir une vis à métaux plus longue que celle actuelle, mais qui s'adaptera toujours dans le trou.

-Assurez-vous que la base en bois de l'orgue est libre de tout composant ou électronique, et déplacez-les si nécessaire.

-Déroulez la feuille d'acrylique et, à l'aide de la règle droite et du cutter, marquez la feuille des deux côtés en un rectangle de 3" sur 4,5", puis fissurez le long des lignes de marquage pour la couper à l'aide de l'étau et de la pince (assurez-vous utiliser des lunettes de protection !). Coupez également un morceau de 3" par 0,5" et un morceau de 2,4" par 0,3".

-Couper le bloc de téflon à l'aide de la scie de loisir à environ 3/4" de l'extrémité pour créer un bloc de 3' par 1,5' par 3/4 pouces.

-Percez 2 trous le long du bord inférieur de la grande feuille acrylique afin qu'ils correspondent à un côté de la charnière du meuble, et percez deux trous sur le côté 3x1,5 pouces du bloc de téflon afin qu'ils ne gênent pas le chemin la tige en aluminium le traversera. Percez 2 trous qui correspondent aux trous du bloc de téflon si le bloc est positionné en haut de la grande plaque acrylique, à l'opposé des trous précédemment percés, avec le bord du bloc de téflon juste au bord de l'acrylique. Percez également 2 trous dans la pièce de 2,4" par 0,3" afin qu'elle corresponde aux trous de l'autre côté de la charnière.

- Poncez doucement une surface du potentiomètre, ainsi que la zone de la grande feuille d'acrylique à coller, et les deux surfaces de la pièce d'acrylique 3x0,5". Essuyez les surfaces avec un chiffon humide.

-Mélanger la soudure JB sur du carton de rebut à l'aide d'un bâtonnet de popsicle, puis appliquer sur la surface préparée de la feuille acrylique. Ajoutez la pièce de 3x0,5", puis ajoutez plus de soudure JB, puis le potentiomètre, en vous assurant que la soudure JB est attachée à une surface poncée. Serrez délicatement l'ensemble avec une petite pince à bois et laissez durcir 24 heures.

-Percez un trou légèrement plus grand que 1/4 pouce à l'aide d'un foret de 1/4 pouce en déplaçant le foret pendant qu'il est dans le bloc d'un côté 3/4x3 pouce du bloc de téflon à l'autre. Percez-le de manière à ce que la ligne de la tige en aluminium coïncide avec la ligne du mouvement du potentiomètre.

-Coupez la tige en aluminium de 1/4 de pouce de manière à ce qu'elle ait à peu près la bonne longueur du bas du potentiomètre à la pédale d'expression lorsqu'elle est complètement enfoncée.

-Une fois la soudure JB durcie, fixez la charnière et le bloc de téflon sur le côté de la grande plaque acrylique à l'aide de vis à métaux, de rondelles et d'écrous. Placez le boulon à œil sur la partie mobile du potentiomètre et fixez-le à la tige en aluminium de 1/4 de pouce se déplaçant à travers le bloc de téflon. Si l'ajustement est un peu lâche, vous pouvez également souder JB le boulon à œil à la tige en aluminium lors de l'application de la soudure JB à une étape précédente. Dans ce cas, vous devrez mettre le boulon à œil sur le potentiomètre, le déplacer à travers le bloc de téflon, puis fixer le bloc de téflon à la plaque acrylique avec des vis à métaux après.

-En maintenant le boulon à œil dans la bonne position avec une pince, fixez le renfort de meuble à l'autre extrémité de la tige en aluminium de 1/4 pouce à l'aide d'une vis à métaux de la bonne taille. Assurez-vous que le boulon à œil est dans la bonne orientation par rapport au renfort de meuble lorsqu'il est serré.

-S'il y a un trou libre sur le support du potentiomètre, passez une nouvelle vis mécanique à travers, puis mettez une rondelle frein en téflon et serrez jusqu'à ce que le support du meuble bouge librement. Si vous utilisez un trou existant qui est actuellement occupé par une vis à métaux précédente, retirez l'ancienne vis et insérez une nouvelle vis plus longue, fixez-la comme avant, puis sur la longueur supplémentaire, ajoutez le support de meuble et une rondelle de blocage en téflon.

-Déplacez le bas de la charnière d'avant en arrière sur le bas à l'intérieur de l'orgue jusqu'à ce qu'il soit dans une position où la tige en aluminium de 1/4 de pouce est alignée droit, et avec la plus petite plaque acrylique en place, le mouvement de la pédale se rapproche le mieux du mouvement du potentiomètre. Fixez le bas du support de potentiomètre au bas de l'orgue à l'aide des 2 petites vis à bois, en veillant à ce que la plaque acrylique soit entre la charnière et le bois (cela assure un bon déplacement de la charnière).

Remarque finale :

Arduino Project Hub ne semble pas avoir de notification pour les publications et les questions placées ici. Si vous souhaitez une réponse plus rapide à votre question, vous pouvez la poster sur cette page du forum, qui m'en informera.

Code

  • Code du clavier matriciel
  • Code de clavier pris en charge
Code de clavier matricielArduino
Code à télécharger sur l'Arduino lorsque vous suivez le schéma du clavier matricé.
// Nom :Arduino Mega Midi Controller v21// Création :4 février 2021// Auteur :Larason2// Remerciements :Bald Engineer, Amanda Ghassaei, jeffb42 , GrumpyMikebyte keysA[11][6];byte keysB[11][6];byte keysC[7][6];byte lastA[11][6];byte lastB[11][6];byte lastC[7 ][6];int noteOn1 =144;int noteOff1 =128;int noteOn2 =145;int noteOff2 =129;int noteOn3 =146;int noteOff3 =130;int vélocité =100;int chan6 =181;int chan7 =182; int Exp =11;int LastPot6 =1;int LastPot7 =1;void setup() { // Démarrer Serial Serial.begin(31250); //Initialiser le clavier A pinMode(2, INPUT); pinMode(22, ENTREE); pinMode(24, ENTRÉE); pinMode(26, ENTREE); pinMode (28, ENTRÉE); pinMode(30, ENTRÉE); pinMode (32, ENTREE); pinMode (34, ENTREE); pinMode (36, ENTREE); pinMode (38, ENTRÉE); pinMode (40, ENTREE); pinMode (42, ENTREE); pinMode (44, ENTREE); pinMode (46, ENTREE); pinMode (48, ENTREE); pinMode (50, ENTREE); pinMode (52, ENTRÉE); //Initialiser le clavier B pinMode(3, INPUT); pinMode(23, ENTREE); pinMode (25, ENTREE); pinMode (27, ENTREE); pinMode (29, ENTREE); pinMode(31, ENTREE); pinMode(33, ENTREE); pinMode (35, ENTRÉE); pinMode (37, ENTREE); pinMode (39, ENTREE); pinMode(41, ENTREE); pinMode (43, ENTREE); pinMode (45, ENTREE); pinMode (47, ENTREE); pinMode (49, ENTREE); pinMode(51, ENTRÉE); pinMode (52, ENTRÉE); //Initialize Keyboard C pinMode (A2, INPUT); pinMode (A3, ENTRÉE); pinMode (A4, ENTRÉE); pinMode (A5, ENTRÉE); pinMode (A6, ENTRÉE); pinMode (A7, ENTRÉE); pinMode (A8, ENTRÉE); pinMode (A9, ENTRÉE); pinMode (A10, ENTRÉE); pinMode (A11, ENTRÉE); pinMode (A12, ENTREE); pinMode (A13, ENTREE); pinMode(A14, INPUT);}void loop() { // Lecture du clavier A pinMode(22, INPUT_PULLUP); pinMode(24, INPUT_PULLUP); pinMode(26, INPUT_PULLUP); pinMode (28, INPUT_PULLUP); pinMode(30, INPUT_PULLUP); pinMode(2, INPUT_PULLUP); pinMode (32, SORTIE); digitalWrite (32, FAIBLE); keysA[0][0] =digitalRead(2); pinMode (32, ENTREE); pinMode (34, SORTIE); digitalWrite (34, FAIBLE); keysA[1][0] =digitalRead(22); keysA[1][1] =digitalRead(24); keysA[1][2] =digitalRead(26); keysA[1][3] =digitalRead(28); touchesA[1][4] =digitalRead(30); touchesA[1][5] =digitalRead(2) ; pinMode (34, ENTREE); pinMode (36, SORTIE); digitalWrite (36, FAIBLE); keysA[2][0] =digitalRead(22); keysA[2][1] =digitalRead(24); keysA[2][2] =digitalRead(26); keysA[2][3] =digitalRead(28); keysA[2][4] =digitalRead(30); keysA[2][5] =digitalRead(2) ; pinMode (36, ENTREE); pinMode (38, SORTIE); écriture numérique (38, FAIBLE); keysA[3][0] =digitalRead(22); keysA[3][1] =digitalRead(24); keysA[3][2] =digitalRead(26); keysA[3][3] =digitalRead(28); keysA[3][4] =digitalRead(30); keysA[3][5] =digitalRead(2) ; pinMode (38, ENTRÉE); pinMode (40, SORTIE); digitalWrite (40, FAIBLE); keysA[4][0] =digitalRead(22); touchesA[4][1] =digitalRead(24); touchesA[4][2] =digitalRead(26); keysA[4][3] =digitalRead(28); touchesA[4][4] =digitalRead(30); touchesA[4][5] =digitalRead(2) ; pinMode (40, ENTREE); pinMode (42, SORTIE); écriture numérique (42, FAIBLE); keysA[5][0] =digitalRead(22); touchesA[5][1] =digitalRead(24); touchesA[5][2] =digitalRead(26); keysA[5][3] =digitalRead(28); touchesA[5][4] =digitalRead(30); touchesA[5][5] =digitalRead(2) ; pinMode (42, ENTREE); pinMode (44, SORTIE); écriture numérique (44, FAIBLE); keysA[6][0] =digitalRead(22); keysA[6][1] =digitalRead(24); touchesA[6][2] =digitalRead(26); keysA[6][3] =digitalRead(28); touchesA[6][4] =digitalRead(30); touchesA[6][5] =digitalRead(2) ; pinMode (44, ENTREE); pinMode (46, SORTIE); écriture numérique (46, FAIBLE); keysA[7][0] =digitalRead(22); keysA[7][1] =digitalRead(24); keysA[7][2] =digitalRead(26); keysA[7][3] =digitalRead(28); touchesA[7][4] =digitalRead(30); touchesA[7][5] =digitalRead(2) ; pinMode (46, ENTREE); pinMode (48, SORTIE); écriture numérique (48, FAIBLE); keysA[8][0] =digitalRead(22); touchesA[8][1] =digitalRead(24); keysA[8][2] =digitalRead(26); keysA[8][3] =digitalRead(28); touchesA[8][4] =digitalRead(30); touchesA[8][5] =digitalRead(2) ; pinMode (48, ENTREE); pinMode (50, SORTIE); écriture numérique (50, FAIBLE); keysA[9][0] =digitalRead(22); keysA[9][1] =digitalRead(24); keysA[9][2] =digitalRead(26); keysA[9][3] =digitalRead(28); keysA[9][4] =digitalRead(30); keysA[9][5] =digitalRead(2) ; pinMode (50, ENTREE); pinMode (52, SORTIE); écriture numérique (52, FAIBLE); keysA[10][0] =digitalRead(22); keysA[10][1] =digitalRead(24); keysA[10][2] =digitalRead(26); keysA[10][3] =digitalRead(28); keysA[10][4] =digitalRead(30); keysA[10][5] =digitalRead(2) ; pinMode (52, ENTRÉE); pinMode(22, ENTREE); pinMode(24, ENTRÉE); pinMode(26, ENTREE); pinMode (28, ENTRÉE); pinMode(30, ENTRÉE); pinMode(2, INPUT); // Lecture du clavier B pinMode(23, INPUT_PULLUP); pinMode (25, INPUT_PULLUP); pinMode (27, INPUT_PULLUP); pinMode(29, INPUT_PULLUP); pinMode(31, INPUT_PULLUP); pinMode(3, INPUT_PULLUP); pinMode(33, SORTIE); digitalWrite(33, LOW); keysB[0][0] =digitalRead(3); pinMode(33, ENTREE); pinMode (35, SORTIE); écriture numérique (35, FAIBLE); keysB[1][0] =digitalRead(23); keysB[1][1] =digitalRead (25); keysB[1][2] =digitalRead(27); keysB[1][3] =digitalRead(29); touchesB[1][4] =digitalRead(31); touchesB[1][5] =digitalRead(3) ; pinMode (35, ENTRÉE); pinMode (37, SORTIE); écriture numérique (37, FAIBLE); keysB[2][0] =digitalRead(23); keysB[2][1] =digitalRead (25); keysB[2][2] =digitalRead(27); keysB[2][3] =digitalRead(29); keysB[2][4] =digitalRead(31); keysB[2][5] =digitalRead(3) ; pinMode (37, ENTREE); pinMode (39, SORTIE); digitalWrite (39, FAIBLE); keysB[3][0] =digitalRead(23); keysB[3][1] =digitalRead (25); keysB[3][2] =digitalRead(27); keysB[3][3] =digitalRead(29); keysB[3][4] =digitalRead(31); keysB[3][5] =digitalRead(3) ; pinMode (39, ENTREE); pinMode(41, SORTIE); écriture numérique (41, FAIBLE); keysB[4][0] =digitalRead(23); touchesB[4][1] =digitalRead (25); touchesB[4][2] =digitalRead(27); touchesB[4][3] =digitalRead(29); touchesB[4][4] =digitalRead(31); touchesB[4][5] =digitalRead(3) ; pinMode(41, ENTREE); pinMode (43, SORTIE); écriture numérique (43, FAIBLE); keysB[5][0] =digitalRead(23); touchesB[5][1] =digitalRead (25); touchesB[5][2] =digitalRead(27); keysB[5][3] =digitalRead(29); touchesB[5][4] =digitalRead(31); touchesB[5][5] =digitalRead(3) ; pinMode (43, ENTREE); pinMode (45, SORTIE); écriture numérique (45, FAIBLE); keysB[6][0] =digitalRead(23); touchesB[6][1] =digitalRead (25); touchesB[6][2] =digitalRead(27); touchesB[6][3] =digitalRead(29); touchesB[6][4] =digitalRead(31); touchesB[6][5] =digitalRead(3) ; pinMode (45, ENTREE); pinMode (47, SORTIE); écriture numérique (47, FAIBLE); keysB[7][0] =digitalRead(23); touchesB[7][1] =digitalRead (25); touchesB[7][2] =digitalRead(27); keysB[7][3] =digitalRead(29); touchesB[7][4] =digitalRead(31); touchesB[7][5] =digitalRead(3) ; pinMode (47, ENTREE); pinMode (49, SORTIE); écriture numérique (49, FAIBLE); keysB[8][0] =digitalRead(23); touchesB[8][1] =digitalRead (25); touchesB[8][2] =digitalRead(27); keysB[8][3] =digitalRead(29); touchesB[8][4] =digitalRead(31); touchesB[8][5] =digitalRead(3) ; pinMode (49, ENTREE); pinMode(51, SORTIE); digitalWrite(51, LOW); keysB[9][0] =digitalRead(23); keysB[9][1] =digitalRead (25); keysB[9][2] =digitalRead(27); keysB[9][3] =digitalRead(29); keysB[9][4] =digitalRead(31); keysB[9][5] =digitalRead(3) ; pinMode(51, ENTRÉE); pinMode (53, SORTIE); digitalWrite (53, FAIBLE); keysB[10][0] =digitalRead(23); keysB[10][1] =digitalRead (25); keysB[10][2] =digitalRead(27); keysB[10][3] =digitalRead(29); touchesB[10][4] =digitalRead(31); keysB[10][5] =digitalRead(3) ; pinMode (53, ENTREE); pinMode(23, ENTREE); pinMode (25, ENTREE); pinMode (27, ENTREE); pinMode (29, ENTREE); pinMode(31, ENTREE); pinMode(3, INPUT); // Lire le clavier C // Définir les broches de la ligne pour lire pinMode (A3, INPUT_PULLUP); pinMode(A4, INPUT_PULLUP); pinMode(A5, INPUT_PULLUP); pinMode(A6, INPUT_PULLUP); pinMode(A7, INPUT_PULLUP); pinMode(A2, INPUT_PULLUP); pinMode (A8, SORTIE); écriture numérique (A8, FAIBLE); keysC[0][0] =digitalRead(A2) ; pinMode (A8, ENTRÉE); pinMode (A9, SORTIE); écriture numérique (A9, FAIBLE); touchesC[1][0] =digitalRead(A3) ; touchesC[1][1] =digitalRead(A4) ; touchesC[1][2] =digitalRead(A5) ; touchesC[1][3] =digitalRead(A6) ; touchesC[1][4] =digitalRead(A7) ; touchesC[1][5] =digitalRead(A2) ; pinMode (A9, ENTRÉE); pinMode (A10, SORTIE); écriture numérique (A10, FAIBLE); keysC[2][0] =digitalRead(A3) ; touchesC[2][1] =digitalRead(A4) ; keysC[2][2] =digitalRead(A5) ; keysC[2][3] =digitalRead(A6) ; touchesC[2][4] =digitalRead(A7) ; touchesC[2][5] =digitalRead(A2) ; pinMode (A10, ENTRÉE); pinMode (A11, SORTIE); écriture numérique (A11, FAIBLE); keysC[3][0] =digitalRead(A3) ; touchesC[3][1] =digitalRead(A4) ; keysC[3][2] =digitalRead(A5) ; keysC[3][3] =digitalRead(A6) ; touchesC[3][4] =digitalRead(A7) ; touchesC[3][5] =digitalRead(A2) ; pinMode (A11, ENTRÉE); pinMode (A12, SORTIE); écriture numérique (A12, FAIBLE); touchesC[4][0] =digitalRead(A3) ; touchesC[4][1] =digitalRead(A4) ; touchesC[4][2] =digitalRead(A5) ; touchesC[4][3] =digitalRead(A6) ; touchesC[4][4] =digitalRead(A7) ; touchesC[4][5] =digitalRead(A2) ; pinMode (A12, ENTREE); pinMode (A13, SORTIE); écriture numérique (A13, FAIBLE); touchesC[5][0] =digitalRead(A3) ; touchesC[5][1] =digitalRead(A4) ; touchesC[5][2] =digitalRead(A5) ; touchesC[5][3] =digitalRead(A6) ; touchesC[5][4] =digitalRead(A7) ; touchesC[5][5] =digitalRead(A2) ; pinMode (A13, ENTREE); pinMode (A14, SORTIE); écriture numérique (A14, FAIBLE); touchesC[6][0] =digitalRead(A3) ; pinMode (A14, ENTRÉE); pinMode (A3, ENTRÉE); pinMode (A4, ENTRÉE); pinMode (A5, ENTRÉE); pinMode (A6, ENTRÉE); pinMode (A7, ENTRÉE); pinMode (A2, ENTREE); //Inverser les données C du clavier //(Pour les commutateurs normalement fermés) //Colonne 1 if (keysC[0][0] ==0) { keysC[0][0] =1; } else if (keysC[0][0] ==1) { keysC[0][0] =0; } //Colonne 2 if (keysC[1][0] ==0) { keysC[1][0] =1; } else if (keysC[1][0] ==1) { keysC[1][0] =0; } si (touchesC[1][1] ==0) { touchesC[1][1] =1 ; } else if (keysC[1][1] ==1) { keysC[1][1] =0; } si (touchesC[1][2] ==0) { touchesC[1][2] =1; } else if (keysC[1][2] ==1) { keysC[1][2] =0; } si (touchesC[1][3] ==0) { touchesC[1][3] =1; } else if (keysC[1][3] ==1) { keysC[1][3] =0; } si (touchesC[1][4] ==0) { touchesC[1][4] =1 ; } else if (keysC[1][4] ==1) { keysC[1][4] =0; } si (touchesC[1][5] ==0) { touchesC[1][5] =1 ; } else if (keysC[1][5] ==1) { keysC[1][5] =0; } //Colonne 3 if (keysC[2][0] ==0) { keysC[2][0] =1; } else if (keysC[2][0] ==1) { keysC[2][0] =0; } if (keysC[2][1] ==0) { keysC[2][1] =1; } else if (keysC[2][1] ==1) { keysC[2][1] =0; } if (keysC[2][2] ==0) { keysC[2][2] =1; } else if (keysC[2][2] ==1) { keysC[2][2] =0; } if (keysC[2][3] ==0) { keysC[2][3] =1; } else if (keysC[2][3] ==1) { keysC[2][3] =0; } if (keysC[2][4] ==0) { keysC[2][4] =1; } else if (keysC[2][4] ==1) { keysC[2][4] =0; } if (keysC[2][5] ==0) { keysC[2][5] =1; } else if (keysC[2][5] ==1) { keysC[2][5] =0; } //Column 4 if (keysC[3][0] ==0) { keysC[3][0] =1; } else if (keysC[3][0] ==1) { keysC[3][0] =0; } if (keysC[3][1] ==0) { keysC[3][1] =1; } else if (keysC[3][1] ==1) { keysC[3][1] =0; } if (keysC[3][2] ==0) { keysC[3][2] =1; } else if (keysC[3][2] ==1) { keysC[3][2] =0; } if (keysC[3][3] ==0) { keysC[3][3] =1; } else if (keysC[3][3] ==1) { keysC[3][3] =0; } if (keysC[3][4] ==0) { keysC[3][4] =1; } else if (keysC[3][4] ==1) { keysC[3][4] =0; } if (keysC[3][5] ==0) { keysC[3][5] =1; } else if (keysC[3][5] ==1) { keysC[3][5] =0; } //Column 5 if (keysC[4][0] ==0) { keysC[4][0] =1; } else if (keysC[4][0] ==1) { keysC[4][0] =0; } if (keysC[4][1] ==0) { keysC[4][1] =1; } else if (keysC[4][1] ==1) { keysC[4][1] =0; } if (keysC[4][2] ==0) { keysC[4][2] =1; } else if (keysC[4][2] ==1) { keysC[4][2] =0; } if (keysC[4][3] ==0) { keysC[4][3] =1; } else if (keysC[4][3] ==1) { keysC[4][3] =0; } if (keysC[4][4] ==0) { keysC[4][4] =1; } else if (keysC[4][4] ==1) { keysC[4][4] =0; } if (keysC[4][5] ==0) { keysC[4][5] =1; } else if (keysC[4][5] ==1) { keysC[4][5] =0; } //Column 6 if (keysC[5][0] ==0) { keysC[5][0] =1; } else if (keysC[5][0] ==1) { keysC[5][0] =0; } if (keysC[5][1] ==0) { keysC[5][1] =1; } else if (keysC[5][1] ==1) { keysC[5][1] =0; } if (keysC[5][2] ==0) { keysC[5][2] =1; } else if (keysC[5][2] ==1) { keysC[5][2] =0; } if (keysC[5][3] ==0) { keysC[5][3] =1; } else if (keysC[5][3] ==1) { keysC[5][3] =0; } if (keysC[5][4] ==0) { keysC[5][4] =1; } else if (keysC[5][4] ==1) { keysC[5][4] =0; } if (keysC[5][5] ==0) { keysC[5][5] =1; } else if (keysC[5][5] ==1) { keysC[5][5] =0; } //Column 7 if (keysC[6][0] ==0) { keysC[6][0] =1; } else if (keysC[6][0] ==1) { keysC[6][0] =0; } //Write Keyboard A //A36 if ((keysA[0][0] ==0) and (lastA[0][0] ==0)) { MidiSend(noteOn1, 36, velocity); lastA[0][0] =7; } if ((keysA[0][0] ==1) and (lastA[0][0] ==7)) { MidiSend(noteOff1, 36, velocity); lastA[0][0] =0; } //A37 if ((keysA[1][0] ==0) and (lastA[1][0] ==0)) { MidiSend(noteOn1, 37, velocity); lastA[1][0] =7; } if ((keysA[1][0] ==1) and (lastA[1][0] ==7)) { MidiSend(noteOff1, 37, velocity); lastA[1][0] =0; } //A38 if ((keysA[1][1] ==0) and (lastA[1][1] ==0)) { MidiSend(noteOn1, 38, velocity); lastA[1][1] =7; } //Write Midi Note Off if ((keysA[1][1] ==1) and (lastA[1][1] ==7)) { MidiSend(noteOff1, 38, velocity); lastA[1][1] =0; } //A39 if ((keysA[1][2] ==0) and (lastA[1][2] ==0)) { MidiSend(noteOn1, 39, velocity); lastA[1][2] =7; } //Write Midi Note Off if ((keysA[1][2] ==1) and (lastA[1][2] ==7)) { MidiSend(noteOff1, 39, velocity); lastA[1][2] =0; } //A40 if ((keysA[1][3] ==0) and (lastA[1][3] ==0)) { MidiSend(noteOn1, 40, velocity); lastA[1][3] =7; } //Write Midi Note Off if ((keysA[1][3] ==1) and (lastA[1][3] ==7)) { MidiSend(noteOff1, 40, velocity); lastA[1][3] =0; } //A41 if ((keysA[1][4] ==0) and (lastA[1][4] ==0)) { MidiSend(noteOn1, 41, velocity); lastA[1][4] =7; } //Write Midi Note Off if ((keysA[1][4] ==1) and (lastA[1][4] ==7)) { MidiSend(noteOff1, 41, velocity); lastA[1][4] =0; } //A42 if ((keysA[1][5] ==0) and (lastA[1][5] ==0)) { MidiSend(noteOn1, 42, velocity); lastA[1][5] =7; } //Write Midi Note Off if ((keysA[1][5] ==1) and (lastA[1][5] ==7)) { MidiSend(noteOff1, 42, velocity); lastA[1][5] =0; } //A43 if ((keysA[2][0] ==0) and (lastA[2][0] ==0)) { MidiSend(noteOn1, 43, velocity); lastA[2][0] =7; } //Write Midi Note Off if ((keysA[2][0] ==1) and (lastA[2][0] ==7)) { MidiSend(noteOff1, 43, velocity); lastA[2][0] =0; } //A44 if ((keysA[2][1] ==0) and (lastA[2][1] ==0)) { MidiSend(noteOn1, 44, velocity); lastA[2][1] =7; } //Write Midi Note Off if ((keysA[2][1] ==1) and (lastA[2][1] ==7)) { MidiSend(noteOff1, 44, velocity); lastA[2][1] =0; } //A45 if ((keysA[2][2] ==0) and (lastA[2][2] ==0)) { MidiSend(noteOn1, 45, velocity); lastA[2][2] =7; } //Write Midi Note Off if ((keysA[2][2] ==1) and (lastA[2][2] ==7)) { MidiSend(noteOff1, 45, velocity); lastA[2][2] =0; } //A46 if ((keysA[2][3] ==0) and (lastA[2][3] ==0)) { MidiSend(noteOn1, 46, velocity); lastA[2][3] =7; } //Write Midi Note Off if ((keysA[2][3] ==1) and (lastA[2][3] ==7)) { MidiSend(noteOff1, 46, velocity); lastA[2][3] =0; } //A47 if ((keysA[2][4] ==0) and (lastA[2][4] ==0)) { MidiSend(noteOn1, 47, velocity); lastA[2][4] =7; } //Write Midi Note Off if ((keysA[2][4] ==1) and (lastA[2][4] ==7)) { MidiSend(noteOff1, 47, velocity); lastA[2][4] =0; } //A48 if ((keysA[2][5] ==0) and (lastA[2][5] ==0)) { MidiSend(noteOn1, 48, velocity); lastA[2][5] =7; } //Write Midi Note Off if ((keysA[2][5] ==1) and (lastA[2][5] ==7)) { MidiSend(noteOff1, 48, velocity); lastA[2][5] =0; } //A49 if ((keysA[3][0] ==0) and (lastA[3][0] ==0)) { MidiSend(noteOn1, 49, velocity); lastA[3][0] =7; } //Write Midi Note Off if ((keysA[3][0] ==1) and (lastA[3][0] ==7)) { MidiSend(noteOff1, 49, velocity); lastA[3][0] =0; } //A50 if ((keysA[3][1] ==0) and (lastA[3][1] ==0)) { MidiSend(noteOn1, 50, velocity); lastA[3][1] =7; } //Write Midi Note Off if ((keysA[3][1] ==1) and (lastA[3][1] ==7)) { MidiSend(noteOff1, 50, velocity); lastA[3][1] =0; } //A51 if ((keysA[3][2] ==0) and (lastA[3][2] ==0)) { MidiSend(noteOn1, 51, velocity); lastA[3][2] =7; } //Write Midi Note Off if ((keysA[3][2] ==1) and (lastA[3][2] ==7)) { MidiSend(noteOff1, 51, velocity); lastA[3][2] =0; } //A52 if ((keysA[3][3] ==0) and (lastA[3][3] ==0)) { MidiSend(noteOn1, 52, velocity); lastA[3][3] =7; } //Write Midi Note Off if ((keysA[3][3] ==1) and (lastA[3][3] ==7)) { MidiSend(noteOff1, 52, velocity); lastA[3][3] =0; } //A53 if ((keysA[3][4] ==0) and (lastA[3][4] ==0)) { MidiSend(noteOn1, 53, velocity); lastA[3][4] =7; } //Write Midi Note Off if ((keysA[3][4] ==1) and (lastA[3][4] ==7)) { MidiSend(noteOff1, 53, velocity); lastA[3][4] =0; } //A54 if ((keysA[3][5] ==0) and (lastA[3][5] ==0)) { MidiSend(noteOn1, 54, velocity); lastA[3][5] =7; } //Write Midi Note Off if ((keysA[3][5] ==1) and (lastA[3][5] ==7)) { MidiSend(noteOff1, 54, velocity); lastA[3][5] =0; } //A55 if ((keysA[4][0] ==0) and (lastA[4][0] ==0)) { MidiSend(noteOn1, 55, velocity); lastA[4][0] =7; } //Write Midi Note Off if ((keysA[4][0] ==1) and (lastA[4][0] ==7)) { MidiSend(noteOff1, 55, velocity); lastA[4][0] =0; } //A56 if ((keysA[4][1] ==0) and (lastA[4][1] ==0)) { MidiSend(noteOn1, 56, velocity); lastA[4][1] =7; } //Write Midi Note Off if ((keysA[4][1] ==1) and (lastA[4][1] ==7)) { MidiSend(noteOff1, 56, velocity); lastA[4][1] =0; } //A57 if ((keysA[4][2] ==0) and (lastA[4][2] ==0)) { MidiSend(noteOn1, 57, velocity); lastA[4][2] =7; } //Write Midi Note Off if ((keysA[4][2] ==1) and (lastA[4][2] ==7)) { MidiSend(noteOff1, 57, velocity); lastA[4][2] =0; } //A58 if ((keysA[4][3] ==0) and (lastA[4][3] ==0)) { MidiSend(noteOn1, 58, velocity); lastA[4][3] =7; } //Write Midi Note Off if ((keysA[4][3] ==1) and (lastA[4][3] ==7)) { MidiSend(noteOff1, 58, velocity); lastA[4][3] =0; } //59 if ((keysA[4][4] ==0) and (lastA[4][4] ==0)) { MidiSend(noteOn1, 59, velocity); lastA[4][4] =7; } //Write Midi Note Off if ((keysA[4][4] ==1) and (lastA[4][4] ==7)) { MidiSend(noteOff1, 59, velocity); lastA[4][4] =0; } //A60 if ((keysA[4][5] ==0) and (lastA[4][5] ==0)) { MidiSend(noteOn1, 60, velocity); lastA[4][5] =7; } //Write Midi Note Off if ((keysA[4][5] ==1) and (lastA[4][5] ==7)) { MidiSend(noteOff1, 60, velocity); lastA[4][5] =0; } //A61 if ((keysA[5][0] ==0) and (lastA[5][0] ==0)) { MidiSend(noteOn1, 61, velocity); lastA[5][0] =7; } //Write Midi Note Off if ((keysA[5][0] ==1) and (lastA[5][0] ==7)) { MidiSend(noteOff1, 61, velocity); lastA[5][0] =0; } //A62 if ((keysA[5][1] ==0) and (lastA[5][1] ==0)) { MidiSend(noteOn1, 62, velocity); lastA[5][1] =7; } //Write Midi Note Off if ((keysA[5][1] ==1) and (lastA[5][1] ==7)) { MidiSend(noteOff1, 62, velocity); lastA[5][1] =0; } //A63 if ((keysA[5][2] ==0) and (lastA[5][2] ==0)) { MidiSend(noteOn1, 63, velocity); lastA[5][2] =7; } //Write Midi Note Off if ((keysA[5][2] ==1) and (lastA[5][2] ==7)) { MidiSend(noteOff1, 63, velocity); lastA[5][2] =0; } //A64 if ((keysA[5][3] ==0) and (lastA[5][3] ==0)) { MidiSend(noteOn1, 64, velocity); lastA[5][3] =7; } //Write Midi Note Off if ((keysA[5][3] ==1) and (lastA[5][3] ==7)) { MidiSend(noteOff1, 64, velocity); lastA[5][3] =0; } //A65 if ((keysA[5][4] ==0) and (lastA[5][4] ==0)) { MidiSend(noteOn1, 65, velocity); lastA[5][4] =7; } //Write Midi Note Off if ((keysA[5][4] ==1) and (lastA[5][4] ==7)) { MidiSend(noteOff1, 65, velocity); lastA[5][4] =0; } //A66 if ((keysA[5][5] ==0) and (lastA[5][5] ==0)) { MidiSend(noteOn1, 66, velocity); lastA[5][5] =7; } //Write Midi Note Off if ((keysA[5][5] ==1) and (lastA[5][5] ==7)) { MidiSend(noteOff1, 66, velocity); lastA[5][5] =0; } //A67 if ((keysA[6][0] ==0) and (lastA[6][0] ==0)) { MidiSend(noteOn1, 67, velocity); lastA[6][0] =7; } //Write Midi Note Off if ((keysA[6][0] ==1) and (lastA[6][0] ==7)) { MidiSend(noteOff1, 67, velocity); lastA[6][0] =0; } //A68 if ((keysA[6][1] ==0) and (lastA[6][1] ==0)) { MidiSend(noteOn1, 68, velocity); lastA[6][1] =7; } //Write Midi Note Off if ((keysA[6][1] ==1) and (lastA[6][1] ==7)) { MidiSend(noteOff1, 68, velocity); lastA[6][1] =0; } //A69 if ((keysA[6][2] ==0) and (lastA[6][2] ==0)) { MidiSend(noteOn1, 69, velocity); lastA[6][2] =7; } //Write Midi Note Off if ((keysA[6][2] ==1) and (lastA[6][2] ==7)) { MidiSend(noteOff1, 69, velocity); lastA[6][2] =0; } //A70 if ((keysA[6][3] ==0) and (lastA[6][3] ==0)) { MidiSend(noteOn1, 70, velocity); lastA[6][3] =7; } //Write Midi Note Off if ((keysA[6][3] ==1) and (lastA[6][3] ==7)) { MidiSend(noteOff1, 70, velocity); lastA[6][3] =0; } //A71 if ((keysA[6][4] ==0) and (lastA[6][4] ==0)) { MidiSend(noteOn1, 71, velocity); lastA[6][4] =7; } //Write Midi Note Off if ((keysA[6][4] ==1) and (lastA[6][4] ==7)) { MidiSend(noteOff1, 71, velocity); lastA[6][4] =0; } //A72 if ((keysA[6][5] ==0) and (lastA[6][5] ==0)) { MidiSend(noteOn1, 72, velocity); lastA[6][5] =7; } //Write Midi Note Off if ((keysA[6][5] ==1) and (lastA[6][5] ==7)) { MidiSend(noteOff1, 72, velocity); lastA[6][5] =0; } //A73 if ((keysA[7][0] ==0) and (lastA[7][0] ==0)) { MidiSend(noteOn1, 73, velocity); lastA[7][0] =7; } //Write Midi Note Off if ((keysA[7][0] ==1) and (lastA[7][0] ==7)) { MidiSend(noteOff1, 73, velocity); lastA[7][0] =0; } //A74 if ((keysA[7][1] ==0) and (lastA[7][1] ==0)) { MidiSend(noteOn1, 74, velocity); lastA[7][1] =7; } //Write Midi Note Off if ((keysA[7][1] ==1) and (lastA[7][1] ==7)) { MidiSend(noteOff1, 74, velocity); lastA[7][1] =0; } //A75 if ((keysA[7][2] ==0) and (lastA[7][2] ==0)) { MidiSend(noteOn1, 75, velocity); lastA[7][2] =7; } //Write Midi Note Off if ((keysA[7][2] ==1) and (lastA[7][2] ==7)) { MidiSend(noteOff1, 75, velocity); lastA[7][2] =0; } //A76 if ((keysA[7][3] ==0) and (lastA[7][3] ==0)) { MidiSend(noteOn1, 76, velocity); lastA[7][3] =7; } //Write Midi Note Off if ((keysA[7][3] ==1) and (lastA[7][3] ==7)) { MidiSend(noteOff1, 76, velocity); lastA[7][3] =0; } //A77 if ((keysA[7][4] ==0) and (lastA[7][4] ==0)) { MidiSend(noteOn1, 77, velocity); lastA[7][4] =7; } //Write Midi Note Off if ((keysA[7][4] ==1) and (lastA[7][4] ==7)) { MidiSend(noteOff1, 77, velocity); lastA[7][4] =0; } //A78 if ((keysA[7][5] ==0) and (lastA[7][5] ==0)) { MidiSend(noteOn1, 78, velocity); lastA[7][5] =7; } //Write Midi Note Off if ((keysA[7][5] ==1) and (lastA[7][5] ==7)) { MidiSend(noteOff1, 78, velocity); lastA[7][5] =0; } //A79 if ((keysA[8][0] ==0) and (lastA[8][0] ==0)) { MidiSend(noteOn1, 79, velocity); lastA[8][0] =7; } //Write Midi Note Off if ((keysA[8][0] ==1) and (lastA[8][0] ==7)) { MidiSend(noteOff1, 79, velocity); lastA[8][0] =0; } //A80 if ((keysA[8][1] ==0) and (lastA[8][1] ==0)) { MidiSend(noteOn1, 80, velocity); lastA[8][1] =7; } //Write Midi Note Off if ((keysA[8][1] ==1) and (lastA[8][1] ==7)) { MidiSend(noteOff1, 80, velocity); lastA[8][1] =0; } //A81 if ((keysA[8][2] ==0) and (lastA[8][2] ==0)) { MidiSend(noteOn1, 81, velocity); lastA[8][2] =7; } //Write Midi Note Off if ((keysA[8][2] ==1) and (lastA[8][2] ==7)) { MidiSend(noteOff1, 81, velocity); lastA[8][2] =0; } //A82 if ((keysA[8][3] ==0) and (lastA[8][3] ==0)) { MidiSend(noteOn1, 82, velocity); lastA[8][3] =7; } //Write Midi Note Off if ((keysA[8][3] ==1) and (lastA[8][3] ==7)) { MidiSend(noteOff1, 82, velocity); lastA[8][3] =0; } //A83 if ((keysA[8][4] ==0) and (lastA[8][4] ==0)) { MidiSend(noteOn1, 83, velocity); lastA[8][4] =7; } //Write Midi Note Off if ((keysA[8][4] ==1) and (lastA[8][4] ==7)) { MidiSend(noteOff1, 83, velocity); lastA[8][4] =0; } //A84 if ((keysA[8][5] ==0) and (lastA[8][5] ==0)) { MidiSend(noteOn1, 84, velocity); lastA[8][5] =7; } //Write Midi Note Off if ((keysA[8][5] ==1) and (lastA[8][5] ==7)) { MidiSend(noteOff1, 84, velocity); lastA[8][5] =0; } //A85 if ((keysA[9][0] ==0) and (lastA[9][0] ==0)) { MidiSend(noteOn1, 85, velocity); lastA[9][0] =7; } //Write Midi Note Off if ((keysA[9][0] ==1) and (lastA[9][0] ==7)) { MidiSend(noteOff1, 85, velocity); lastA[9][0] =0; } //A86 if ((keysA[9][1] ==0) and (lastA[9][1] ==0)) { MidiSend(noteOn1, 86, velocity); lastA[9][1] =7; } //Write Midi Note Off if ((keysA[9][1] ==1) and (lastA[9][1] ==7)) { MidiSend(noteOff1, 86, velocity); lastA[9][1] =0; } //A87 if ((keysA[9][2] ==0) and (lastA[9][2] ==0)) { MidiSend(noteOn1, 87, velocity); lastA[9][2] =7; } //Write Midi Note Off if ((keysA[9][2] ==1) and (lastA[9][2] ==7)) { MidiSend(noteOff1, 87, velocity); lastA[9][2] =0; } //A88 if ((keysA[9][3] ==0) and (lastA[9][3] ==0)) { MidiSend(noteOn1, 88, velocity); lastA[9][3] =7; } //Write Midi Note Off if ((keysA[9][3] ==1) and (lastA[9][3] ==7)) { MidiSend(noteOff1, 88, velocity); lastA[9][3] =0; } //A89 if ((keysA[9][4] ==0) and (lastA[9][4] ==0)) { MidiSend(noteOn1, 89, velocity); lastA[9][4] =7; } //Write Midi Note Off if ((keysA[9][4] ==1) and (lastA[9][4] ==7)) { MidiSend(noteOff1, 89, velocity); lastA[9][4] =0; } //A90 if ((keysA[9][5] ==0) and (lastA[9][5] ==0)) { MidiSend(noteOn1, 90, velocity); lastA[9][5] =7; } //Write Midi Note Off if ((keysA[9][5] ==1) and (lastA[9][5] ==7)) { MidiSend(noteOff1, 90, velocity); lastA[9][5] =0; } //A91 if ((keysA[10][0] ==0) and (lastA[10][0] ==0)) { MidiSend(noteOn1, 91, velocity); lastA[10][0] =7; } //Write Midi Note Off if ((keysA[10][0] ==1) and (lastA[10][0] ==7)) { MidiSend(noteOff1, 91, velocity); lastA[10][0] =0; } //A92 if ((keysA[10][1] ==0) and (lastA[10][1] ==0)) { MidiSend(noteOn1, 92, velocity); lastA[10][1] =7; } //Write Midi Note Off if ((keysA[10][1] ==1) and (lastA[10][1] ==7)) { MidiSend(noteOff1, 92, velocity); lastA[10][1] =0; } //A93 if ((keysA[10][2] ==0) and (lastA[10][2] ==0)) { MidiSend(noteOn1, 93, velocity); lastA[10][2] =7; } //Write Midi Note Off if ((keysA[10][2] ==1) and (lastA[10][2] ==7)) { MidiSend(noteOff1, 93, velocity); lastA[10][2] =0; } //A94 if ((keysA[10][3] ==0) and (lastA[10][3] ==0)) { MidiSend(noteOn1, 94, velocity); lastA[10][3] =7; } //Write Midi Note Off if ((keysA[10][3] ==1) and (lastA[10][3] ==7)) { MidiSend(noteOff1, 94, velocity); lastA[10][3] =0; } //A95 if ((keysA[10][4] ==0) and (lastA[10][4] ==0)) { MidiSend(noteOn1, 95, velocity); lastA[10][4] =7; } //Write Midi Note Off if ((keysA[10][4] ==1) and (lastA[10][4] ==7)) { MidiSend(noteOff1, 95, velocity); lastA[10][4] =0; } //A96 if ((keysA[10][5] ==0) and (lastA[10][5] ==0)) { MidiSend(noteOn1, 96, velocity); lastA[10][5] =7; } //Write Midi Note Off if ((keysA[10][5] ==1) and (lastA[10][5] ==7)) { MidiSend(noteOff1, 96, velocity); lastA[10][5] =0; } //Write Keyboard B //B36 if ((keysB[0][0] ==0) and (lastB[0][0] ==0)) { MidiSend(noteOn2, 36, velocity); lastB[0][0] =7; } if ((keysB[0][0] ==1) and (lastB[0][0] ==7)) { MidiSend(noteOff2, 36, velocity); lastB[0][0] =0; } //B37 if ((keysB[1][0] ==0) and (lastB[1][0] ==0)) { MidiSend(noteOn2, 37, velocity); lastB[1][0] =7; } if ((keysB[1][0] ==1) and (lastB[1][0] ==7)) { MidiSend(noteOff2, 37, velocity); lastB[1][0] =0; } //B38 if ((keysB[1][1] ==0) and (lastB[1][1] ==0)) { MidiSend(noteOn2, 38, velocity); lastB[1][1] =7; } //Write Midi Note Off if ((keysB[1][1] ==1) and (lastB[1][1] ==7)) { MidiSend(noteOff2, 38, velocity); lastB[1][1] =0; } //B39 if ((keysB[1][2] ==0) and (lastB[1][2] ==0)) { MidiSend(noteOn2, 39, velocity); lastB[1][2] =7; } //Write Midi Note Off if ((keysB[1][2] ==1) and (lastB[1][2] ==7)) { MidiSend(noteOff2, 39, velocity); lastB[1][2] =0; } //B40 if ((keysB[1][3] ==0) and (lastB[1][3] ==0)) { MidiSend(noteOn2, 40, velocity); lastB[1][3] =7; } //Write Midi Note Off if ((keysB[1][3] ==1) and (lastB[1][3] ==7)) { MidiSend(noteOff2, 40, velocity); lastB[1][3] =0; } //B41 if ((keysB[1][4] ==0) and (lastB[1][4] ==0)) { MidiSend(noteOn2, 41, velocity); lastB[1][4] =7; } //Write Midi Note Off if ((keysB[1][4] ==1) and (lastB[1][4] ==7)) { MidiSend(noteOff2, 41, velocity); lastB[1][4] =0; } //B42 if ((keysB[1][5] ==0) and (lastB[1][5] ==0)) { MidiSend(noteOn2, 42, velocity); lastB[1][5] =7; } //Write Midi Note Off if ((keysB[1][5] ==1) and (lastB[1][5] ==7)) { MidiSend(noteOff2, 42, velocity); lastB[1][5] =0; } //B43 if ((keysB[2][0] ==0) and (lastB[2][0] ==0)) { MidiSend(noteOn2, 43, velocity); lastB[2][0] =7; } //Write Midi Note Off if ((keysB[2][0] ==1) and (lastB[2][0] ==7)) { MidiSend(noteOff2, 43, velocity); lastB[2][0] =0; } //B44 if ((keysB[2][1] ==0) and (lastB[2][1] ==0)) { MidiSend(noteOn2, 44, velocity); lastB[2][1] =7; } //Write Midi Note Off if ((keysB[2][1] ==1) and (lastB[2][1] ==7)) { MidiSend(noteOff2, 44, velocity); lastB[2][1] =0; } //B45 if ((keysB[2][2] ==0) and (lastB[2][2] ==0)) { MidiSend(noteOn2, 45, velocity); lastB[2][2] =7; } //Write Midi Note Off if ((keysB[2][2] ==1) and (lastB[2][2] ==7)) { MidiSend(noteOff2, 45, velocity); lastB[2][2] =0; } //B46 if ((keysB[2][3] ==0) and (lastB[2][3] ==0)) { MidiSend(noteOn2, 46, velocity); lastB[2][3] =7; } //Write Midi Note Off if ((keysB[2][3] ==1) and (lastB[2][3] ==7)) { MidiSend(noteOff2, 46, velocity); lastB[2][3] =0; } //B47 if ((keysB[2][4] ==0) and (lastB[2][4] ==0)) { MidiSend(noteOn2, 47, velocity); lastB[2][4] =7; } //Write Midi Note Off if ((keysB[2][4] ==1) and (lastB[2][4] ==7)) { MidiSend(noteOff2, 47, velocity); lastB[2][4] =0; } //B48 if ((keysB[2][5] ==0) and (lastB[2][5] ==0)) { MidiSend(noteOn2, 48, velocity); lastB[2][5] =7; } //Write Midi Note Off if ((keysB[2][5] ==1) and (lastB[2][5] ==7)) { MidiSend(noteOff2, 48, velocity); lastB[2][5] =0; } //B49 if ((keysB[3][0] ==0) and (lastB[3][0] ==0)) { MidiSend(noteOn2, 49, velocity); lastB[3][0] =7; } //Write Midi Note Off if ((keysB[3][0] ==1) and (lastB[3][0] ==7)) { MidiSend(noteOff2, 49, velocity); lastB[3][0] =0; } //B50 if ((keysB[3][1] ==0) and (lastB[3][1] ==0)) { MidiSend(noteOn2, 50, velocity); lastB[3][1] =7; } //Write Midi Note Off if ((keysB[3][1] ==1) and (lastB[3][1] ==7)) { MidiSend(noteOff2, 50, velocity); lastB[3][1] =0; } //B51 if ((keysB[3][2] ==0) and (lastB[3][2] ==0)) { MidiSend(noteOn2, 51, velocity); lastB[3][2] =7; } //Write Midi Note Off if ((keysB[3][2] ==1) and (lastB[3][2] ==7)) { MidiSend(noteOff2, 51, velocity); lastB[3][2] =0; } //B52 if ((keysB[3][3] ==0) and (lastB[3][3] ==0)) { MidiSend(noteOn2, 52, velocity); lastB[3][3] =7; } //Write Midi Note Off if ((keysB[3][3] ==1) and (lastB[3][3] ==7)) { MidiSend(noteOff2, 52, velocity); lastB[3][3] =0; } //B53 if ((keysB[3][4] ==0) and (lastB[3][4] ==0)) { MidiSend(noteOn2, 53, velocity); lastB[3][4] =7; } //Write Midi Note Off if ((keysB[3][4] ==1) and (lastB[3][4] ==7)) { MidiSend(noteOff2, 53, velocity); lastB[3][4] =0; } //B54 if ((keysB[3][5] ==0) and (lastB[3][5] ==0)) { MidiSend(noteOn2, 54, velocity); lastB[3][5] =7; } //Write Midi Note Off if ((keysB[3][5] ==1) and (lastB[3][5] ==7)) { MidiSend(noteOff2, 54, velocity); lastB[3][5] =0; } //B55 if ((keysB[4][0] ==0) and (lastB[4][0] ==0)) { MidiSend(noteOn2, 55, velocity); lastB[4][0] =7; } //Write Midi Note Off if ((keysB[4][0] ==1) and (lastB[4][0] ==7)) { MidiSend(noteOff2, 55, velocity); lastB[4][0] =0; } //B56 if ((keysB[4][1] ==0) and (lastB[4][1] ==0)) { MidiSend(noteOn2, 56, velocity); lastB[4][1] =7; } //Write Midi Note Off if ((keysB[4][1] ==1) and (lastB[4][1] ==7)) { MidiSend(noteOff2, 56, velocity); lastB[4][1] =0; } //B57 if ((keysB[4][2] ==0) and (lastB[4][2] ==0)) { MidiSend(noteOn2, 57, velocity); lastB[4][2] =7; } //Write Midi Note Off if ((keysB[4][2] ==1) and (lastB[4][2] ==7)) { MidiSend(noteOff2, 57, velocity); lastB[4][2] =0; } //B58 if ((keysB[4][3] ==0) and (lastB[4][3] ==0)) { MidiSend(noteOn2, 58, velocity); lastB[4][3] =7; } //Write Midi Note Off if ((keysB[4][3] ==1) and (lastB[4][3] ==7)) { MidiSend(noteOff2, 58, velocity); lastB[4][3] =0; } //B59 if ((keysB[4][4] ==0) and (lastB[4][4] ==0)) { MidiSend(noteOn2, 59, velocity); lastB[4][4] =7; } //Write Midi Note Off if ((keysB[4][4] ==1) and (lastB[4][4] ==7)) { MidiSend(noteOff2, 59, velocity); lastB[4][4] =0; } //B60 if ((keysB[4][5] ==0) and (lastB[4][5] ==0)) { MidiSend(noteOn2, 60, velocity); lastB[4][5] =7; } //Write Midi Note Off if ((keysB[4][5] ==1) and (lastB[4][5] ==7)) { MidiSend(noteOff2, 60, velocity); lastB[4][5] =0; } //B61 if ((keysB[5][0] ==0) and (lastB[5][0] ==0)) { MidiSend(noteOn2, 61, velocity); lastB[5][0] =7; } //Write Midi Note Off if ((keysB[5][0] ==1) and (lastB[5][0] ==7)) { MidiSend(noteOff2, 61, velocity); lastB[5][0] =0; } //B62 if ((keysB[5][1] ==0) and (lastB[5][1] ==0)) { MidiSend(noteOn2, 62, velocity); lastB[5][1] =7; } //Write Midi Note Off if ((keysB[5][1] ==1) and (lastB[5][1] ==7)) { MidiSend(noteOff2, 62, velocity); lastB[5][1] =0; } //B63 if ((keysB[5][2] ==0) and (lastB[5][2] ==0)) { MidiSend(noteOn2, 63, velocity); lastB[5][2] =7; } //Write Midi Note Off if ((keysB[5][2] ==1) and (lastB[5][2] ==7)) { MidiSend(noteOff2, 63, velocity); lastB[5][2] =0; } //B64 if ((keysB[5][3] ==0) and (lastB[5][3] ==0)) { MidiSend(noteOn2, 64, velocity); lastB[5][3] =7; } //Write Midi Note Off if ((keysB[5][3] ==1) and (lastB[5][3] ==7)) { MidiSend(noteOff2, 64, velocity); lastB[5][3] =0; } //B65 if ((keysB[5][4] ==0) and (lastB[5][4] ==0)) { MidiSend(noteOn2, 65, velocity); lastB[5][4] =7; } //Write Midi Note Off if ((keysB[5][4] ==1) and (lastB[5][4] ==7)) { MidiSend(noteOff2, 65, velocity); lastB[5][4] =0; } //B66 if ((keysB[5][5] ==0) and (lastB[5][5] ==0)) { MidiSend(noteOn2, 66, velocity); lastB[5][5] =7; } //Write Midi Note Off if ((keysB[5][5] ==1) and (lastB[5][5] ==7)) { MidiSend(noteOff2, 66, velocity); lastB[5][5] =0; } //B67 if ((keysB[6][0] ==0) and (lastB[6][0] ==0)) { MidiSend(noteOn2, 67, velocity); lastB[6][0] =7; } //Write Midi Note Off if ((keysB[6][0] ==1) and (lastB[6][0] ==7)) { MidiSend(noteOff2, 67, velocity); lastB[6][0] =0; } //B68 if ((keysB[6][1] ==0) and (lastB[6][1] ==0)) { MidiSend(noteOn2, 68, velocity); lastB[6][1] =7; } //Write Midi Note Off if ((keysB[6][1] ==1) and (lastB[6][1] ==7)) { MidiSend(noteOff2, 68, velocity); lastB[6][1] =0; } //B69 if ((keysB[6][2] ==0) and (lastB[6][2] ==0)) { MidiSend(noteOn2, 69, velocity); lastB[6][2] =7; } //Write Midi Note Off if ((keysB[6][2] ==1) and (lastB[6][2] ==7)) { MidiSend(noteOff2, 69, velocity); lastB[6][2] =0; } //B70 if ((keysB[6][3] ==0) and (lastB[6][3] ==0)) { MidiSend(noteOn2, 70, velocity); lastB[6][3] =7; } //Write Midi Note Off if ((keysB[6][3] ==1) and (lastB[6][3] ==7)) { MidiSend(noteOff2, 70, velocity); lastB[6][3] =0; } //B71 if ((keysB[6][4] ==0) and (lastB[6][4] ==0)) { MidiSend(noteOn2, 71, velocity); lastB[6][4] =7; } //Write Midi Note Off if ((keysB[6][4] ==1) and (lastB[6][4] ==7)) { MidiSend(noteOff2, 71, velocity); lastB[6][4] =0; } //B72 if ((keysB[6][5] ==0) and (lastB[6][5] ==0)) { MidiSend(noteOn2, 72, velocity); lastB[6][5] =7; } //Write Midi Note Off if ((keysB[6][5] ==1) and (lastB[6][5] ==7)) { MidiSend(noteOff2, 72, velocity); lastB[6][5] =0; } //B73 if ((keysB[7][0] ==0) and (lastB[7][0] ==0)) { MidiSend(noteOn2, 73, velocity); lastB[7][0] =7; } //Write Midi Note Off if ((keysB[7][0] ==1) and (lastB[7][0] ==7)) { MidiSend(noteOff2, 73, velocity); lastB[7][0] =0; } //B74 if ((keysB[7][1] ==0) and (lastB[7][1] ==0)) { MidiSend(noteOn2, 74, velocity); lastB[7][1] =7; } //Write Midi Note Off if ((keysB[7][1] ==1) and (lastB[7][1] ==7)) { MidiSend(noteOff2, 74, velocity); lastB[7][1] =0; } //B75 if ((keysB[7][2] ==0) and (lastB[7][2] ==0)) { MidiSend(noteOn2, 75, velocity); lastB[7][2] =7; } //Write Midi Note Off if ((keysB[7][2] ==1) and (lastB[7][2] ==7)) { MidiSend(noteOff2, 75, velocity); lastB[7][2] =0; } //B76 if ((keysB[7][3] ==0) and (lastB[7][3] ==0)) { MidiSend(noteOn2, 76, velocity); lastB[7][3] =7; } //Write Midi Note Off if ((keysB[7][3] ==1) and (lastB[7][3] ==7)) { MidiSend(noteOff2, 76, velocity); lastB[7][3] =0; } //B77 if ((keysB[7][4] ==0) and (lastB[7][4] ==0)) { MidiSend(noteOn2, 77, velocity); lastB[7][4] =7; } //Write Midi Note Off if ((keysB[7][4] ==1) and (lastB[7][4] ==7)) { MidiSend(noteOff2, 77, velocity); lastB[7][4] =0; } //B78 if ((keysB[7][5] ==0) and (lastB[7][5] ==0)) { MidiSend(noteOn2, 78, velocity); lastB[7][5] =7; } //Write Midi Note Off if ((keysB[7][5] ==1) and (lastB[7][5] ==7)) { MidiSend(noteOff2, 78, velocity); lastB[7][5] =0; } //B79 if ((keysB[8][0] ==0) and (lastB[8][0] ==0)) { MidiSend(noteOn2, 79, velocity); lastB[8][0] =7; } //Write Midi Note Off if ((keysB[8][0] ==1) and (lastB[8][0] ==7)) { MidiSend(noteOff2, 79, velocity); lastB[8][0] =0; } //B80 if ((keysB[8][1] ==0) and (lastB[8][1] ==0)) { MidiSend(noteOn2, 80, velocity); lastB[8][1] =7; } //Write Midi Note Off if ((keysB[8][1] ==1) and (lastB[8][1] ==7)) { MidiSend(noteOff2, 80, velocity); lastB[8][1] =0; } //B81 if ((keysB[8][2] ==0) and (lastB[8][2] ==0)) { MidiSend(noteOn2, 81, velocity); lastB[8][2] =7; } //Write Midi Note Off if ((keysB[8][2] ==1) and (lastB[8][2] ==7)) { MidiSend(noteOff2, 81, velocity); lastB[8][2] =0; } //B82 if ((keysB[8][3] ==0) and (lastB[8][3] ==0)) { MidiSend(noteOn2, 82, velocity); lastB[8][3] =7; } //Write Midi Note Off if ((keysB[8][3] ==1) and (lastB[8][3] ==7)) { MidiSend(noteOff2, 82, velocity); lastB[8][3] =0; } //B83 if ((keysB[8][4] ==0) and (lastB[8][4] ==0)) { MidiSend(noteOn2, 83, velocity); lastB[8][4] =7; } //Write Midi Note Off if ((keysB[8][4] ==1) and (lastB[8][4] ==7)) { MidiSend(noteOff2, 83, velocity); lastB[8][4] =0; } //B84 if ((keysB[8][5] ==0) and (lastB[8][5] ==0)) { MidiSend(noteOn2, 84, velocity); lastB[8][5] =7; } //Write Midi Note Off if ((keysB[8][5] ==1) and (lastB[8][5] ==7)) { MidiSend(noteOff2, 84, velocity); lastB[8][5] =0; } //B85 if ((keysB[9][0] ==0) and (lastB[9][0] ==0)) { MidiSend(noteOn2, 85, velocity); lastB[9][0] =7; } //Write Midi Note Off if ((keysB[9][0] ==1) and (lastB[9][0] ==7)) { MidiSend(noteOff2, 85, velocity); lastB[9][0] =0; } //B86 if ((keysB[9][1] ==0) and (lastB[9][1] ==0)) { MidiSend(noteOn2, 86, velocity); lastB[9][1] =7; } //Write Midi Note Off if ((keysB[9][1] ==1) and (lastB[9][1] ==7)) { MidiSend(noteOff2, 86, velocity); lastB[9][1] =0; } //B87 if ((keysB[9][2] ==0) and (lastB[9][2] ==0)) { MidiSend(noteOn2, 87, velocity); lastB[9][2] =7; } //Write Midi Note Off if ((keysB[9][2] ==1) and (lastB[9][2] ==7)) { MidiSend(noteOff2, 87, velocity); lastB[9][2] =0; } //B88 if ((keysB[9][3] ==0) and (lastB[9][3] ==0)) { MidiSend(noteOn2, 88, velocity); lastB[9][3] =7; } //Write Midi Note Off if ((keysB[9][3] ==1) and (lastB[9][3] ==7)) { MidiSend(noteOff2, 88, velocity); lastB[9][3] =0; } //B89 if ((keysB[9][4] ==0) and (lastB[9][4] ==0)) { MidiSend(noteOn2, 89, velocity); lastB[9][4] =7; } //Write Midi Note Off if ((keysB[9][4] ==1) and (lastB[9][4] ==7)) { MidiSend(noteOff2, 89, velocity); lastB[9][4] =0; } //B90 if ((keysB[9][5] ==0) and (lastB[9][5] ==0)) { MidiSend(noteOn2, 90, velocity); lastB[9][5] =7; } //Write Midi Note Off if ((keysB[9][5] ==1) and (lastB[9][5] ==7)) { MidiSend(noteOff2, 90, velocity); lastB[9][5] =0; } //B91 if ((keysB[10][0] ==0) and (lastB[10][0] ==0)) { MidiSend(noteOn2, 91, velocity); lastB[10][0] =7; } //Write Midi Note Off if ((keysB[10][0] ==1) and (lastB[10][0] ==7)) { MidiSend(noteOff2, 91, velocity); lastB[10][0] =0; } //B92 if ((keysB[10][1] ==0) and (lastB[10][1] ==0)) { MidiSend(noteOn2, 92, velocity); lastB[10][1] =7; } //Write Midi Note Off if ((keysB[10][1] ==1) and (lastB[10][1] ==7)) { MidiSend(noteOff2, 92, velocity); lastB[10][1] =0; } //B93 if ((keysB[10][2] ==0) and (lastB[10][2] ==0)) { MidiSend(noteOn2, 93, velocity); lastB[10][2] =7; } //Write Midi Note Off if ((keysB[10][2] ==1) and (lastB[10][2] ==7)) { MidiSend(noteOff2, 93, velocity); lastB[10][2] =0; } //B94 if ((keysB[10][3] ==0) and (lastB[10][3] ==0)) { MidiSend(noteOn2, 94, velocity); lastB[10][3] =7; } //Write Midi Note Off if ((keysB[10][3] ==1) and (lastB[10][3] ==7)) { MidiSend(noteOff2, 94, velocity); lastB[10][3] =0; } //B95 if ((keysB[10][4] ==0) and (lastB[10][4] ==0)) { MidiSend(noteOn2, 95, velocity); lastB[10][4] =7; } //Write Midi Note Off if ((keysB[10][4] ==1) and (lastB[10][4] ==7)) { MidiSend(noteOff2, 95, velocity); lastB[10][4] =0; } //B96 if ((keysB[10][5] ==0) and (lastB[10][5] ==0)) { MidiSend(noteOn2, 96, velocity); lastB[10][5] =7; } //Write Midi Note Off if ((keysB[10][5] ==1) and (lastB[10][5] ==7)) { MidiSend(noteOff2, 96, velocity); lastB[10][5] =0; } //Write Keyboard C //C36 if ((keysC[0][0] ==0) and (lastC[0][0] ==0)) { MidiSend(noteOff3, 36, velocity); lastC[0][0] =7; } if ((keysC[0][0] ==1) and (lastC[0][0] ==7)) { MidiSend(noteOn3, 36, velocity); lastC[0][0] =0; } //C37 if ((keysC[1][0] ==0) and (lastC[1][0] ==0)) { MidiSend(noteOff3, 37, velocity); lastC[1][0] =7; } if ((keysC[1][0] ==1) and (lastC[1][0] ==7)) { MidiSend(noteOn3, 37, velocity); lastC[1][0] =0; } //C38 if ((keysC[1][1] ==0) and (lastC[1][1] ==0)) { MidiSend(noteOff3, 38, velocity); lastC[1][1] =7; } //Write Midi Note Off if ((keysC[1][1] ==1) and (lastC[1][1] ==7)) { MidiSend(noteOn3, 38, velocity); lastC[1][1] =0; } //C39 if ((keysC[1][2] ==0) and (lastC[1][2] ==0)) { MidiSend(noteOff3, 39, velocity); lastC[1][2] =7; } //Write Midi Note Off if ((keysC[1][2] ==1) and (lastC[1][2] ==7)) { MidiSend(noteOn3, 39, velocity); lastC[1][2] =0; } //C40 if ((keysC[1][3] ==0) and (lastC[1][3] ==0)) { MidiSend(noteOff3, 40, velocity); lastC[1][3] =7; } //Write Midi Note Off if ((keysC[1][3] ==1) and (lastC[1][3] ==7)) { MidiSend(noteOn3, 40, velocity); lastC[1][3] =0; } //C41 if ((keysC[1][4] ==0) and (lastC[1][4] ==0)) { MidiSend(noteOff3, 41, velocity); lastC[1][4] =7; } //Write Midi Note Off if ((keysC[1][4] ==1) and (lastC[1][4] ==7)) { MidiSend(noteOn3, 41, velocity); lastC[1][4] =0; } //C42 if ((keysC[1][5] ==0) and (lastC[1][5] ==0)) { MidiSend(noteOff3, 42, velocity); lastC[1][5] =7; } //Write Midi Note Off if ((keysC[1][5] ==1) and (lastC[1][5] ==7)) { MidiSend(noteOn3, 42, velocity); lastC[1][5] =0; } //C43 if ((keysC[2][0] ==0) and (lastC[2][0] ==0)) { MidiSend(noteOff3, 43, velocity); lastC[2][0] =7; } //Write Midi Note Off if ((keysC[2][0] ==1) and (lastC[2][0] ==7)) { MidiSend(noteOn3, 43, velocity); lastC[2][0] =0; } //C44 if ((keysC[2][1] ==0) and (lastC[2][1] ==0)) { MidiSend(noteOff3, 44, velocity); lastC[2][1] =7; } //Write Midi Note Off if ((keysC[2][1] ==1) and (lastC[2][1] ==7)) { MidiSend(noteOn3, 44, velocity); lastC[2][1] =0; } //C45 if ((keysC[2][2] ==0) and (lastC[2][2] ==0)) { MidiSend(noteOff3, 45, velocity); lastC[2][2] =7; } //Write Midi Note Off if ((keysC[2][2] ==1) and (lastC[2][2] ==7)) { MidiSend(noteOn3, 45, velocity); lastC[2][2] =0; } //C46 if ((keysC[2][3] ==0) and (lastC[2][3] ==0)) { MidiSend(noteOff3, 46, velocity); lastC[2][3] =7; } //Write Midi Note Off if ((keysC[2][3] ==1) and (lastC[2][3] ==7)) { MidiSend(noteOn3, 46, velocity); lastC[2][3] =0; } //C47 if ((keysC[2][4] ==0) and (lastC[2][4] ==0)) { MidiSend(noteOff3, 47, velocity); lastC[2][4] =7; } //Write Midi Note Off if ((keysC[2][4] ==1) and (lastC[2][4] ==7)) { MidiSend(noteOn3, 47, velocity); lastC[2][4] =0; } //C48 if ((keysC[2][5] ==0) and (lastC[2][5] ==0)) { MidiSend(noteOff3, 48, velocity); lastC[2][5] =7; } //Write Midi Note Off if ((keysC[2][5] ==1) and (lastC[2][5] ==7)) { MidiSend(noteOn3, 48, velocity); lastC[2][5] =0; } //C49 if ((keysC[3][0] ==0) and (lastC[3][0] ==0)) { MidiSend(noteOff3, 49, velocity); lastC[3][0] =7; } //Write Midi Note Off if ((keysC[3][0] ==1) and (lastC[3][0] ==7)) { MidiSend(noteOn3, 49, velocity); lastC[3][0] =0; } //C50 if ((keysC[3][1] ==0) and (lastC[3][1] ==0)) { MidiSend(noteOff3, 50, velocity); lastC[3][1] =7; } //Write Midi Note Off if ((keysC[3][1] ==1) and (lastC[3][1] ==7)) { MidiSend(noteOn3, 50, velocity); lastC[3][1] =0; } //C51 if ((keysC[3][2] ==0) and (lastC[3][2] ==0)) { MidiSend(noteOff3, 51, velocity); lastC[3][2] =7; } //Write Midi Note Off if ((keysC[3][2] ==1) and (lastC[3][2] ==7)) { MidiSend(noteOn3, 51, velocity); lastC[3][2] =0; } //C52 if ((keysC[3][3] ==0) and (lastC[3][3] ==0)) { MidiSend(noteOff3, 52, velocity); lastC[3][3] =7; } //Write Midi Note Off if ((keysC[3][3] ==1) and (lastC[3][3] ==7)) { MidiSend(noteOn3, 52, velocity); lastC[3][3] =0; } //C53 if ((keysC[3][4] ==0) and (lastC[3][4] ==0)) { MidiSend(noteOff3, 53, velocity); lastC[3][4] =7; } //Write Midi Note Off if ((keysC[3][4] ==1) and (lastC[3][4] ==7)) { MidiSend(noteOn3, 53, velocity); lastC[3][4] =0; } //C54 if ((keysC[3][5] ==0) and (lastC[3][5] ==0)) { MidiSend(noteOff3, 54, velocity); lastC[3][5] =7; } //Write Midi Note Off if ((keysC[3][5] ==1) and (lastC[3][5] ==7)) { MidiSend(noteOn3, 54, velocity); lastC[3][5] =0; } //C55 if ((keysC[4][0] ==0) and (lastC[4][0] ==0)) { MidiSend(noteOff3, 55, velocity); lastC[4][0] =7; } //Write Midi Note Off if ((keysC[4][0] ==1) and (lastC[4][0] ==7)) { MidiSend(noteOn3, 55, velocity); lastC[4][0] =0; } //C56 if ((keysC[4][1] ==0) and (lastC[4][1] ==0)) { MidiSend(noteOff3, 56, velocity); lastC[4][1] =7; } //Write Midi Note Off if ((keysC[4][1] ==1) and (lastC[4][1] ==7)) { MidiSend(noteOn3, 56, velocity); lastC[4][1] =0; } //C57 if ((keysC[4][2] ==0) and (lastC[4][2] ==0)) { MidiSend(noteOff3, 57, velocity); lastC[4][2] =7; } //Write Midi Note Off if ((keysC[4][2] ==1) and (lastC[4][2] ==7)) { MidiSend(noteOn3, 57, velocity); lastC[4][2] =0; } //C58 if ((keysC[4][3] ==0) and (lastC[4][3] ==0)) { MidiSend(noteOff3, 58, velocity); lastC[4][3] =7; } //Write Midi Note Off if ((keysC[4][3] ==1) and (lastC[4][3] ==7)) { MidiSend(noteOn3, 58, velocity); lastC[4][3] =0; } //C59 if ((keysC[4][4] ==0) and (lastC[4][4] ==0)) { MidiSend(noteOff3, 59, velocity); lastC[4][4] =7; } //Write Midi Note Off if ((keysC[4][4] ==1) and (lastC[4][4] ==7)) { MidiSend(noteOn3, 59, velocity); lastC[4][4] =0; } //C60 if ((keysC[4][5] ==0) and (lastC[4][5] ==0)) { MidiSend(noteOff3, 60, velocity); lastC[4][5] =7; } //Write Midi Note Off if ((keysC[4][5] ==1) and (lastC[4][5] ==7)) { MidiSend(noteOn3, 60, velocity); lastC[4][5] =0; } //C61 if ((keysC[5][0] ==0) and (lastC[5][0] ==0)) { MidiSend(noteOff3, 61, velocity); lastC[5][0] =7; } //Write Midi Note Off if ((keysC[5][0] ==1) and (lastC[5][0] ==7)) { MidiSend(noteOn3, 61, velocity); lastC[5][0] =0; } //C62 if ((keysC[5][1] ==0) and (lastC[5][1] ==0)) { MidiSend(noteOff3, 62, velocity); lastC[5][1] =7; } //Write Midi Note Off if ((keysC[5][1] ==1) and (lastC[5][1] ==7)) { MidiSend(noteOn3, 62, velocity); lastC[5][1] =0; } //C63 if ((keysC[5][2] ==0) and (lastC[5][2] ==0)) { MidiSend(noteOff3, 63, velocity); lastC[5][2] =7; } //Write Midi Note Off if ((keysC[5][2] ==1) and (lastC[5][2] ==7)) { MidiSend(noteOn3, 63, velocity); lastC[5][2] =0; } //C64 if ((keysC[5][3] ==0) and (lastC[5][3] ==0)) { MidiSend(noteOff3, 64, velocity); lastC[5][3] =7; } //Write Midi Note Off if ((keysC[5][3] ==1) and (lastC[5][3] ==7)) { MidiSend(noteOn3, 64, velocity); lastC[5][3] =0; } //C65 if ((keysC[5][4] ==0) and (lastC[5][4] ==0)) { MidiSend(noteOff3, 65, velocity); lastC[5][4] =7; } //Write Midi Note Off if ((keysC[5][4] ==1) and (lastC[5][4] ==7)) { MidiSend(noteOn3, 65, velocity); lastC[5][4] =0; } //C66 if ((keysC[5][5] ==0) and (lastC[5][5] ==0)) { MidiSend(noteOff3, 66, velocity); lastC[5][5] =7; } //Write Midi Note Off if ((keysC[5][5] ==1) and (lastC[5][5] ==7)) { MidiSend(noteOn3, 66, velocity); lastC[5][5] =0; } //C67 if ((keysC[6][0] ==0) and (lastC[6][0] ==0)) { MidiSend(noteOff3, 67, velocity); lastC[6][0] =7; } //Write Midi Note Off if ((keysC[6][0] ==1) and (lastC[6][0] ==7)) { MidiSend(noteOn3, 67, velocity); lastC[6][0] =0; } //Expression pedal on analog pin 0 to Channel 6 int Cur6 =analogRead(0); int Map6 =map(Cur6, 0, 1023, 0, 127); if (abs(Cur6 - LastPot6)>=8) { MidiSend(chan6,Exp,Map6); LastPot6 =Cur6; } //Expression pedal on analog pin 1 to Channel 7 int Cur7 =analogRead(1); int Map7 =map(Cur7, 0, 1023, 0, 127); if (abs(Cur7 - LastPot7)>=8) { MidiSend(chan7,Exp,Map7); LastPot7 =Cur7; } }void MidiSend(int one, int two, int three) { Serial.write(one); Serial.write(two); Serial.write(three); }
Bussed Keyboard CodeArduino
Code to upload to the Arduino if you are following the Bussed Keyboard Schematic.
// Name:Arduino Mega Midi Controller 61x4 plus 3 potentiometers.// Version 1.0// Created:April 12, 2021// Author:Larason2// Acknowledgements:Bald Engineer, Amanda Ghassaei, jeffb42, GrumpyMike//Note Databyte keysA[11][6];byte keysB[11][6];byte keysC[11][6];byte keysD[11][6];//Last Key Statebyte lastA[11][6];byte lastB[11][6];byte lastC[11][6];byte lastD[11][6];//Midi Messages Sentint noteOn1 =144;int noteOff1 =128;int noteOn2 =145;int noteOff2 =129;int noteOn3 =146;int noteOff3 =130;int noteOn4 =147;int noteOff4 =131;int velocity =100;int chan6 =181;int chan7 =182;int chan8 =183;int Exp =11;//Last Potentiometer Stateint LastPot6 =1;int LastPot7 =1;int LastPot8 =1;void setup() { // Start Serial at Midi rate Serial.begin(31250); //Initialize Pins 1-10 pinMode(2, INPUT); pinMode(3, INPUT); pinMode(4, INPUT); pinMode(5, INPUT); pinMode(6, INPUT); pinMode(7, INPUT); pinMode(8, INPUT); pinMode(9, INPUT); pinMode(10, INPUT); pinMode(11, INPUT); //Pins 11-20 pinMode(12, INPUT); pinMode(13, INPUT); pinMode(14, INPUT); pinMode(15, INPUT); pinMode(16, INPUT); pinMode(17, INPUT); pinMode(18, INPUT); pinMode(19, INPUT); pinMode(20, INPUT); pinMode(21, INPUT); //Pins 21-30 pinMode(22, INPUT); pinMode(23, INPUT); pinMode(24, INPUT); pinMode(25, INPUT); pinMode(26, INPUT); pinMode(27, INPUT); pinMode(28, INPUT); pinMode(29, INPUT); pinMode(30, INPUT); pinMode(31, INPUT); //Pins 31-40 pinMode(32, INPUT); pinMode(33, INPUT); pinMode(34, INPUT); pinMode(35, INPUT); pinMode(36, INPUT); pinMode(37, INPUT); pinMode(38, INPUT); pinMode(39, INPUT); pinMode(40, INPUT); pinMode(41, INPUT); //Pins 41-50 pinMode(42, INPUT); pinMode(43, INPUT); pinMode(44, INPUT); pinMode(45, INPUT); pinMode(46, INPUT); pinMode(47, INPUT); pinMode(48, INPUT); pinMode(49, INPUT); pinMode(50, INPUT); pinMode(51, INPUT); //Pins 51-61 pinMode(52, INPUT); pinMode(53, INPUT); pinMode(A0, INPUT); pinMode(A1, INPUT); pinMode(A2, INPUT); pinMode(A3, INPUT); pinMode(A4, INPUT); pinMode(A5, INPUT); pinMode(A6, INPUT); pinMode (A7, ENTRÉE); pinMode(A8, INPUT); //Column Pins pinMode(A9, INPUT); pinMode(A10, INPUT); pinMode(A11, INPUT); pinMode(A12, INPUT); //Pot Pins pinMode(A13, INPUT); pinMode(A14, INPUT); pinMode(A15, INPUT);}void loop() { // Setup pins for keyboards //Pins 1-10 pinMode(2, INPUT_PULLUP); pinMode(3, INPUT_PULLUP); pinMode(4, INPUT_PULLUP); pinMode(5, INPUT_PULLUP); pinMode(6, INPUT_PULLUP); pinMode(7, INPUT_PULLUP); pinMode(8, INPUT_PULLUP); pinMode(9, INPUT_PULLUP); pinMode(10, INPUT_PULLUP); pinMode(11, INPUT_PULLUP); //Pins 11-20 pinMode(12, INPUT_PULLUP); pinMode(13, INPUT_PULLUP); pinMode(14, INPUT_PULLUP); pinMode(15, INPUT_PULLUP); pinMode(16, INPUT_PULLUP); pinMode(17, INPUT_PULLUP); pinMode(18, INPUT_PULLUP); pinMode(19, INPUT_PULLUP); pinMode(20, INPUT_PULLUP); pinMode(21, INPUT_PULLUP); //Pins 21-30 pinMode(22, INPUT_PULLUP); pinMode(23, INPUT_PULLUP); pinMode(24, INPUT_PULLUP); pinMode(25, INPUT_PULLUP); pinMode(26, INPUT_PULLUP); pinMode(27, INPUT_PULLUP); pinMode(28, INPUT_PULLUP); pinMode(29, INPUT_PULLUP); pinMode(30, INPUT_PULLUP); pinMode(31, INPUT_PULLUP); //Pins 31-40 pinMode(32, INPUT_PULLUP); pinMode(33, INPUT_PULLUP); pinMode(34, INPUT_PULLUP); pinMode(35, INPUT_PULLUP); pinMode(36, INPUT_PULLUP); pinMode(37, INPUT_PULLUP); pinMode(38, INPUT_PULLUP); pinMode(39, INPUT_PULLUP); pinMode(40, INPUT_PULLUP); pinMode(41, INPUT_PULLUP); //Pins 41-50 pinMode(42, INPUT_PULLUP); pinMode(43, INPUT_PULLUP); pinMode(44, INPUT_PULLUP); pinMode(45, INPUT_PULLUP); pinMode(46, INPUT_PULLUP); pinMode(47, INPUT_PULLUP); pinMode(48, INPUT_PULLUP); pinMode(49, INPUT_PULLUP); pinMode(50, INPUT_PULLUP); pinMode(51, INPUT_PULLUP); //Pins 51-61 pinMode(52, INPUT_PULLUP); pinMode(53, INPUT_PULLUP); pinMode(A0, INPUT_PULLUP); pinMode(A1, INPUT_PULLUP); pinMode(A2, INPUT_PULLUP); pinMode(A3, INPUT_PULLUP); pinMode(A4, INPUT_PULLUP); pinMode(A5, INPUT_PULLUP); pinMode(A6, INPUT_PULLUP); pinMode(A7, INPUT_PULLUP); pinMode(A8, INPUT_PULLUP); //Read Keyboard A pinMode(A9, OUTPUT); digitalWrite(A9, LOW); //Keys 1-10 keysA[0][0] =digitalRead(2); keysA[1][0] =digitalRead(3); keysA[1][1] =digitalRead(4); keysA[1][2] =digitalRead(5); keysA[1][3] =digitalRead(6); keysA[1][4] =digitalRead(7); keysA[1][5] =digitalRead(8); keysA[2][0] =digitalRead(9); keysA[2][1] =digitalRead(10); keysA[2][2] =digitalRead(11); //Keys 11-20 keysA[2][3] =digitalRead(12); keysA[2][4] =digitalRead(13); keysA[2][5] =digitalRead(14); keysA[3][0] =digitalRead(15); keysA[3][1] =digitalRead(16); keysA[3][2] =digitalRead(17); keysA[3][3] =digitalRead(18); keysA[3][4] =digitalRead(19); keysA[3][5] =digitalRead(20); keysA[4][0] =digitalRead(21); //Keys 21-30 keysA[4][1] =digitalRead(22); keysA[4][2] =digitalRead(23); keysA[4][3] =digitalRead(24); keysA[4][4] =digitalRead(25); keysA[4][5] =digitalRead(26); keysA[5][0] =digitalRead(27); keysA[5][1] =digitalRead(28); keysA[5][2] =digitalRead(29); keysA[5][3] =digitalRead(30); keysA[5][4] =digitalRead(31); //Keys 31-40 keysA[5][5] =digitalRead(32); keysA[6][0] =digitalRead(33); keysA[6][1] =digitalRead(34); keysA[6][2] =digitalRead(35); keysA[6][3] =digitalRead(36); keysA[6][4] =digitalRead(37); keysA[6][5] =digitalRead(38); keysA[7][0] =digitalRead(39); keysA[7][1] =digitalRead(40); keysA[7][2] =digitalRead(41); //Keys 41-50 keysA[7][3] =digitalRead(42); keysA[7][4] =digitalRead(43); keysA[7][5] =digitalRead(44); keysA[8][0] =digitalRead(45); keysA[8][1] =digitalRead(46); keysA[8][2] =digitalRead(47); keysA[8][3] =digitalRead(48); keysA[8][4] =digitalRead(49); keysA[8][5] =digitalRead(50); keysA[9][0] =digitalRead(51); //Keys 51-61 keysA[9][1] =digitalRead(52); keysA[9][2] =digitalRead(53); keysA[9][3] =digitalRead(A0); keysA[9][4] =digitalRead(A1); keysA[9][5] =digitalRead(A2); keysA[10][0] =digitalRead(A3); keysA[10][1] =digitalRead(A4); keysA[10][2] =digitalRead(A5); keysA[10][3] =digitalRead(A6); keysA[10][4] =digitalRead(A7); keysA[10][5] =digitalRead(A8); pinMode(A9, INPUT); // Read Keyboard B pinMode(A10, OUTPUT); digitalWrite(A10, LOW); //Keys 1-10 keysB[0][0] =digitalRead(2); keysB[1][0] =digitalRead(3); keysB[1][1] =digitalRead(4); keysB[1][2] =digitalRead(5); keysB[1][3] =digitalRead(6); keysB[1][4] =digitalRead(7); keysB[1][5] =digitalRead(8); keysB[2][0] =digitalRead(9); keysB[2][1] =digitalRead(10); keysB[2][2] =digitalRead(11); //Keys 11-20 keysB[2][3] =digitalRead(12); keysB[2][4] =digitalRead(13); keysB[2][5] =digitalRead(14); keysB[3][0] =digitalRead(15); keysB[3][1] =digitalRead(16); keysB[3][2] =digitalRead(17); keysB[3][3] =digitalRead(18); keysB[3][4] =digitalRead(19); keysB[3][5] =digitalRead(20); keysB[4][0] =digitalRead(21); //Keys 21-30 keysB[4][1] =digitalRead(22); keysB[4][2] =digitalRead(23); keysB[4][3] =digitalRead(24); keysB[4][4] =digitalRead(25); keysB[4][5] =digitalRead(26); keysB[5][0] =digitalRead(27); keysB[5][1] =digitalRead(28); keysB[5][2] =digitalRead(29); keysB[5][3] =digitalRead(30); keysB[5][4] =digitalRead(31); //Keys 31-40 keysB[5][5] =digitalRead(32); keysB[6][0] =digitalRead(33); keysB[6][1] =digitalRead(34); keysB[6][2] =digitalRead(35); keysB[6][3] =digitalRead(36); keysB[6][4] =digitalRead(37); keysB[6][5] =digitalRead(38); keysB[7][0] =digitalRead(39); keysB[7][1] =digitalRead(40); keysB[7][2] =digitalRead(41); //Keys 41-50 keysB[7][3] =digitalRead(42); keysB[7][4] =digitalRead(43); keysB[7][5] =digitalRead(44); keysB[8][0] =digitalRead(45); keysB[8][1] =digitalRead(46); keysB[8][2] =digitalRead(47); keysB[8][3] =digitalRead(48); keysB[8][4] =digitalRead(49); keysB[8][5] =digitalRead(50); keysB[9][0] =digitalRead(51); //Keys 51-61 keysB[9][1] =digitalRead(52); keysB[9][2] =digitalRead(53); keysB[9][3] =digitalRead(A0); keysB[9][4] =digitalRead(A1); keysB[9][5] =digitalRead(A2); keysB[10][0] =digitalRead(A3); keysB[10][1] =digitalRead(A4); keysB[10][2] =digitalRead(A5); keysB[10][3] =digitalRead(A6); keysB[10][4] =digitalRead(A7); keysB[10][5] =digitalRead(A8); pinMode(A10, INPUT); // Read Keyboard C pinMode(A11, OUTPUT); digitalWrite(A11, LOW); //Keys 1-10 keysC[0][0] =digitalRead(2); keysC[1][0] =digitalRead(3); keysC[1][1] =digitalRead(4); keysC[1][2] =digitalRead(5); keysC[1][3] =digitalRead(6); keysC[1][4] =digitalRead(7); keysC[1][5] =digitalRead(8); keysC[2][0] =digitalRead(9); keysC[2][1] =digitalRead(10); keysC[2][2] =digitalRead(11); //Keys 11-20 keysC[2][3] =digitalRead(12); keysC[2][4] =digitalRead(13); keysC[2][5] =digitalRead(14); keysC[3][0] =digitalRead(15); keysC[3][1] =digitalRead(16); keysC[3][2] =digitalRead(17); keysC[3][3] =digitalRead(18); keysC[3][4] =digitalRead(19); keysC[3][5] =digitalRead(20); keysC[4][0] =digitalRead(21); //Keys 21-30 keysC[4][1] =digitalRead(22); keysC[4][2] =digitalRead(23); keysC[4][3] =digitalRead(24); keysC[4][4] =digitalRead(25); keysC[4][5] =digitalRead(26); keysC[5][0] =digitalRead(27); keysC[5][1] =digitalRead(28); keysC[5][2] =digitalRead(29); keysC[5][3] =digitalRead(30); keysC[5][4] =digitalRead(31); //Keys 31-40 keysC[5][5] =digitalRead(32); keysC[6][0] =digitalRead(33); keysC[6][1] =digitalRead(34); keysC[6][2] =digitalRead(35); keysC[6][3] =digitalRead(36); keysC[6][4] =digitalRead(37); keysC[6][5] =digitalRead(38); keysC[7][0] =digitalRead(39); keysC[7][1] =digitalRead(40); keysC[7][2] =digitalRead(41); //Keys 41-50 keysC[7][3] =digitalRead(42); keysC[7][4] =digitalRead(43); keysC[7][5] =digitalRead(44); keysC[8][0] =digitalRead(45); keysC[8][1] =digitalRead(46); keysC[8][2] =digitalRead(47); keysC[8][3] =digitalRead(48); keysC[8][4] =digitalRead(49); keysC[8][5] =digitalRead(50); keysC[9][0] =digitalRead(51); //Keys 51-61 keysC[9][1] =digitalRead(52); keysC[9][2] =digitalRead(53); keysC[9][3] =digitalRead(A0); keysC[9][4] =digitalRead(A1); keysC[9][5] =digitalRead(A2); keysC[10][0] =digitalRead(A3); keysC[10][1] =digitalRead(A4); keysC[10][2] =digitalRead(A5); keysC[10][3] =digitalRead(A6); keysC[10][4] =digitalRead(A7); keysC[10][5] =digitalRead(A8); pinMode(A11, INPUT); // Read Keyboard D pinMode(A12, OUTPUT); digitalWrite(A12, LOW); //Keys 1-10 keysD[0][0] =digitalRead(2); keysD[1][0] =digitalRead(3); keysD[1][1] =digitalRead(4); keysD[1][2] =digitalRead(5); keysD[1][3] =digitalRead(6); keysD[1][4] =digitalRead(7); keysD[1][5] =digitalRead(8); keysD[2][0] =digitalRead(9); keysD[2][1] =digitalRead(10); keysD[2][2] =digitalRead(11); //Keys 11-20 keysD[2][3] =digitalRead(12); keysD[2][4] =digitalRead(13); keysD[2][5] =digitalRead(14); keysD[3][0] =digitalRead(15); keysD[3][1] =digitalRead(16); keysD[3][2] =digitalRead(17); keysD[3][3] =digitalRead(18); keysD[3][4] =digitalRead(19); keysD[3][5] =digitalRead(20); keysD[4][0] =digitalRead(21); //Keys 21-30 keysD[4][1] =digitalRead(22); keysD[4][2] =digitalRead(23); keysD[4][3] =digitalRead(24); keysD[4][4] =digitalRead(25); keysD[4][5] =digitalRead(26); keysD[5][0] =digitalRead(27); keysD[5][1] =digitalRead(28); keysD[5][2] =digitalRead(29); keysD[5][3] =digitalRead(30); keysD[5][4] =digitalRead(31); //Keys 31-40 keysD[5][5] =digitalRead(32); keysD[6][0] =digitalRead(33); keysD[6][1] =digitalRead(34); keysD[6][2] =digitalRead(35); keysD[6][3] =digitalRead(36); keysD[6][4] =digitalRead(37); keysD[6][5] =digitalRead(38); keysD[7][0] =digitalRead(39); keysD[7][1] =digitalRead(40); keysD[7][2] =digitalRead(41); //Keys 41-50 keysD[7][3] =digitalRead(42); keysD[7][4] =digitalRead(43); keysD[7][5] =digitalRead(44); keysD[8][0] =digitalRead(45); keysD[8][1] =digitalRead(46); keysD[8][2] =digitalRead(47); keysD[8][3] =digitalRead(48); keysD[8][4] =digitalRead(49); keysD[8][5] =digitalRead(50); keysD[9][0] =digitalRead(51); //Keys 51-61 keysD[9][1] =digitalRead(52); keysD[9][2] =digitalRead(53); keysD[9][3] =digitalRead(A0); keysD[9][4] =digitalRead(A1); keysD[9][5] =digitalRead(A2); keysD[10][0] =digitalRead(A3); keysD[10][1] =digitalRead(A4); keysD[10][2] =digitalRead(A5); keysD[10][3] =digitalRead(A6); keysD[10][4] =digitalRead(A7); keysD[10][5] =digitalRead(A8); pinMode(A12, INPUT); //Return pins to Initialized state //Pins 1-10 pinMode(2, INPUT); pinMode(3, INPUT); pinMode(4, INPUT); pinMode(5, INPUT); pinMode(6, INPUT); pinMode(7, INPUT); pinMode(8, INPUT); pinMode(9, INPUT); pinMode(10, INPUT); pinMode(11, INPUT); //Pins 11-20 pinMode(12, INPUT); pinMode(13, INPUT); pinMode(14, INPUT); pinMode(15, INPUT); pinMode(16, INPUT); pinMode(17, INPUT); pinMode(18, INPUT); pinMode(19, INPUT); pinMode(20, INPUT); pinMode(21, INPUT); //Pins 21-30 pinMode(22, INPUT); pinMode(23, INPUT); pinMode(24, INPUT); pinMode(25, INPUT); pinMode(26, INPUT); pinMode(27, INPUT); pinMode(28, INPUT); pinMode(29, INPUT); pinMode(30, INPUT); pinMode(31, INPUT); //Pins 31-40 pinMode(32, INPUT); pinMode(33, INPUT); pinMode(34, INPUT); pinMode(35, INPUT); pinMode(36, INPUT); pinMode(37, INPUT); pinMode(38, INPUT); pinMode(39, INPUT); pinMode(40, INPUT); pinMode(41, INPUT); //Pins 41-50 pinMode(42, INPUT); pinMode(43, INPUT); pinMode(44, INPUT); pinMode(45, INPUT); pinMode(46, INPUT); pinMode(47, INPUT); pinMode(48, INPUT); pinMode(49, INPUT); pinMode(50, INPUT); pinMode(51, INPUT); //Pins 51-61 pinMode(52, INPUT); pinMode(53, INPUT); pinMode(A0, INPUT); pinMode(A1, INPUT); pinMode(A2, INPUT); pinMode(A3, INPUT); pinMode(A4, INPUT); pinMode(A5, INPUT); pinMode(A6, INPUT); pinMode (A7, ENTRÉE); pinMode(A8, INPUT); //Column Pins pinMode(A9, INPUT); pinMode(A10, INPUT); pinMode(A11, INPUT); pinMode(A12, INPUT); //Pot Pins pinMode(A13, INPUT); pinMode(A14, INPUT); pinMode(A15, INPUT); /* //Invert Keyboard data only if needed. //Example only for 32 pedals of a pedalboard, first 32 keys of keyboard C. //Column 1 if (keysC[0][0] ==0) { keysC[0][0] =1; } else if (keysC[0][0] ==1) { keysC[0][0] =0; } //Column 2 if (keysC[1][0] ==0) { keysC[1][0] =1; } else if (keysC[1][0] ==1) { keysC[1][0] =0; } if (keysC[1][1] ==0) { keysC[1][1] =1; } else if (keysC[1][1] ==1) { keysC[1][1] =0; } if (keysC[1][2] ==0) { keysC[1][2] =1; } else if (keysC[1][2] ==1) { keysC[1][2] =0; } if (keysC[1][3] ==0) { keysC[1][3] =1; } else if (keysC[1][3] ==1) { keysC[1][3] =0; } if (keysC[1][4] ==0) { keysC[1][4] =1; } else if (keysC[1][4] ==1) { keysC[1][4] =0; } if (keysC[1][5] ==0) { keysC[1][5] =1; } else if (keysC[1][5] ==1) { keysC[1][5] =0; } //Column 3 if (keysC[2][0] ==0) { keysC[2][0] =1; } else if (keysC[2][0] ==1) { keysC[2][0] =0; } if (keysC[2][1] ==0) { keysC[2][1] =1; } else if (keysC[2][1] ==1) { keysC[2][1] =0; } if (keysC[2][2] ==0) { keysC[2][2] =1; } else if (keysC[2][2] ==1) { keysC[2][2] =0; } if (keysC[2][3] ==0) { keysC[2][3] =1; } else if (keysC[2][3] ==1) { keysC[2][3] =0; } if (keysC[2][4] ==0) { keysC[2][4] =1; } else if (keysC[2][4] ==1) { keysC[2][4] =0; } if (keysC[2][5] ==0) { keysC[2][5] =1; } else if (keysC[2][5] ==1) { keysC[2][5] =0; } //Column 4 if (keysC[3][0] ==0) { keysC[3][0] =1; } else if (keysC[3][0] ==1) { keysC[3][0] =0; } if (keysC[3][1] ==0) { keysC[3][1] =1; } else if (keysC[3][1] ==1) { keysC[3][1] =0; } if (keysC[3][2] ==0) { keysC[3][2] =1; } else if (keysC[3][2] ==1) { keysC[3][2] =0; } if (keysC[3][3] ==0) { keysC[3][3] =1; } else if (keysC[3][3] ==1) { keysC[3][3] =0; } if (keysC[3][4] ==0) { keysC[3][4] =1; } else if (keysC[3][4] ==1) { keysC[3][4] =0; } if (keysC[3][5] ==0) { keysC[3][5] =1; } else if (keysC[3][5] ==1) { keysC[3][5] =0; } //Column 5 if (keysC[4][0] ==0) { keysC[4][0] =1; } else if (keysC[4][0] ==1) { keysC[4][0] =0; } if (keysC[4][1] ==0) { keysC[4][1] =1; } else if (keysC[4][1] ==1) { keysC[4][1] =0; } if (keysC[4][2] ==0) { keysC[4][2] =1; } else if (keysC[4][2] ==1) { keysC[4][2] =0; } if (keysC[4][3] ==0) { keysC[4][3] =1; } else if (keysC[4][3] ==1) { keysC[4][3] =0; } if (keysC[4][4] ==0) { keysC[4][4] =1; } else if (keysC[4][4] ==1) { keysC[4][4] =0; } if (keysC[4][5] ==0) { keysC[4][5] =1; } else if (keysC[4][5] ==1) { keysC[4][5] =0; } //Column 6 if (keysC[5][0] ==0) { keysC[5][0] =1; } else if (keysC[5][0] ==1) { keysC[5][0] =0; } if (keysC[5][1] ==0) { keysC[5][1] =1; } else if (keysC[5][1] ==1) { keysC[5][1] =0; } if (keysC[5][2] ==0) { keysC[5][2] =1; } else if (keysC[5][2] ==1) { keysC[5][2] =0; } if (keysC[5][3] ==0) { keysC[5][3] =1; } else if (keysC[5][3] ==1) { keysC[5][3] =0; } if (keysC[5][4] ==0) { keysC[5][4] =1; } else if (keysC[5][4] ==1) { keysC[5][4] =0; } if (keysC[5][5] ==0) { keysC[5][5] =1; } else if (keysC[5][5] ==1) { keysC[5][5] =0; } //Column 7 if (keysC[6][0] ==0) { keysC[6][0] =1; } else if (keysC[6][0] ==1) { keysC[6][0] =0; } */ //Write Keyboard A //A36 if ((keysA[0][0] ==0) and (lastA[0][0] ==0)) { MidiSend(noteOn1, 36, velocity); lastA[0][0] =7; } if ((keysA[0][0] ==1) and (lastA[0][0] ==7)) { MidiSend(noteOff1, 36, velocity); lastA[0][0] =0; } //A37 if ((keysA[1][0] ==0) and (lastA[1][0] ==0)) { MidiSend(noteOn1, 37, velocity); lastA[1][0] =7; } if ((keysA[1][0] ==1) and (lastA[1][0] ==7)) { MidiSend(noteOff1, 37, velocity); lastA[1][0] =0; } //A38 if ((keysA[1][1] ==0) and (lastA[1][1] ==0)) { MidiSend(noteOn1, 38, velocity); lastA[1][1] =7; } //Write Midi Note Off if ((keysA[1][1] ==1) and (lastA[1][1] ==7)) { MidiSend(noteOff1, 38, velocity); lastA[1][1] =0; } //A39 if ((keysA[1][2] ==0) and (lastA[1][2] ==0)) { MidiSend(noteOn1, 39, velocity); lastA[1][2] =7; } //Write Midi Note Off if ((keysA[1][2] ==1) and (lastA[1][2] ==7)) { MidiSend(noteOff1, 39, velocity); lastA[1][2] =0; } //A40 if ((keysA[1][3] ==0) and (lastA[1][3] ==0)) { MidiSend(noteOn1, 40, velocity); lastA[1][3] =7; } //Write Midi Note Off if ((keysA[1][3] ==1) and (lastA[1][3] ==7)) { MidiSend(noteOff1, 40, velocity); lastA[1][3] =0; } //A41 if ((keysA[1][4] ==0) and (lastA[1][4] ==0)) { MidiSend(noteOn1, 41, velocity); lastA[1][4] =7; } //Write Midi Note Off if ((keysA[1][4] ==1) and (lastA[1][4] ==7)) { MidiSend(noteOff1, 41, velocity); lastA[1][4] =0; } //A42 if ((keysA[1][5] ==0) and (lastA[1][5] ==0)) { MidiSend(noteOn1, 42, velocity); lastA[1][5] =7; } //Write Midi Note Off if ((keysA[1][5] ==1) and (lastA[1][5] ==7)) { MidiSend(noteOff1, 42, velocity); lastA[1][5] =0; } //A43 if ((keysA[2][0] ==0) and (lastA[2][0] ==0)) { MidiSend(noteOn1, 43, velocity); lastA[2][0] =7; } //Write Midi Note Off if ((keysA[2][0] ==1) and (lastA[2][0] ==7)) { MidiSend(noteOff1, 43, velocity); lastA[2][0] =0; } //A44 if ((keysA[2][1] ==0) and (lastA[2][1] ==0)) { MidiSend(noteOn1, 44, velocity); lastA[2][1] =7; } //Write Midi Note Off if ((keysA[2][1] ==1) and (lastA[2][1] ==7)) { MidiSend(noteOff1, 44, velocity); lastA[2][1] =0; } //A45 if ((keysA[2][2] ==0) and (lastA[2][2] ==0)) { MidiSend(noteOn1, 45, velocity); lastA[2][2] =7; } //Write Midi Note Off if ((keysA[2][2] ==1) and (lastA[2][2] ==7)) { MidiSend(noteOff1, 45, velocity); lastA[2][2] =0; } //A46 if ((keysA[2][3] ==0) and (lastA[2][3] ==0)) { MidiSend(noteOn1, 46, velocity); lastA[2][3] =7; } //Write Midi Note Off if ((keysA[2][3] ==1) and (lastA[2][3] ==7)) { MidiSend(noteOff1, 46, velocity); lastA[2][3] =0; } //A47 if ((keysA[2][4] ==0) and (lastA[2][4] ==0)) { MidiSend(noteOn1, 47, velocity); lastA[2][4] =7; } //Write Midi Note Off if ((keysA[2][4] ==1) and (lastA[2][4] ==7)) { MidiSend(noteOff1, 47, velocity); lastA[2][4] =0; } //A48 if ((keysA[2][5] ==0) and (lastA[2][5] ==0)) { MidiSend(noteOn1, 48, velocity); lastA[2][5] =7; } //Write Midi Note Off if ((keysA[2][5] ==1) and (lastA[2][5] ==7)) { MidiSend(noteOff1, 48, velocity); lastA[2][5] =0; } //A49 if ((keysA[3][0] ==0) and (lastA[3][0] ==0)) { MidiSend(noteOn1, 49, velocity); lastA[3][0] =7; } //Write Midi Note Off if ((keysA[3][0] ==1) and (lastA[3][0] ==7)) { MidiSend(noteOff1, 49, velocity); lastA[3][0] =0; } //A50 if ((keysA[3][1] ==0) and (lastA[3][1] ==0)) { MidiSend(noteOn1, 50, velocity); lastA[3][1] =7; } //Write Midi Note Off if ((keysA[3][1] ==1) and (lastA[3][1] ==7)) { MidiSend(noteOff1, 50, velocity); lastA[3][1] =0; } //A51 if ((keysA[3][2] ==0) and (lastA[3][2] ==0)) { MidiSend(noteOn1, 51, velocity); lastA[3][2] =7; } //Write Midi Note Off if ((keysA[3][2] ==1) and (lastA[3][2] ==7)) { MidiSend(noteOff1, 51, velocity); lastA[3][2] =0; } //A52 if ((keysA[3][3] ==0) and (lastA[3][3] ==0)) { MidiSend(noteOn1, 52, velocity); lastA[3][3] =7; } //Write Midi Note Off if ((keysA[3][3] ==1) and (lastA[3][3] ==7)) { MidiSend(noteOff1, 52, velocity); lastA[3][3] =0; } //A53 if ((keysA[3][4] ==0) and (lastA[3][4] ==0)) { MidiSend(noteOn1, 53, velocity); lastA[3][4] =7; } //Write Midi Note Off if ((keysA[3][4] ==1) and (lastA[3][4] ==7)) { MidiSend(noteOff1, 53, velocity); lastA[3][4] =0; } //A54 if ((keysA[3][5] ==0) and (lastA[3][5] ==0)) { MidiSend(noteOn1, 54, velocity); lastA[3][5] =7; } //Write Midi Note Off if ((keysA[3][5] ==1) and (lastA[3][5] ==7)) { MidiSend(noteOff1, 54, velocity); lastA[3][5] =0; } //A55 if ((keysA[4][0] ==0) and (lastA[4][0] ==0)) { MidiSend(noteOn1, 55, velocity); lastA[4][0] =7; } //Write Midi Note Off if ((keysA[4][0] ==1) and (lastA[4][0] ==7)) { MidiSend(noteOff1, 55, velocity); lastA[4][0] =0; } //A56 if ((keysA[4][1] ==0) and (lastA[4][1] ==0)) { MidiSend(noteOn1, 56, velocity); lastA[4][1] =7; } //Write Midi Note Off if ((keysA[4][1] ==1) and (lastA[4][1] ==7)) { MidiSend(noteOff1, 56, velocity); lastA[4][1] =0; } //A57 if ((keysA[4][2] ==0) and (lastA[4][2] ==0)) { MidiSend(noteOn1, 57, velocity); lastA[4][2] =7; } //Write Midi Note Off if ((keysA[4][2] ==1) and (lastA[4][2] ==7)) { MidiSend(noteOff1, 57, velocity); lastA[4][2] =0; } //A58 if ((keysA[4][3] ==0) and (lastA[4][3] ==0)) { MidiSend(noteOn1, 58, velocity); lastA[4][3] =7; } //Write Midi Note Off if ((keysA[4][3] ==1) and (lastA[4][3] ==7)) { MidiSend(noteOff1, 58, velocity); lastA[4][3] =0; } //59 if ((keysA[4][4] ==0) and (lastA[4][4] ==0)) { MidiSend(noteOn1, 59, velocity); lastA[4][4] =7; } //Write Midi Note Off if ((keysA[4][4] ==1) and (lastA[4][4] ==7)) { MidiSend(noteOff1, 59, velocity); lastA[4][4] =0; } //A60 if ((keysA[4][5] ==0) and (lastA[4][5] ==0)) { MidiSend(noteOn1, 60, velocity); lastA[4][5] =7; } //Write Midi Note Off if ((keysA[4][5] ==1) and (lastA[4][5] ==7)) { MidiSend(noteOff1, 60, velocity); lastA[4][5] =0; } //A61 if ((keysA[5][0] ==0) and (lastA[5][0] ==0)) { MidiSend(noteOn1, 61, velocity); lastA[5][0] =7; } //Write Midi Note Off if ((keysA[5][0] ==1) and (lastA[5][0] ==7)) { MidiSend(noteOff1, 61, velocity); lastA[5][0] =0; } //A62 if ((keysA[5][1] ==0) and (lastA[5][1] ==0)) { MidiSend(noteOn1, 62, velocity); lastA[5][1] =7; } //Write Midi Note Off if ((keysA[5][1] ==1) and (lastA[5][1] ==7)) { MidiSend(noteOff1, 62, velocity); lastA[5][1] =0; } //A63 if ((keysA[5][2] ==0) and (lastA[5][2] ==0)) { MidiSend(noteOn1, 63, velocity); lastA[5][2] =7; } //Write Midi Note Off if ((keysA[5][2] ==1) and (lastA[5][2] ==7)) { MidiSend(noteOff1, 63, velocity); lastA[5][2] =0; } //A64 if ((keysA[5][3] ==0) and (lastA[5][3] ==0)) { MidiSend(noteOn1, 64, velocity); lastA[5][3] =7; } //Write Midi Note Off if ((keysA[5][3] ==1) and (lastA[5][3] ==7)) { MidiSend(noteOff1, 64, velocity); lastA[5][3] =0; } //A65 if ((keysA[5][4] ==0) and (lastA[5][4] ==0)) { MidiSend(noteOn1, 65, velocity); lastA[5][4] =7; } //Write Midi Note Off if ((keysA[5][4] ==1) and (lastA[5][4] ==7)) { MidiSend(noteOff1, 65, velocity); lastA[5][4] =0; } //A66 if ((keysA[5][5] ==0) and (lastA[5][5] ==0)) { MidiSend(noteOn1, 66, velocity); lastA[5][5] =7; } //Write Midi Note Off if ((keysA[5][5] ==1) and (lastA[5][5] ==7)) { MidiSend(noteOff1, 66, velocity); lastA[5][5] =0; } //A67 if ((keysA[6][0] ==0) and (lastA[6][0] ==0)) { MidiSend(noteOn1, 67, velocity); lastA[6][0] =7; } //Write Midi Note Off if ((keysA[6][0] ==1) and (lastA[6][0] ==7)) { MidiSend(noteOff1, 67, velocity); lastA[6][0] =0; } //A68 if ((keysA[6][1] ==0) and (lastA[6][1] ==0)) { MidiSend(noteOn1, 68, velocity); lastA[6][1] =7; } //Write Midi Note Off if ((keysA[6][1] ==1) and (lastA[6][1] ==7)) { MidiSend(noteOff1, 68, velocity); lastA[6][1] =0; } //A69 if ((keysA[6][2] ==0) and (lastA[6][2] ==0)) { MidiSend(noteOn1, 69, velocity); lastA[6][2] =7; } //Write Midi Note Off if ((keysA[6][2] ==1) and (lastA[6][2] ==7)) { MidiSend(noteOff1, 69, velocity); lastA[6][2] =0; } //A70 if ((keysA[6][3] ==0) and (lastA[6][3] ==0)) { MidiSend(noteOn1, 70, velocity); lastA[6][3] =7; } //Write Midi Note Off if ((keysA[6][3] ==1) and (lastA[6][3] ==7)) { MidiSend(noteOff1, 70, velocity); lastA[6][3] =0; } //A71 if ((keysA[6][4] ==0) and (lastA[6][4] ==0)) { MidiSend(noteOn1, 71, velocity); lastA[6][4] =7; } //Write Midi Note Off if ((keysA[6][4] ==1) and (lastA[6][4] ==7)) { MidiSend(noteOff1, 71, velocity); lastA[6][4] =0; } //A72 if ((keysA[6][5] ==0) and (lastA[6][5] ==0)) { MidiSend(noteOn1, 72, velocity); lastA[6][5] =7; } //Write Midi Note Off if ((keysA[6][5] ==1) and (lastA[6][5] ==7)) { MidiSend(noteOff1, 72, velocity); lastA[6][5] =0; } //A73 if ((keysA[7][0] ==0) and (lastA[7][0] ==0)) { MidiSend(noteOn1, 73, velocity); lastA[7][0] =7; } //Write Midi Note Off if ((keysA[7][0] ==1) and (lastA[7][0] ==7)) { MidiSend(noteOff1, 73, velocity); lastA[7][0] =0; } //A74 if ((keysA[7][1] ==0) and (lastA[7][1] ==0)) { MidiSend(noteOn1, 74, velocity); lastA[7][1] =7; } //Write Midi Note Off if ((keysA[7][1] ==1) and (lastA[7][1] ==7)) { MidiSend(noteOff1, 74, velocity); lastA[7][1] =0; } //A75 if ((keysA[7][2] ==0) and (lastA[7][2] ==0)) { MidiSend(noteOn1, 75, velocity); lastA[7][2] =7; } //Write Midi Note Off if ((keysA[7][2] ==1) and (lastA[7][2] ==7)) { MidiSend(noteOff1, 75, velocity); lastA[7][2] =0; } //A76 if ((keysA[7][3] ==0) and (lastA[7][3] ==0)) { MidiSend(noteOn1, 76, velocity); lastA[7][3] =7; } //Write Midi Note Off if ((keysA[7][3] ==1) and (lastA[7][3] ==7)) { MidiSend(noteOff1, 76, velocity); lastA[7][3] =0; } //A77 if ((keysA[7][4] ==0) and (lastA[7][4] ==0)) { MidiSend(noteOn1, 77, velocity); lastA[7][4] =7; } //Write Midi Note Off if ((keysA[7][4] ==1) and (lastA[7][4] ==7)) { MidiSend(noteOff1, 77, velocity); lastA[7][4] =0; } //A78 if ((keysA[7][5] ==0) and (lastA[7][5] ==0)) { MidiSend(noteOn1, 78, velocity); lastA[7][5] =7; } //Write Midi Note Off if ((keysA[7][5] ==1) and (lastA[7][5] ==7)) { MidiSend(noteOff1, 78, velocity); lastA[7][5] =0; } //A79 if ((keysA[8][0] ==0) and (lastA[8][0] ==0)) { MidiSend(noteOn1, 79, velocity); lastA[8][0] =7; } //Write Midi Note Off if ((keysA[8][0] ==1) and (lastA[8][0] ==7)) { MidiSend(noteOff1, 79, velocity); lastA[8][0] =0; } //A80 if ((keysA[8][1] ==0) and (lastA[8][1] ==0)) { MidiSend(noteOn1, 80, velocity); lastA[8][1] =7; } //Write Midi Note Off if ((keysA[8][1] ==1) and (lastA[8][1] ==7)) { MidiSend(noteOff1, 80, velocity); lastA[8][1] =0; } //A81 if ((keysA[8][2] ==0) and (lastA[8][2] ==0)) { MidiSend(noteOn1, 81, velocity); lastA[8][2] =7; } //Write Midi Note Off if ((keysA[8][2] ==1) and (lastA[8][2] ==7)) { MidiSend(noteOff1, 81, velocity); lastA[8][2] =0; } //A82 if ((keysA[8][3] ==0) and (lastA[8][3] ==0)) { MidiSend(noteOn1, 82, velocity); lastA[8][3] =7; } //Write Midi Note Off if ((keysA[8][3] ==1) and (lastA[8][3] ==7)) { MidiSend(noteOff1, 82, velocity); lastA[8][3] =0; } //A83 if ((keysA[8][4] ==0) and (lastA[8][4] ==0)) { MidiSend(noteOn1, 83, velocity); lastA[8][4] =7; } //Write Midi Note Off if ((keysA[8][4] ==1) and (lastA[8][4] ==7)) { MidiSend(noteOff1, 83, velocity); lastA[8][4] =0; } //A84 if ((keysA[8][5] ==0) and (lastA[8][5] ==0)) { MidiSend(noteOn1, 84, velocity); lastA[8][5] =7; } //Write Midi Note Off if ((keysA[8][5] ==1) and (lastA[8][5] ==7)) { MidiSend(noteOff1, 84, velocity); lastA[8][5] =0; } //A85 if ((keysA[9][0] ==0) and (lastA[9][0] ==0)) { MidiSend(noteOn1, 85, velocity); lastA[9][0] =7; } //Write Midi Note Off if ((keysA[9][0] ==1) and (lastA[9][0] ==7)) { MidiSend(noteOff1, 85, velocity); lastA[9][0] =0; } //A86 if ((keysA[9][1] ==0) and (lastA[9][1] ==0)) { MidiSend(noteOn1, 86, velocity); lastA[9][1] =7; } //Write Midi Note Off if ((keysA[9][1] ==1) and (lastA[9][1] ==7)) { MidiSend(noteOff1, 86, velocity); lastA[9][1] =0; } //A87 if ((keysA[9][2] ==0) and (lastA[9][2] ==0)) { MidiSend(noteOn1, 87, velocity); lastA[9][2] =7; } //Write Midi Note Off if ((keysA[9][2] ==1) and (lastA[9][2] ==7)) { MidiSend(noteOff1, 87, velocity); lastA[9][2] =0; } //A88 if ((keysA[9][3] ==0) and (lastA[9][3] ==0)) { MidiSend(noteOn1, 88, velocity); lastA[9][3] =7; } //Write Midi Note Off if ((keysA[9][3] ==1) and (lastA[9][3] ==7)) { MidiSend(noteOff1, 88, velocity); lastA[9][3] =0; } //A89 if ((keysA[9][4] ==0) and (lastA[9][4] ==0)) { MidiSend(noteOn1, 89, velocity); lastA[9][4] =7; } //Write Midi Note Off if ((keysA[9][4] ==1) and (lastA[9][4] ==7)) { MidiSend(noteOff1, 89, velocity); lastA[9][4] =0; } //A90 if ((keysA[9][5] ==0) and (lastA[9][5] ==0)) { MidiSend(noteOn1, 90, velocity); lastA[9][5] =7; } //Write Midi Note Off if ((keysA[9][5] ==1) and (lastA[9][5] ==7)) { MidiSend(noteOff1, 90, velocity); lastA[9][5] =0; } //A91 if ((keysA[10][0] ==0) and (lastA[10][0] ==0)) { MidiSend(noteOn1, 91, velocity); lastA[10][0] =7; } //Write Midi Note Off if ((keysA[10][0] ==1) and (lastA[10][0] ==7)) { MidiSend(noteOff1, 91, velocity); lastA[10][0] =0; } //A92 if ((keysA[10][1] ==0) and (lastA[10][1] ==0)) { MidiSend(noteOn1, 92, velocity); lastA[10][1] =7; } //Write Midi Note Off if ((keysA[10][1] ==1) and (lastA[10][1] ==7)) { MidiSend(noteOff1, 92, velocity); lastA[10][1] =0; } //A93 if ((keysA[10][2] ==0) and (lastA[10][2] ==0)) { MidiSend(noteOn1, 93, velocity); lastA[10][2] =7; } //Write Midi Note Off if ((keysA[10][2] ==1) and (lastA[10][2] ==7)) { MidiSend(noteOff1, 93, velocity); lastA[10][2] =0; } //A94 if ((keysA[10][3] ==0) and (lastA[10][3] ==0)) { MidiSend(noteOn1, 94, velocity); lastA[10][3] =7; } //Write Midi Note Off if ((keysA[10][3] ==1) and (lastA[10][3] ==7)) { MidiSend(noteOff1, 94, velocity); lastA[10][3] =0; } //A95 if ((keysA[10][4] ==0) and (lastA[10][4] ==0)) { MidiSend(noteOn1, 95, velocity); lastA[10][4] =7; } //Write Midi Note Off if ((keysA[10][4] ==1) and (lastA[10][4] ==7)) { MidiSend(noteOff1, 95, velocity); lastA[10][4] =0; } //A96 if ((keysA[10][5] ==0) and (lastA[10][5] ==0)) { MidiSend(noteOn1, 96, velocity); lastA[10][5] =7; } //Write Midi Note Off if ((keysA[10][5] ==1) and (lastA[10][5] ==7)) { MidiSend(noteOff1, 96, velocity); lastA[10][5] =0; } //Write Keyboard B //B36 if ((keysB[0][0] ==0) and (lastB[0][0] ==0)) { MidiSend(noteOn2, 36, velocity); lastB[0][0] =7; } if ((keysB[0][0] ==1) and (lastB[0][0] ==7)) { MidiSend(noteOff2, 36, velocity); lastB[0][0] =0; } //B37 if ((keysB[1][0] ==0) and (lastB[1][0] ==0)) { MidiSend(noteOn2, 37, velocity); lastB[1][0] =7; } if ((keysB[1][0] ==1) and (lastB[1][0] ==7)) { MidiSend(noteOff2, 37, velocity); lastB[1][0] =0; } //B38 if ((keysB[1][1] ==0) and (lastB[1][1] ==0)) { MidiSend(noteOn2, 38, velocity); lastB[1][1] =7; } //Write Midi Note Off if ((keysB[1][1] ==1) and (lastB[1][1] ==7)) { MidiSend(noteOff2, 38, velocity); lastB[1][1] =0; } //B39 if ((keysB[1][2] ==0) and (lastB[1][2] ==0)) { MidiSend(noteOn2, 39, velocity); lastB[1][2] =7; } //Write Midi Note Off if ((keysB[1][2] ==1) and (lastB[1][2] ==7)) { MidiSend(noteOff2, 39, velocity); lastB[1][2] =0; } //B40 if ((keysB[1][3] ==0) and (lastB[1][3] ==0)) { MidiSend(noteOn2, 40, velocity); lastB[1][3] =7; } //Write Midi Note Off if ((keysB[1][3] ==1) and (lastB[1][3] ==7)) { MidiSend(noteOff2, 40, velocity); lastB[1][3] =0; } //B41 if ((keysB[1][4] ==0) and (lastB[1][4] ==0)) { MidiSend(noteOn2, 41, velocity); lastB[1][4] =7; } //Write Midi Note Off if ((keysB[1][4] ==1) and (lastB[1][4] ==7)) { MidiSend(noteOff2, 41, velocity); lastB[1][4] =0; } //B42 if ((keysB[1][5] ==0) and (lastB[1][5] ==0)) { MidiSend(noteOn2, 42, velocity); lastB[1][5] =7; } //Write Midi Note Off if ((keysB[1][5] ==1) and (lastB[1][5] ==7)) { MidiSend(noteOff2, 42, velocity); lastB[1][5] =0; } //B43 if ((keysB[2][0] ==0) and (lastB[2][0] ==0)) { MidiSend(noteOn2, 43, velocity); lastB[2][0] =7; } //Write Midi Note Off if ((keysB[2][0] ==1) and (lastB[2][0] ==7)) { MidiSend(noteOff2, 43, velocity); lastB[2][0] =0; } //B44 if ((keysB[2][1] ==0) and (lastB[2][1] ==0)) { MidiSend(noteOn2, 44, velocity); lastB[2][1] =7; } //Write Midi Note Off if ((keysB[2][1] ==1) and (lastB[2][1] ==7)) { MidiSend(noteOff2, 44, velocity); lastB[2][1] =0; } //B45 if ((keysB[2][2] ==0) and (lastB[2][2] ==0)) { MidiSend(noteOn2, 45, velocity); lastB[2][2] =7; } //Write Midi Note Off if ((keysB[2][2] ==1) and (lastB[2][2] ==7)) { MidiSend(noteOff2, 45, velocity); lastB[2][2] =0; } //B46 if ((keysB[2][3] ==0) and (lastB[2][3] ==0)) { MidiSend(noteOn2, 46, velocity); lastB[2][3] =7; } //Write Midi Note Off if ((keysB[2][3] ==1) and (lastB[2][3] ==7)) { MidiSend(noteOff2, 46, velocity); lastB[2][3] =0; } //B47 if ((keysB[2][4] ==0) and (lastB[2][4] ==0)) { MidiSend(noteOn2, 47, velocity); lastB[2][4] =7; } //Write Midi Note Off if ((keysB[2][4] ==1) and (lastB[2][4] ==7)) { MidiSend(noteOff2, 47, velocity); lastB[2][4] =0; } //B48 if ((keysB[2][5] ==0) and (lastB[2][5] ==0)) { MidiSend(noteOn2, 48, velocity); lastB[2][5] =7; } //Write Midi Note Off if ((keysB[2][5] ==1) and (lastB[2][5] ==7)) { MidiSend(noteOff2, 48, velocity); lastB[2][5] =0; } //B49 if ((keysB[3][0] ==0) and (lastB[3][0] ==0)) { MidiSend(noteOn2, 49, velocity); lastB[3][0] =7; } //Write Midi Note Off if ((keysB[3][0] ==1) and (lastB[3][0] ==7)) { MidiSend(noteOff2, 49, velocity); lastB[3][0] =0; } //B50 if ((keysB[3][1] ==0) and (lastB[3][1] ==0)) { MidiSend(noteOn2, 50, velocity); lastB[3][1] =7; } //Write Midi Note Off if ((keysB[3][1] ==1) and (lastB[3][1] ==7)) { MidiSend(noteOff2, 50, velocity); lastB[3][1] =0; } //B51 if ((keysB[3][2] ==0) and (lastB[3][2] ==0)) { MidiSend(noteOn2, 51, velocity); lastB[3][2] =7; } //Write Midi Note Off if ((keysB[3][2] ==1) and (lastB[3][2] ==7)) { MidiSend(noteOff2, 51, velocity); lastB[3][2] =0; } //B52 if ((keysB[3][3] ==0) and (lastB[3][3] ==0)) { MidiSend(noteOn2, 52, velocity); lastB[3][3] =7; } //Write Midi Note Off if ((keysB[3][3] ==1) and (lastB[3][3] ==7)) { MidiSend(noteOff2, 52, velocity); lastB[3][3] =0; } //B53 if ((keysB[3][4] ==0) and (lastB[3][4] ==0)) { MidiSend(noteOn2, 53, velocity); lastB[3][4] =7; } //Write Midi Note Off if ((keysB[3][4] ==1) and (lastB[3][4] ==7)) { MidiSend(noteOff2, 53, velocity); lastB[3][4] =0; } //B54 if ((keysB[3][5] ==0) and (lastB[3][5] ==0)) { MidiSend(noteOn2, 54, velocity); lastB[3][5] =7; } //Write Midi Note Off if ((keysB[3][5] ==1) and (lastB[3][5] ==7)) { MidiSend(noteOff2, 54, velocity); lastB[3][5] =0; } //B55 if ((keysB[4][0] ==0) and (lastB[4][0] ==0)) { MidiSend(noteOn2, 55, velocity); lastB[4][0] =7; } //Write Midi Note Off if ((keysB[4][0] ==1) and (lastB[4][0] ==7)) { MidiSend(noteOff2, 55, velocity); lastB[4][0] =0; } //B56 if ((keysB[4][1] ==0) and (lastB[4][1] ==0)) { MidiSend(noteOn2, 56, velocity); lastB[4][1] =7; } //Write Midi Note Off if ((keysB[4][1] ==1) and (lastB[4][1] ==7)) { MidiSend(noteOff2, 56, velocity); lastB[4][1] =0; } //B57 if ((keysB[4][2] ==0) and (lastB[4][2] ==0)) { MidiSend(noteOn2, 57, velocity); lastB[4][2] =7; } //Write Midi Note Off if ((keysB[4][2] ==1) and (lastB[4][2] ==7)) { MidiSend(noteOff2, 57, velocity); lastB[4][2] =0; } //B58 if ((keysB[4][3] ==0) and (lastB[4][3] ==0)) { MidiSend(noteOn2, 58, velocity); lastB[4][3] =7; } //Write Midi Note Off if ((keysB[4][3] ==1) and (lastB[4][3] ==7)) { MidiSend(noteOff2, 58, velocity); lastB[4][3] =0; } //B59 if ((keysB[4][4] ==0) and (lastB[4][4] ==0)) { MidiSend(noteOn2, 59, velocity); lastB[4][4] =7; } //Write Midi Note Off if ((keysB[4][4] ==1) and (lastB[4][4] ==7)) { MidiSend(noteOff2, 59, velocity); lastB[4][4] =0; } //B60 if ((keysB[4][5] ==0) and (lastB[4][5] ==0)) { MidiSend(noteOn2, 60, velocity); lastB[4][5] =7; } //Write Midi Note Off if ((keysB[4][5] ==1) and (lastB[4][5] ==7)) { MidiSend(noteOff2, 60, velocity); lastB[4][5] =0; } //B61 if ((keysB[5][0] ==0) and (lastB[5][0] ==0)) { MidiSend(noteOn2, 61, velocity); lastB[5][0] =7; } //Write Midi Note Off if ((keysB[5][0] ==1) and (lastB[5][0] ==7)) { MidiSend(noteOff2, 61, velocity); lastB[5][0] =0; } //B62 if ((keysB[5][1] ==0) and (lastB[5][1] ==0)) { MidiSend(noteOn2, 62, velocity); lastB[5][1] =7; } //Write Midi Note Off if ((keysB[5][1] ==1) and (lastB[5][1] ==7)) { MidiSend(noteOff2, 62, velocity); lastB[5][1] =0; } //B63 if ((keysB[5][2] ==0) and (lastB[5][2] ==0)) { MidiSend(noteOn2, 63, velocity); lastB[5][2] =7; } //Write Midi Note Off if ((keysB[5][2] ==1) and (lastB[5][2] ==7)) { MidiSend(noteOff2, 63, velocity); lastB[5][2] =0; } //B64 if ((keysB[5][3] ==0) and (lastB[5][3] ==0)) { MidiSend(noteOn2, 64, velocity); lastB[5][3] =7; } //Write Midi Note Off if ((keysB[5][3] ==1) and (lastB[5][3] ==7)) { MidiSend(noteOff2, 64, velocity); lastB[5][3] =0; } //B65 if ((keysB[5][4] ==0) and (lastB[5][4] ==0)) { MidiSend(noteOn2, 65, velocity); lastB[5][4] =7; } //Write Midi Note Off if ((keysB[5][4] ==1) and (lastB[5][4] ==7)) { MidiSend(noteOff2, 65, velocity); lastB[5][4] =0; } //B66 if ((keysB[5][5] ==0) and (lastB[5][5] ==0)) { MidiSend(noteOn2, 66, velocity); lastB[5][5] =7; } //Write Midi Note Off if ((keysB[5][5] ==1) and (lastB[5][5] ==7)) { MidiSend(noteOff2, 66, velocity); lastB[5][5] =0; } //B67 if ((keysB[6][0] ==0) and (lastB[6][0] ==0)) { MidiSend(noteOn2, 67, velocity); lastB[6][0] =7; } //Write Midi Note Off if ((keysB[6][0] ==1) and (lastB[6][0] ==7)) { MidiSend(noteOff2, 67, velocity); lastB[6][0] =0; } //B68 if ((keysB[6][1] ==0) and (lastB[6][1] ==0)) { MidiSend(noteOn2, 68, velocity); lastB[6][1] =7; } //Write Midi Note Off if ((keysB[6][1] ==1) and (lastB[6][1] ==7)) { MidiSend(noteOff2, 68, velocity); lastB[6][1] =0; } //B69 if ((keysB[6][2] ==0) and (lastB[6][2] ==0)) { MidiSend(noteOn2, 69, velocity); lastB[6][2] =7; } //Write Midi Note Off if ((keysB[6][2] ==1) and (lastB[6][2] ==7)) { MidiSend(noteOff2, 69, velocity); lastB[6][2] =0; } //B70 if ((keysB[6][3] ==0) and (lastB[6][3] ==0)) { MidiSend(noteOn2, 70, velocity); lastB[6][3] =7; } //Write Midi Note Off if ((keysB[6][3] ==1) and (lastB[6][3] ==7)) { MidiSend(noteOff2, 70, velocity); lastB[6][3] =0; } //B71 if ((keysB[6][4] ==0) and (lastB[6][4] ==0)) { MidiSend(noteOn2, 71, velocity); lastB[6][4] =7; } //Write Midi Note Off if ((keysB[6][4] ==1) and (lastB[6][4] ==7)) { MidiSend(noteOff2, 71, velocity); lastB[6][4] =0; } //B72 if ((keysB[6][5] ==0) and (lastB[6][5] ==0)) { MidiSend(noteOn2, 72, velocity); lastB[6][5] =7; } //Write Midi Note Off if ((keysB[6][5] ==1) and (lastB[6][5] ==7)) { MidiSend(noteOff2, 72, velocity); lastB[6][5] =0; } //B73 if ((keysB[7][0] ==0) and (lastB[7][0] ==0)) { MidiSend(noteOn2, 73, velocity); lastB[7][0] =7; } //Write Midi Note Off if ((keysB[7][0] ==1) and (lastB[7][0] ==7)) { MidiSend(noteOff2, 73, velocity); lastB[7][0] =0; } //B74 if ((keysB[7][1] ==0) and (lastB[7][1] ==0)) { MidiSend(noteOn2, 74, velocity); lastB[7][1] =7; } //Write Midi Note Off if ((keysB[7][1] ==1) and (lastB[7][1] ==7)) { MidiSend(noteOff2, 74, velocity); lastB[7][1] =0; } //B75 if ((keysB[7][2] ==0) and (lastB[7][2] ==0)) { MidiSend(noteOn2, 75, velocity); lastB[7][2] =7; } //Write Midi Note Off if ((keysB[7][2] ==1) and (lastB[7][2] ==7)) { MidiSend(noteOff2, 75, velocity); lastB[7][2] =0; } //B76 if ((keysB[7][3] ==0) and (lastB[7][3] ==0)) { MidiSend(noteOn2, 76, velocity); lastB[7][3] =7; } //Write Midi Note Off if ((keysB[7][3] ==1) and (lastB[7][3] ==7)) { MidiSend(noteOff2, 76, velocity); lastB[7][3] =0; } //B77 if ((keysB[7][4] ==0) and (lastB[7][4] ==0)) { MidiSend(noteOn2, 77, velocity); lastB[7][4] =7; } //Write Midi Note Off if ((keysB[7][4] ==1) and (lastB[7][4] ==7)) { MidiSend(noteOff2, 77, velocity); lastB[7][4] =0; } //B78 if ((keysB[7][5] ==0) and (lastB[7][5] ==0)) { MidiSend(noteOn2, 78, velocity); lastB[7][5] =7; } //Write Midi Note Off if ((keysB[7][5] ==1) and (lastB[7][5] ==7)) { MidiSend(noteOff2, 78, velocity); lastB[7][5] =0; } //B79 if ((keysB[8][0] ==0) and (lastB[8][0] ==0)) { MidiSend(noteOn2, 79, velocity); lastB[8][0] =7; } //Write Midi Note Off if ((keysB[8][0] ==1) and (lastB[8][0] ==7)) { MidiSend(noteOff2, 79, velocity); lastB[8][0] =0; } //B80 if ((keysB[8][1] ==0) and (lastB[8][1] ==0)) { MidiSend(noteOn2, 80, velocity); lastB[8][1] =7; } //Write Midi Note Off if ((keysB[8][1] ==1) and (lastB[8][1] ==7)) { MidiSend(noteOff2, 80, velocity); lastB[8][1] =0; } //B81 if ((keysB[8][2] ==0) and (lastB[8][2] ==0)) { MidiSend(noteOn2, 81, velocity); lastB[8][2] =7; } //Write Midi Note Off if ((keysB[8][2] ==1) and (lastB[8][2] ==7)) { MidiSend(noteOff2, 81, velocity); lastB[8][2] =0; } //B82 if ((keysB[8][3] ==0) and (lastB[8][3] ==0)) { MidiSend(noteOn2, 82, velocity); lastB[8][3] =7; } //Write Midi Note Off if ((keysB[8][3] ==1) and (lastB[8][3] ==7)) { MidiSend(noteOff2, 82, velocity); lastB[8][3] =0; } //B83 if ((keysB[8][4] ==0) and (lastB[8][4] ==0)) { MidiSend(noteOn2, 83, velocity); lastB[8][4] =7; } //Write Midi Note Off if ((keysB[8][4] ==1) and (lastB[8][4] ==7)) { MidiSend(noteOff2, 83, velocity); lastB[8][4] =0; } //B84 if ((keysB[8][5] ==0) and (lastB[8][5] ==0)) { MidiSend(noteOn2, 84, velocity); lastB[8][5] =7; } //Write Midi Note Off if ((keysB[8][5] ==1) and (lastB[8][5] ==7)) { MidiSend(noteOff2, 84, velocity); lastB[8][5] =0; } //B85 if ((keysB[9][0] ==0) and (lastB[9][0] ==0)) { MidiSend(noteOn2, 85, velocity); lastB[9][0] =7; } //Write Midi Note Off if ((keysB[9][0] ==1) and (lastB[9][0] ==7)) { MidiSend(noteOff2, 85, velocity); lastB[9][0] =0; } //B86 if ((keysB[9][1] ==0) and (lastB[9][1] ==0)) { MidiSend(noteOn2, 86, velocity); lastB[9][1] =7; } //Write Midi Note Off if ((keysB[9][1] ==1) and (lastB[9][1] ==7)) { MidiSend(noteOff2, 86, velocity); lastB[9][1] =0; } //B87 if ((keysB[9][2] ==0) and (lastB[9][2] ==0)) { MidiSend(noteOn2, 87, velocity); lastB[9][2] =7; } //Write Midi Note Off if ((keysB[9][2] ==1) and (lastB[9][2] ==7)) { MidiSend(noteOff2, 87, velocity); lastB[9][2] =0; } //B88 if ((keysB[9][3] ==0) and (lastB[9][3] ==0)) { MidiSend(noteOn2, 88, velocity); lastB[9][3] =7; } //Write Midi Note Off if ((keysB[9][3] ==1) and (lastB[9][3] ==7)) { MidiSend(noteOff2, 88, velocity); lastB[9][3] =0; } //B89 if ((keysB[9][4] ==0) and (lastB[9][4] ==0)) { MidiSend(noteOn2, 89, velocity); lastB[9][4] =7; } //Write Midi Note Off if ((keysB[9][4] ==1) and (lastB[9][4] ==7)) { MidiSend(noteOff2, 89, velocity); lastB[9][4] =0; } //B90 if ((keysB[9][5] ==0) and (lastB[9][5] ==0)) { MidiSend(noteOn2, 90, velocity); lastB[9][5] =7; } //Write Midi Note Off if ((keysB[9][5] ==1) and (lastB[9][5] ==7)) { MidiSend(noteOff2, 90, velocity); lastB[9][5] =0; } //B91 if ((keysB[10][0] ==0) and (lastB[10][0] ==0)) { MidiSend(noteOn2, 91, velocity); lastB[10][0] =7; } //Write Midi Note Off if ((keysB[10][0] ==1) and (lastB[10][0] ==7)) { MidiSend(noteOff2, 91, velocity); lastB[10][0] =0; } //B92 if ((keysB[10][1] ==0) and (lastB[10][1] ==0)) { MidiSend(noteOn2, 92, velocity); lastB[10][1] =7; } //Write Midi Note Off if ((keysB[10][1] ==1) and (lastB[10][1] ==7)) { MidiSend(noteOff2, 92, velocity); lastB[10][1] =0; } //B93 if ((keysB[10][2] ==0) and (lastB[10][2] ==0)) { MidiSend(noteOn2, 93, velocity); lastB[10][2] =7; } //Write Midi Note Off if ((keysB[10][2] ==1) and (lastB[10][2] ==7)) { MidiSend(noteOff2, 93, velocity); lastB[10][2] =0; } //B94 if ((keysB[10][3] ==0) and (lastB[10][3] ==0)) { MidiSend(noteOn2, 94, velocity); lastB[10][3] =7; } //Write Midi Note Off if ((keysB[10][3] ==1) and (lastB[10][3] ==7)) { MidiSend(noteOff2, 94, velocity); lastB[10][3] =0; } //B95 if ((keysB[10][4] ==0) and (lastB[10][4] ==0)) { MidiSend(noteOn2, 95, velocity); lastB[10][4] =7; } //Write Midi Note Off if ((keysB[10][4] ==1) and (lastB[10][4] ==7)) { MidiSend(noteOff2, 95, velocity); lastB[10][4] =0; } //B96 if ((keysB[10][5] ==0) and (lastB[10][5] ==0)) { MidiSend(noteOn2, 96, velocity); lastB[10][5] =7; } //Write Midi Note Off if ((keysB[10][5] ==1) and (lastB[10][5] ==7)) { MidiSend(noteOff2, 96, velocity); lastB[10][5] =0; } //Write Keyboard C //C36 if ((keysC[0][0] ==0) and (lastC[0][0] ==0)) { MidiSend(noteOn3, 36, velocity); lastC[0][0] =7; } if ((keysC[0][0] ==1) and (lastC[0][0] ==7)) { MidiSend(noteOff3, 36, velocity); lastC[0][0] =0; } //C37 if ((keysC[1][0] ==0) and (lastC[1][0] ==0)) { MidiSend(noteOn3, 37, velocity); lastC[1][0] =7; } if ((keysC[1][0] ==1) and (lastC[1][0] ==7)) { MidiSend(noteOff3, 37, velocity); lastC[1][0] =0; } //C38 if ((keysC[1][1] ==0) and (lastC[1][1] ==0)) { MidiSend(noteOn3, 38, velocity); lastC[1][1] =7; } //Write Midi Note Off if ((keysC[1][1] ==1) and (lastC[1][1] ==7)) { MidiSend(noteOff3, 38, velocity); lastC[1][1] =0; } //C39 if ((keysC[1][2] ==0) and (lastC[1][2] ==0)) { MidiSend(noteOn3, 39, velocity); lastC[1][2] =7; } //Write Midi Note Off if ((keysC[1][2] ==1) and (lastC[1][2] ==7)) { MidiSend(noteOff3, 39, velocity); lastC[1][2] =0; } //C40 if ((keysC[1][3] ==0) and (lastC[1][3] ==0)) { MidiSend(noteOn3, 40, velocity); lastC[1][3] =7; } //Write Midi Note Off if ((keysC[1][3] ==1) and (lastC[1][3] ==7)) { MidiSend(noteOff3, 40, velocity); lastC[1][3] =0; } //C41 if ((keysC[1][4] ==0) and (lastC[1][4] ==0)) { MidiSend(noteOn3, 41, velocity); lastC[1][4] =7; } //Write Midi Note Off if ((keysC[1][4] ==1) and (lastC[1][4] ==7)) { MidiSend(noteOff3, 41, velocity); lastC[1][4] =0; } //C42 if ((keysC[1][5] ==0) and (lastC[1][5] ==0)) { MidiSend(noteOn3, 42, velocity); lastC[1][5] =7; } //Write Midi Note Off if ((keysC[1][5] ==1) and (lastC[1][5] ==7)) { MidiSend(noteOff3, 42, velocity); lastC[1][5] =0; } //C43 if ((keysC[2][0] ==0) and (lastC[2][0] ==0)) { MidiSend(noteOn3, 43, velocity); lastC[2][0] =7; } //Write Midi Note Off if ((keysC[2][0] ==1) and (lastC[2][0] ==7)) { MidiSend(noteOff3, 43, velocity); lastC[2][0] =0; } //C44 if ((keysC[2][1] ==0) and (lastC[2][1] ==0)) { MidiSend(noteOn3, 44, velocity); lastC[2][1] =7; } //Write Midi Note Off if ((keysC[2][1] ==1) and (lastC[2][1] ==7)) { MidiSend(noteOff3, 44, velocity); lastC[2][1] =0; } //B45 if ((keysC[2][2] ==0) and (lastC[2][2] ==0)) { MidiSend(noteOn3, 45, velocity); lastC[2][2] =7; } //Write Midi Note Off if ((keysC[2][2] ==1) and (lastC[2][2] ==7)) { MidiSend(noteOff3, 45, velocity); lastC[2][2] =0; } //C46 if ((keysC[2][3] ==0) and (lastC[2][3] ==0)) { MidiSend(noteOn3, 46, velocity); lastC[2][3] =7; } //Write Midi Note Off if ((keysC[2][3] ==1) and (lastC[2][3] ==7)) { MidiSend(noteOff3, 46, velocity); lastC[2][3] =0; } //C47 if ((keysC[2][4] ==0) and (lastC[2][4] ==0)) { MidiSend(noteOn3, 47, velocity); lastC[2][4] =7; } //Write Midi Note Off if ((keysC[2][4] ==1) and (lastC[2][4] ==7)) { MidiSend(noteOff3, 47, velocity); lastC[2][4] =0; } //C48 if ((keysC[2][5] ==0) and (lastC[2][5] ==0)) { MidiSend(noteOn3, 48, velocity); lastC[2][5] =7; } //Write Midi Note Off if ((keysC[2][5] ==1) and (lastC[2][5] ==7)) { MidiSend(noteOff3, 48, velocity); lastC[2][5] =0; } //C49 if ((keysC[3][0] ==0) and (lastC[3][0] ==0)) { MidiSend(noteOn3, 49, velocity); lastC[3][0] =7; } //Write Midi Note Off if ((keysC[3][0] ==1) and (lastC[3][0] ==7)) { MidiSend(noteOff3, 49, velocity); lastC[3][0] =0; } //C50 if ((keysC[3][1] ==0) and (lastC[3][1] ==0)) { MidiSend(noteOn3, 50, velocity); lastC[3][1] =7; } //Write Midi Note Off if ((keysC[3][1] ==1) and (lastC[3][1] ==7)) { MidiSend(noteOff3, 50, velocity); lastC[3][1] =0; } //C51 if ((keysC[3][2] ==0) and (lastC[3][2] ==0)) { MidiSend(noteOn3, 51, velocity); lastC[3][2] =7; } //Write Midi Note Off if ((keysC[3][2] ==1) and (lastC[3][2] ==7)) { MidiSend(noteOff3, 51, velocity); lastC[3][2] =0; } //C52 if ((keysC[3][3] ==0) and (lastC[3][3] ==0)) { MidiSend(noteOn3, 52, velocity); lastC[3][3] =7; } //Write Midi Note Off if ((keysC[3][3] ==1) and (lastC[3][3] ==7)) { MidiSend(noteOff3, 52, velocity); lastC[3][3] =0; } //C53 if ((keysC[3][4] ==0) and (lastC[3][4] ==0)) { MidiSend(noteOn3, 53, velocity); lastC[3][4] =7; } //Write Midi Note Off if ((keysC[3][4] ==1) and (lastC[3][4] ==7)) { MidiSend(noteOff3, 53, velocity); lastC[3][4] =0; } //C54 if ((keysC[3][5] ==0) and (lastC[3][5] ==0)) { MidiSend(noteOn3, 54, velocity); lastC[3][5] =7; } //Write Midi Note Off if ((keysC[3][5] ==1) and (lastC[3][5] ==7)) { MidiSend(noteOff3, 54, velocity); lastC[3][5] =0; } //C55 if ((keysC[4][0] ==0) and (lastC[4][0] ==0)) { MidiSend(noteOn3, 55, velocity); lastC[4][0] =7; } //Write Midi Note Off if ((keysC[4][0] ==1) and (lastC[4][0] ==7)) { MidiSend(noteOff3, 55, velocity); lastC[4][0] =0; } //C56 if ((keysC[4][1] ==0) and (lastC[4][1] ==0)) { MidiSend(noteOn3, 56, velocity); lastC[4][1] =7; } //Write Midi Note Off if ((keysC[4][1] ==1) and (lastC[4][1] ==7)) { MidiSend(noteOff3, 56, velocity); lastC[4][1] =0; } //C57 if ((keysC[4][2] ==0) and (lastC[4][2] ==0)) { MidiSend(noteOn3, 57, velocity); lastC[4][2] =7; } //Write Midi Note Off if ((keysC[4][2] ==1) and (lastC[4][2] ==7)) { MidiSend(noteOff3, 57, velocity); lastC[4][2] =0; } //C58 if ((keysC[4][3] ==0) and (lastC[4][3] ==0)) { MidiSend(noteOn3, 58, velocity); lastC[4][3] =7; } //Write Midi Note Off if ((keysC[4][3] ==1) and (lastC[4][3] ==7)) { MidiSend(noteOff3, 58, velocity); lastC[4][3] =0; } //C59 if ((keysC[4][4] ==0) and (lastC[4][4] ==0)) { MidiSend(noteOn3, 59, velocity); lastC[4][4] =7; } //Write Midi Note Off if ((keysC[4][4] ==1) and (lastC[4][4] ==7)) { MidiSend(noteOff3, 59, velocity); lastC[4][4] =0; } //C60 if ((keysC[4][5] ==0) and (lastC[4][5] ==0)) { MidiSend(noteOn3, 60, velocity); lastC[4][5] =7; } //Write Midi Note Off if ((keysC[4][5] ==1) and (lastC[4][5] ==7)) { MidiSend(noteOff3, 60, velocity); lastC[4][5] =0; } //C61 if ((keysC[5][0] ==0) and (lastC[5][0] ==0)) { MidiSend(noteOn3, 61, velocity); lastC[5][0] =7; } //Write Midi Note Off if ((keysC[5][0] ==1) and (lastC[5][0] ==7)) { MidiSend(noteOff3, 61, velocity); lastC[5][0] =0; } //C62 if ((keysC[5][1] ==0) and (lastC[5][1] ==0)) { MidiSend(noteOn3, 62, velocity); lastC[5][1] =7; } //Write Midi Note Off if ((keysC[5][1] ==1) and (lastC[5][1] ==7)) { MidiSend(noteOff3, 62, velocity); lastC[5][1] =0; } //C63 if ((keysC[5][2] ==0) and (lastC[5][2] ==0)) { MidiSend(noteOn3, 63, velocity); lastC[5][2] =7; } //Write Midi Note Off if ((keysC[5][2] ==1) and (lastC[5][2] ==7)) { MidiSend(noteOff3, 63, velocity); lastC[5][2] =0; } //C64 if ((keysC[5][3] ==0) and (lastC[5][3] ==0)) { MidiSend(noteOn3, 64, velocity); lastC[5][3] =7; } //Write Midi Note Off if ((keysC[5][3] ==1) and (lastC[5][3] ==7)) { MidiSend(noteOff3, 64, velocity); lastC[5][3] =0; } //C65 if ((keysC[5][4] ==0) and (lastC[5][4] ==0)) { MidiSend(noteOn3, 65, velocity); lastC[5][4] =7; } //Write Midi Note Off if ((keysC[5][4] ==1) and (lastC[5][4] ==7)) { MidiSend(noteOff3, 65, velocity); lastC[5][4] =0; } //C66 if ((keysC[5][5] ==0) and (lastC[5][5] ==0)) { MidiSend(noteOn3, 66, velocity); lastC[5][5] =7; } //Write Midi Note Off if ((keysC[5][5] ==1) and (lastC[5][5] ==7)) { MidiSend(noteOff3, 66, velocity); lastC[5][5] =0; } //C67 if ((keysC[6][0] ==0) and (lastC[6][0] ==0)) { MidiSend(noteOn3, 67, velocity); lastC[6][0] =7; } //Write Midi Note Off if ((keysC[6][0] ==1) and (lastC[6][0] ==7)) { MidiSend(noteOff3, 67, velocity); lastC[6][0] =0; } //C68 if ((keysC[6][1] ==0) and (lastC[6][1] ==0)) { MidiSend(noteOn3, 68, velocity); lastC[6][1] =7; } //Write Midi Note Off if ((keysC[6][1] ==1) and (lastC[6][1] ==7)) { MidiSend(noteOff3, 68, velocity); lastC[6][1] =0; } //C69 if ((keysC[6][2] ==0) and (lastC[6][2] ==0)) { MidiSend(noteOn3, 69, velocity); lastC[6][2] =7; } //Write Midi Note Off if ((keysC[6][2] ==1) and (lastC[6][2] ==7)) { MidiSend(noteOff3, 69, velocity); lastC[6][2] =0; } //C70 if ((keysC[6][3] ==0) and (lastC[6][3] ==0)) { MidiSend(noteOn3, 70, velocity); lastC[6][3] =7; } //Write Midi Note Off if ((keysC[6][3] ==1) and (lastC[6][3] ==7)) { MidiSend(noteOff3, 70, velocity); lastC[6][3] =0; } //C71 if ((keysC[6][4] ==0) and (lastC[6][4] ==0)) { MidiSend(noteOn3, 71, velocity); lastC[6][4] =7; } //Write Midi Note Off if ((keysC[6][4] ==1) and (lastC[6][4] ==7)) { MidiSend(noteOff3, 71, velocity); lastC[6][4] =0; } //C72 if ((keysC[6][5] ==0) and (lastC[6][5] ==0)) { MidiSend(noteOn3, 72, velocity); lastC[6][5] =7; } //Write Midi Note Off if ((keysC[6][5] ==1) and (lastC[6][5] ==7)) { MidiSend(noteOff3, 72, velocity); lastC[6][5] =0; } //C73 if ((keysC[7][0] ==0) and (lastC[7][0] ==0)) { MidiSend(noteOn3, 73, velocity); lastC[7][0] =7; } //Write Midi Note Off if ((keysC[7][0] ==1) and (lastC[7][0] ==7)) { MidiSend(noteOff3, 73, velocity); lastC[7][0] =0; } //C74 if ((keysC[7][1] ==0) and (lastC[7][1] ==0)) { MidiSend(noteOn3, 74, velocity); lastC[7][1] =7; } //Write Midi Note Off if ((keysC[7][1] ==1) and (lastC[7][1] ==7)) { MidiSend(noteOff3, 74, velocity); lastC[7][1] =0; } //C75 if ((keysC[7][2] ==0) and (lastC[7][2] ==0)) { MidiSend(noteOn3, 75, velocity); lastC[7][2] =7; } //Write Midi Note Off if ((keysC[7][2] ==1) and (lastC[7][2] ==7)) { MidiSend(noteOff3, 75, velocity); lastC[7][2] =0; } //C76 if ((keysC[7][3] ==0) and (lastC[7][3] ==0)) { MidiSend(noteOn3, 76, velocity); lastC[7][3] =7; } //Write Midi Note Off if ((keysC[7][3] ==1) and (lastC[7][3] ==7)) { MidiSend(noteOff3, 76, velocity); lastC[7][3] =0; } //C77 if ((keysC[7][4] ==0) and (lastC[7][4] ==0)) { MidiSend(noteOn3, 77, velocity); lastC[7][4] =7; } //Write Midi Note Off if ((keysC[7][4] ==1) and (lastC[7][4] ==7)) { MidiSend(noteOff3, 77, velocity); lastC[7][4] =0; } //C78 if ((keysC[7][5] ==0) and (lastC[7][5] ==0)) { MidiSend(noteOn3, 78, velocity); lastC[7][5] =7; } //Write Midi Note Off if ((keysC[7][5] ==1) and (lastC[7][5] ==7)) { MidiSend(noteOff3, 78, velocity); lastC[7][5] =0; } //C79 if ((keysC[8][0] ==0) and (lastC[8][0] ==0)) { MidiSend(noteOn3, 79, velocity); lastC[8][0] =7; } //Write Midi Note Off if ((keysC[8][0] ==1) and (lastC[8][0] ==7)) { MidiSend(noteOff2, 79, velocity); lastC[8][0] =0; } //C80 if ((keysC[8][1] ==0) and (lastC[8][1] ==0)) { MidiSend(noteOn3, 80, velocity); lastC[8][1] =7; } //Write Midi Note Off if ((keysC[8][1] ==1) and (lastC[8][1] ==7)) { MidiSend(noteOff3, 80, velocity); lastC[8][1] =0; } //C81 if ((keysC[8][2] ==0) and (lastC[8][2] ==0)) { MidiSend(noteOn3, 81, velocity); lastC[8][2] =7; } //Write Midi Note Off if ((keysC[8][2] ==1) and (lastC[8][2] ==7)) { MidiSend(noteOff3, 81, velocity); lastC[8][2] =0; } //C82 if ((keysC[8][3] ==0) and (lastC[8][3] ==0)) { MidiSend(noteOn3, 82, velocity); lastC[8][3] =7; } //Write Midi Note Off if ((keysC[8][3] ==1) and (lastC[8][3] ==7)) { MidiSend(noteOff3, 82, velocity); lastC[8][3] =0; } //C83 if ((keysC[8][4] ==0) and (lastC[8][4] ==0)) { MidiSend(noteOn3, 83, velocity); lastC[8][4] =7; } //Write Midi Note Off if ((keysC[8][4] ==1) and (lastC[8][4] ==7)) { MidiSend(noteOff3, 83, velocity); lastC[8][4] =0; } //C84 if ((keysC[8][5] ==0) and (lastC[8][5] ==0)) { MidiSend(noteOn3, 84, velocity); lastC[8][5] =7; } //Write Midi Note Off if ((keysC[8][5] ==1) and (lastC[8][5] ==7)) { MidiSend(noteOff3, 84, velocity); lastC[8][5] =0; } //C85 if ((keysC[9][0] ==0) and (lastC[9][0] ==0)) { MidiSend(noteOn3, 85, velocity); lastC[9][0] =7; } //Write Midi Note Off if ((keysC[9][0] ==1) and (lastC[9][0] ==7)) { MidiSend(noteOff3, 85, velocity); lastC[9][0] =0; } //C86 if ((keysC[9][1] ==0) and (lastC[9][1] ==0)) { MidiSend(noteOn2, 86, velocity); lastC[9][1] =7; } //Write Midi Note Off if ((keysC[9][1] ==1) and (lastC[9][1] ==7)) { MidiSend(noteOff3, 86, velocity); lastC[9][1] =0; } //C87 if ((keysC[9][2] ==0) and (lastC[9][2] ==0)) { MidiSend(noteOn3, 87, velocity); lastC[9][2] =7; } //Write Midi Note Off if ((keysC[9][2] ==1) and (lastC[9][2] ==7)) { MidiSend(noteOff3, 87, velocity); lastC[9][2] =0; } //C88 if ((keysC[9][3] ==0) and (lastC[9][3] ==0)) { MidiSend(noteOn3, 88, velocity); lastC[9][3] =7; } //Write Midi Note Off if ((keysC[9][3] ==1) and (lastC[9][3] ==7)) { MidiSend(noteOff3, 88, velocity); lastC[9][3] =0; } //C89 if ((keysC[9][4] ==0) and (lastC[9][4] ==0)) { MidiSend(noteOn3, 89, velocity); lastC[9][4] =7; } //Write Midi Note Off if ((keysC[9][4] ==1) and (lastC[9][4] ==7)) { MidiSend(noteOff3, 89, velocity); lastC[9][4] =0; } //C90 if ((keysC[9][5] ==0) and (lastC[9][5] ==0)) { MidiSend(noteOn3, 90, velocity); lastC[9][5] =7; } //Write Midi Note Off if ((keysC[9][5] ==1) and (lastC[9][5] ==7)) { MidiSend(noteOff3, 90, velocity); lastC[9][5] =0; } //C91 if ((keysC[10][0] ==0) and (lastC[10][0] ==0)) { MidiSend(noteOn3, 91, velocity); lastC[10][0] =7; } //Write Midi Note Off if ((keysC[10][0] ==1) and (lastC[10][0] ==7)) { MidiSend(noteOff3, 91, velocity); lastC[10][0] =0; } //C92 if ((keysC[10][1] ==0) and (lastC[10][1] ==0)) { MidiSend(noteOn3, 92, velocity); lastC[10][1] =7; } //Write Midi Note Off if ((keysC[10][1] ==1) and (lastC[10][1] ==7)) { MidiSend(noteOff3, 92, velocity); lastC[10][1] =0; } //C93 if ((keysC[10][2] ==0) and (lastC[10][2] ==0)) { MidiSend(noteOn3, 93, velocity); lastC[10][2] =7; } //Write Midi Note Off if ((keysC[10][2] ==1) and (lastC[10][2] ==7)) { MidiSend(noteOff3, 93, velocity); lastC[10][2] =0; } //C94 if ((keysC[10][3] ==0) and (lastC[10][3] ==0)) { MidiSend(noteOn3, 94, velocity); lastC[10][3] =7; } //Write Midi Note Off if ((keysC[10][3] ==1) and (lastC[10][3] ==7)) { MidiSend(noteOff3, 94, velocity); lastC[10][3] =0; } //C95 if ((keysC[10][4] ==0) and (lastC[10][4] ==0)) { MidiSend(noteOn3, 95, velocity); lastC[10][4] =7; } //Write Midi Note Off if ((keysC[10][4] ==1) and (lastC[10][4] ==7)) { MidiSend(noteOff3, 95, velocity); lastC[10][4] =0; } //C96 if ((keysC[10][5] ==0) and (lastC[10][5] ==0)) { MidiSend(noteOn3, 96, velocity); lastC[10][5] =7; } //Write Midi Note Off if ((keysC[10][5] ==1) and (lastC[10][5] ==7)) { MidiSend(noteOff3, 96, velocity); lastC[10][5] =0; } //Write Keyboard D //D36 if ((keysD[0][0] ==0) and (lastD[0][0] ==0)) { MidiSend(noteOn4, 36, velocity); lastD[0][0] =7; } if ((keysD[0][0] ==1) and (lastD[0][0] ==7)) { MidiSend(noteOff4, 36, velocity); lastD[0][0] =0; } //D37 if ((keysD[1][0] ==0) and (lastD[1][0] ==0)) { MidiSend(noteOn4, 37, velocity); lastD[1][0] =7; } if ((keysD[1][0] ==1) and (lastD[1][0] ==7)) { MidiSend(noteOff4, 37, velocity); lastD[1][0] =0; } //D38 if ((keysD[1][1] ==0) and (lastD[1][1] ==0)) { MidiSend(noteOn4, 38, velocity); lastD[1][1] =7; } //Write Midi Note Off if ((keysD[1][1] ==1) and (lastD[1][1] ==7)) { MidiSend(noteOff4, 38, velocity); lastD[1][1] =0; } //D39 if ((keysD[1][2] ==0) and (lastD[1][2] ==0)) { MidiSend(noteOn4, 39, velocity); lastD[1][2] =7; } //Write Midi Note Off if ((keysD[1][2] ==1) and (lastD[1][2] ==7)) { MidiSend(noteOff4, 39, velocity); lastD[1][2] =0; } //D40 if ((keysD[1][3] ==0) and (lastD[1][3] ==0)) { MidiSend(noteOn4, 40, velocity); lastD[1][3] =7; } //Write Midi Note Off if ((keysD[1][3] ==1) and (lastD[1][3] ==7)) { MidiSend(noteOff4, 40, velocity); lastD[1][3] =0; } //D41 if ((keysD[1][4] ==0) and (lastD[1][4] ==0)) { MidiSend(noteOn4, 41, velocity); lastD[1][4] =7; } //Write Midi Note Off if ((keysD[1][4] ==1) and (lastD[1][4] ==7)) { MidiSend(noteOff4, 41, velocity); lastD[1][4] =0; } //D42 if ((keysD[1][5] ==0) and (lastD[1][5] ==0)) { MidiSend(noteOn4, 42, velocity); lastD[1][5] =7; } //Write Midi Note Off if ((keysD[1][5] ==1) and (lastD[1][5] ==7)) { MidiSend(noteOff4, 42, velocity); lastD[1][5] =0; } //D43 if ((keysD[2][0] ==0) and (lastD[2][0] ==0)) { MidiSend(noteOn4, 43, velocity); lastD[2][0] =7; } //Write Midi Note Off if ((keysD[2][0] ==1) and (lastD[2][0] ==7)) { MidiSend(noteOff4, 43, velocity); lastD[2][0] =0; } //B44 if ((keysD[2][1] ==0) and (lastD[2][1] ==0)) { MidiSend(noteOn4, 44, velocity); lastD[2][1] =7; } //Write Midi Note Off if ((keysD[2][1] ==1) and (lastD[2][1] ==7)) { MidiSend(noteOff4, 44, velocity); lastD[2][1] =0; } //D45 if ((keysD[2][2] ==0) and (lastD[2][2] ==0)) { MidiSend(noteOn4, 45, velocity); lastD[2][2] =7; } //Write Midi Note Off if ((keysD[2][2] ==1) and (lastD[2][2] ==7)) { MidiSend(noteOff4, 45, velocity); lastD[2][2] =0; } //D46 if ((keysD[2][3] ==0) and (lastD[2][3] ==0)) { MidiSend(noteOn4, 46, velocity); lastD[2][3] =7; } //Write Midi Note Off if ((keysD[2][3] ==1) and (lastD[2][3] ==7)) { MidiSend(noteOff4, 46, velocity); lastD[2][3] =0; } //D47 if ((keysD[2][4] ==0) and (lastD[2][4] ==0)) { MidiSend(noteOn4, 47, velocity); lastD[2][4] =7; } //Write Midi Note Off if ((keysD[2][4] ==1) and (lastD[2][4] ==7)) { MidiSend(noteOff4, 47, velocity); lastD[2][4] =0; } //D48 if ((keysD[2][5] ==0) and (lastD[2][5] ==0)) { MidiSend(noteOn4, 48, velocity); lastD[2][5] =7; } //Write Midi Note Off if ((keysD[2][5] ==1) and (lastD[2][5] ==7)) { MidiSend(noteOff4, 48, velocity); lastD[2][5] =0; } //D49 if ((keysD[3][0] ==0) and (lastD[3][0] ==0)) { MidiSend(noteOn4, 49, velocity); lastD[3][0] =7; } //Write Midi Note Off if ((keysD[3][0] ==1) and (lastD[3][0] ==7)) { MidiSend(noteOff4, 49, velocity); lastD[3][0] =0; } //D50 if ((keysD[3][1] ==0) and (lastD[3][1] ==0)) { MidiSend(noteOn4, 50, velocity); lastD[3][1] =7; } //Write Midi Note Off if ((keysD[3][1] ==1) and (lastD[3][1] ==7)) { MidiSend(noteOff4, 50, velocity); lastD[3][1] =0; } //D51 if ((keysD[3][2] ==0) and (lastD[3][2] ==0)) { MidiSend(noteOn4, 51, velocity); lastD[3][2] =7; } //Write Midi Note Off if ((keysD[3][2] ==1) and (lastD[3][2] ==7)) { MidiSend(noteOff4, 51, velocity); lastD[3][2] =0; } //D52 if ((keysD[3][3] ==0) and (lastD[3][3] ==0)) { MidiSend(noteOn4, 52, velocity); lastD[3][3] =7; } //Write Midi Note Off if ((keysD[3][3] ==1) and (lastD[3][3] ==7)) { MidiSend(noteOff4, 52, velocity); lastD[3][3] =0; } //D53 if ((keysD[3][4] ==0) and (lastD[3][4] ==0)) { MidiSend(noteOn4, 53, velocity); lastD[3][4] =7; } //Write Midi Note Off if ((keysD[3][4] ==1) and (lastD[3][4] ==7)) { MidiSend(noteOff4, 53, velocity); lastD[3][4] =0; } //D54 if ((keysD[3][5] ==0) and (lastD[3][5] ==0)) { MidiSend(noteOn4, 54, velocity); lastD[3][5] =7; } //Write Midi Note Off if ((keysD[3][5] ==1) and (lastD[3][5] ==7)) { MidiSend(noteOff4, 54, velocity); lastD[3][5] =0; } //D55 if ((keysD[4][0] ==0) and (lastD[4][0] ==0)) { MidiSend(noteOn4, 55, velocity); lastD[4][0] =7; } //Write Midi Note Off if ((keysD[4][0] ==1) and (lastD[4][0] ==7)) { MidiSend(noteOff4, 55, velocity); lastD[4][0] =0; } //D56 if ((keysD[4][1] ==0) and (lastD[4][1] ==0)) { MidiSend(noteOn4, 56, velocity); lastD[4][1] =7; } //Write Midi Note Off if ((keysD[4][1] ==1) and (lastD[4][1] ==7)) { MidiSend(noteOff4, 56, velocity); lastD[4][1] =0; } //D57 if ((keysD[4][2] ==0) and (lastD[4][2] ==0)) { MidiSend(noteOn4, 57, velocity); lastD[4][2] =7; } //Write Midi Note Off if ((keysD[4][2] ==1) and (lastD[4][2] ==7)) { MidiSend(noteOff4, 57, velocity); lastD[4][2] =0; } //D58 if ((keysD[4][3] ==0) and (lastD[4][3] ==0)) { MidiSend(noteOn4, 58, velocity); lastD[4][3] =7; } //Write Midi Note Off if ((keysD[4][3] ==1) and (lastD[4][3] ==7)) { MidiSend(noteOff4, 58, velocity); lastD[4][3] =0; } //D59 if ((keysD[4][4] ==0) and (lastD[4][4] ==0)) { MidiSend(noteOn4, 59, velocity); lastD[4][4] =7; } //Write Midi Note Off if ((keysD[4][4] ==1) and (lastD[4][4] ==7)) { MidiSend(noteOff4, 59, velocity); lastD[4][4] =0; } //D60 if ((keysD[4][5] ==0) and (lastD[4][5] ==0)) { MidiSend(noteOn4, 60, velocity); lastD[4][5] =7; } //Write Midi Note Off if ((keysD[4][5] ==1) and (lastD[4][5] ==7)) { MidiSend(noteOff4, 60, velocity); lastD[4][5] =0; } //D61 if ((keysD[5][0] ==0) and (lastD[5][0] ==0)) { MidiSend(noteOn4, 61, velocity); lastD[5][0] =7; } //Write Midi Note Off if ((keysD[5][0] ==1) and (lastD[5][0] ==7)) { MidiSend(noteOff4, 61, velocity); lastD[5][0] =0; } //D62 if ((keysD[5][1] ==0) and (lastD[5][1] ==0)) { MidiSend(noteOn4, 62, velocity); lastD[5][1] =7; } //Write Midi Note Off if ((keysD[5][1] ==1) and (lastD[5][1] ==7)) { MidiSend(noteOff4, 62, velocity); lastD[5][1] =0; } //D63 if ((keysD[5][2] ==0) and (lastD[5][2] ==0)) { MidiSend(noteOn4, 63, velocity); lastD[5][2] =7; } //Write Midi Note Off if ((keysD[5][2] ==1) and (lastD[5][2] ==7)) { MidiSend(noteOff4, 63, velocity); lastD[5][2] =0; } //D64 if ((keysD[5][3] ==0) and (lastD[5][3] ==0)) { MidiSend(noteOn4, 64, velocity); lastD[5][3] =7; } //Write Midi Note Off if ((keysD[5][3] ==1) and (lastD[5][3] ==7)) { MidiSend(noteOff4, 64, velocity); lastD[5][3] =0; } //D65 if ((keysD[5][4] ==0) and (lastD[5][4] ==0)) { MidiSend(noteOn4, 65, velocity); lastD[5][4] =7; } //Write Midi Note Off if ((keysD[5][4] ==1) and (lastD[5][4] ==7)) { MidiSend(noteOff4, 65, velocity); lastD[5][4] =0; } //D66 if ((keysD[5][5] ==0) and (lastD[5][5] ==0)) { MidiSend(noteOn4, 66, velocity); lastD[5][5] =7; } //Write Midi Note Off if ((keysD[5][5] ==1) and (lastD[5][5] ==7)) { MidiSend(noteOff4, 66, velocity); lastD[5][5] =0; } //D67 if ((keysD[6][0] ==0) and (lastD[6][0] ==0)) { MidiSend(noteOn4, 67, velocity); lastD[6][0] =7; } //Write Midi Note Off if ((keysD[6][0] ==1) and (lastD[6][0] ==7)) { MidiSend(noteOff4, 67, velocity); lastD[6][0] =0; } //D68 if ((keysD[6][1] ==0) and (lastD[6][1] ==0)) { MidiSend(noteOn4, 68, velocity); lastD[6][1] =7; } //Write Midi Note Off if ((keysD[6][1] ==1) and (lastD[6][1] ==7)) { MidiSend(noteOff4, 68, velocity); lastD[6][1] =0; } //D69 if ((keysD[6][2] ==0) and (lastD[6][2] ==0)) { MidiSend(noteOn4, 69, velocity); lastD[6][2] =7; } //Write Midi Note Off if ((keysD[6][2] ==1) and (lastD[6][2] ==7)) { MidiSend(noteOff4, 69, velocity); lastD[6][2] =0; } //D70 if ((keysD[6][3] ==0) and (lastD[6][3] ==0)) { MidiSend(noteOn4, 70, velocity); lastD[6][3] =7; } //Write Midi Note Off if ((keysD[6][3] ==1) and (lastD[6][3] ==7)) { MidiSend(noteOff4, 70, velocity); lastD[6][3] =0; } //D71 if ((keysD[6][4] ==0) and (lastD[6][4] ==0)) { MidiSend(noteOn4, 71, velocity); lastD[6][4] =7; } //Write Midi Note Off if ((keysD[6][4] ==1) and (lastD[6][4] ==7)) { MidiSend(noteOff4, 71, velocity); lastD[6][4] =0; } //D72 if ((keysD[6][5] ==0) and (lastD[6][5] ==0)) { MidiSend(noteOn4, 72, velocity); lastD[6][5] =7; } //Write Midi Note Off if ((keysD[6][5] ==1) and (lastD[6][5] ==7)) { MidiSend(noteOff4, 72, velocity); lastD[6][5] =0; } //D73 if ((keysD[7][0] ==0) and (lastD[7][0] ==0)) { MidiSend(noteOn4, 73, velocity); lastD[7][0] =7; } //Write Midi Note Off if ((keysD[7][0] ==1) and (lastD[7][0] ==7)) { MidiSend(noteOff4, 73, velocity); lastD[7][0] =0; } //D74 if ((keysD[7][1] ==0) and (lastD[7][1] ==0)) { MidiSend(noteOn4, 74, velocity); lastD[7][1] =7; } //Write Midi Note Off if ((keysD[7][1] ==1) and (lastD[7][1] ==7)) { MidiSend(noteOff4, 74, velocity); lastD[7][1] =0; } //D75 if ((keysD[7][2] ==0) and (lastD[7][2] ==0)) { MidiSend(noteOn4, 75, velocity); lastD[7][2] =7; } //Write Midi Note Off if ((keysD[7][2] ==1) and (lastD[7][2] ==7)) { MidiSend(noteOff4, 75, velocity); lastD[7][2] =0; } //D76 if ((keysD[7][3] ==0) and (lastD[7][3] ==0)) { MidiSend(noteOn4, 76, velocity); lastD[7][3] =7; } //Write Midi Note Off if ((keysD[7][3] ==1) and (lastD[7][3] ==7)) { MidiSend(noteOff4, 76, velocity); lastD[7][3] =0; } //D77 if ((keysD[7][4] ==0) and (lastD[7][4] ==0)) { MidiSend(noteOn4, 77, velocity); lastD[7][4] =7; } //Write Midi Note Off if ((keysD[7][4] ==1) and (lastD[7][4] ==7)) { MidiSend(noteOff4, 77, velocity); lastD[7][4] =0; } //D78 if ((keysD[7][5] ==0) and (lastD[7][5] ==0)) { MidiSend(noteOn4, 78, velocity); lastD[7][5] =7; } //Write Midi Note Off if ((keysD[7][5] ==1) and (lastD[7][5] ==7)) { MidiSend(noteOff4, 78, velocity); lastD[7][5] =0; } //D79 if ((keysD[8][0] ==0) and (lastD[8][0] ==0)) { MidiSend(noteOn4, 79, velocity); lastD[8][0] =7; } //Write Midi Note Off if ((keysD[8][0] ==1) and (lastD[8][0] ==7)) { MidiSend(noteOff4, 79, velocity); lastD[8][0] =0; } //D80 if ((keysD[8][1] ==0) and (lastD[8][1] ==0)) { MidiSend(noteOn4, 80, velocity); lastD[8][1] =7; } //Write Midi Note Off if ((keysD[8][1] ==1) and (lastD[8][1] ==7)) { MidiSend(noteOff4, 80, velocity); lastD[8][1] =0; } //D81 if ((keysD[8][2] ==0) and (lastD[8][2] ==0)) { MidiSend(noteOn4, 81, velocity); lastD[8][2] =7; } //Write Midi Note Off if ((keysD[8][2] ==1) and (lastD[8][2] ==7)) { MidiSend(noteOff4, 81, velocity); lastD[8][2] =0; } //D82 if ((keysD[8][3] ==0) and (lastD[8][3] ==0)) { MidiSend(noteOn4, 82, velocity); lastD[8][3] =7; } //Write Midi Note Off if ((keysD[8][3] ==1) and (lastD[8][3] ==7)) { MidiSend(noteOff4, 82, velocity); lastD[8][3] =0; } //D83 if ((keysD[8][4] ==0) and (lastD[8][4] ==0)) { MidiSend(noteOn4, 83, velocity); lastD[8][4] =7; } //Write Midi Note Off if ((keysD[8][4] ==1) and (lastD[8][4] ==7)) { MidiSend(noteOff4, 83, velocity); lastD[8][4] =0; } //D84 if ((keysD[8][5] ==0) and (lastD[8][5] ==0)) { MidiSend(noteOn4, 84, velocity); lastD[8][5] =7; } //Write Midi Note Off if ((keysD[8][5] ==1) and (lastD[8][5] ==7)) { MidiSend(noteOff4, 84, velocity); lastD[8][5] =0; } //D85 if ((keysD[9][0] ==0) and (lastD[9][0] ==0)) { MidiSend(noteOn4, 85, velocity); lastD[9][0] =7; } //Write Midi Note Off if ((keysD[9][0] ==1) and (lastD[9][0] ==7)) { MidiSend(noteOff4, 85, velocity); lastD[9][0] =0; } //D86 if ((keysD[9][1] ==0) and (lastD[9][1] ==0)) { MidiSend(noteOn4, 86, velocity); lastD[9][1] =7; } //Write Midi Note Off if ((keysD[9][1] ==1) and (lastD[9][1] ==7)) { MidiSend(noteOff4, 86, velocity); lastD[9][1] =0; } //D87 if ((keysD[9][2] ==0) and (lastD[9][2] ==0)) { MidiSend(noteOn4, 87, velocity); lastD[9][2] =7; } //Write Midi Note Off if ((keysD[9][2] ==1) and (lastD[9][2] ==7)) { MidiSend(noteOff4, 87, velocity); lastD[9][2] =0; } //D88 if ((keysD[9][3] ==0) and (lastD[9][3] ==0)) { MidiSend(noteOn4, 88, velocity); lastD[9][3] =7; } //Write Midi Note Off if ((keysD[9][3] ==1) and (lastD[9][3] ==7)) { MidiSend(noteOff4, 88, velocity); lastD[9][3] =0; } //D89 if ((keysD[9][4] ==0) and (lastD[9][4] ==0)) { MidiSend(noteOn4, 89, velocity); lastD[9][4] =7; } //Write Midi Note Off if ((keysD[9][4] ==1) and (lastD[9][4] ==7)) { MidiSend(noteOff4, 89, velocity); lastD[9][4] =0; } //D90 if ((keysD[9][5] ==0) and (lastD[9][5] ==0)) { MidiSend(noteOn4, 90, velocity); lastD[9][5] =7; } //Write Midi Note Off if ((keysD[9][5] ==1) and (lastD[9][5] ==7)) { MidiSend(noteOff4, 90, velocity); lastD[9][5] =0; } //D91 if ((keysD[10][0] ==0) and (lastD[10][0] ==0)) { MidiSend(noteOn4, 91, velocity); lastD[10][0] =7; } //Write Midi Note Off if ((keysD[10][0] ==1) and (lastD[10][0] ==7)) { MidiSend(noteOff4, 91, velocity); lastD[10][0] =0; } //D92 if ((keysD[10][1] ==0) and (lastD[10][1] ==0)) { MidiSend(noteOn4, 92, velocity); lastD[10][1] =7; } //Write Midi Note Off if ((keysD[10][1] ==1) and (lastD[10][1] ==7)) { MidiSend(noteOff4, 92, velocity); lastD[10][1] =0; } //D93 if ((keysD[10][2] ==0) and (lastD[10][2] ==0)) { MidiSend(noteOn4, 93, velocity); lastD[10][2] =7; } //Write Midi Note Off if ((keysD[10][2] ==1) and (lastD[10][2] ==7)) { MidiSend(noteOff4, 93, velocity); lastD[10][2] =0; } //D94 if ((keysD[10][3] ==0) and (lastD[10][3] ==0)) { MidiSend(noteOn4, 94, velocity); lastD[10][3] =7; } //Write Midi Note Off if ((keysD[10][3] ==1) and (lastD[10][3] ==7)) { MidiSend(noteOff4, 94, velocity); lastD[10][3] =0; } //D95 if ((keysD[10][4] ==0) and (lastD[10][4] ==0)) { MidiSend(noteOn4, 95, velocity); lastD[10][4] =7; } //Write Midi Note Off if ((keysD[10][4] ==1) and (lastD[10][4] ==7)) { MidiSend(noteOff4, 95, velocity); lastD[10][4] =0; } //D96 if ((keysD[10][5] ==0) and (lastD[10][5] ==0)) { MidiSend(noteOn4, 96, velocity); lastD[10][5] =7; } //Write Midi Note Off if ((keysD[10][5] ==1) and (lastD[10][5] ==7)) { MidiSend(noteOff4, 96, velocity); lastD[10][5] =0; } //Write Keyboard C, only for inverted switches, first 32 notes only. /* //C36 if ((keysC[0][0] ==0) and (lastC[0][0] ==0)) { MidiSend(noteOff3, 36, velocity); lastC[0][0] =7; } if ((keysC[0][0] ==1) and (lastC[0][0] ==7)) { MidiSend(noteOn3, 36, velocity); lastC[0][0] =0; } //C37 if ((keysC[1][0] ==0) and (lastC[1][0] ==0)) { MidiSend(noteOff3, 37, velocity); lastC[1][0] =7; } if ((keysC[1][0] ==1) and (lastC[1][0] ==7)) { MidiSend(noteOn3, 37, velocity); lastC[1][0] =0; } //C38 if ((keysC[1][1] ==0) and (lastC[1][1] ==0)) { MidiSend(noteOff3, 38, velocity); lastC[1][1] =7; } //Write Midi Note Off if ((keysC[1][1] ==1) and (lastC[1][1] ==7)) { MidiSend(noteOn3, 38, velocity); lastC[1][1] =0; } //C39 if ((keysC[1][2] ==0) and (lastC[1][2] ==0)) { MidiSend(noteOff3, 39, velocity); lastC[1][2] =7; } //Write Midi Note Off if ((keysC[1][2] ==1) and (lastC[1][2] ==7)) { MidiSend(noteOn3, 39, velocity); lastC[1][2] =0; } //C40 if ((keysC[1][3] ==0) and (lastC[1][3] ==0)) { MidiSend(noteOff3, 40, velocity); lastC[1][3] =7; } //Write Midi Note Off if ((keysC[1][3] ==1) and (lastC[1][3] ==7)) { MidiSend(noteOn3, 40, velocity); lastC[1][3] =0; } //C41 if ((keysC[1][4] ==0) and (lastC[1][4] ==0)) { MidiSend(noteOff3, 41, velocity); lastC[1][4] =7; } //Write Midi Note Off if ((keysC[1][4] ==1) and (lastC[1][4] ==7)) { MidiSend(noteOn3, 41, velocity); lastC[1][4] =0; } //C42 if ((keysC[1][5] ==0) and (lastC[1][5] ==0)) { MidiSend(noteOff3, 42, velocity); lastC[1][5] =7; } //Write Midi Note Off if ((keysC[1][5] ==1) and (lastC[1][5] ==7)) { MidiSend(noteOn3, 42, velocity); lastC[1][5] =0; } //C43 if ((keysC[2][0] ==0) and (lastC[2][0] ==0)) { MidiSend(noteOff3, 43, velocity); lastC[2][0] =7; } //Write Midi Note Off if ((keysC[2][0] ==1) and (lastC[2][0] ==7)) { MidiSend(noteOn3, 43, velocity); lastC[2][0] =0; } //C44 if ((keysC[2][1] ==0) and (lastC[2][1] ==0)) { MidiSend(noteOff3, 44, velocity); lastC[2][1] =7; } //Write Midi Note Off if ((keysC[2][1] ==1) and (lastC[2][1] ==7)) { MidiSend(noteOn3, 44, velocity); lastC[2][1] =0; } //C45 if ((keysC[2][2] ==0) and (lastC[2][2] ==0)) { MidiSend(noteOff3, 45, velocity); lastC[2][2] =7; } //Write Midi Note Off if ((keysC[2][2] ==1) and (lastC[2][2] ==7)) { MidiSend(noteOn3, 45, velocity); lastC[2][2] =0; } //C46 if ((keysC[2][3] ==0) and (lastC[2][3] ==0)) { MidiSend(noteOff3, 46, velocity); lastC[2][3] =7; } //Write Midi Note Off if ((keysC[2][3] ==1) and (lastC[2][3] ==7)) { MidiSend(noteOn3, 46, velocity); lastC[2][3] =0; } //C47 if ((keysC[2][4] ==0) and (lastC[2][4] ==0)) { MidiSend(noteOff3, 47, velocity); lastC[2][4] =7; } //Write Midi Note Off if ((keysC[2][4] ==1) and (lastC[2][4] ==7)) { MidiSend(noteOn3, 47, velocity); lastC[2][4] =0; } //C48 if ((keysC[2][5] ==0) and (lastC[2][5] ==0)) { MidiSend(noteOff3, 48, velocity); lastC[2][5] =7; } //Write Midi Note Off if ((keysC[2][5] ==1) and (lastC[2][5] ==7)) { MidiSend(noteOn3, 48, velocity); lastC[2][5] =0; } //C49 if ((keysC[3][0] ==0) and (lastC[3][0] ==0)) { MidiSend(noteOff3, 49, velocity); lastC[3][0] =7; } //Write Midi Note Off if ((keysC[3][0] ==1) and (lastC[3][0] ==7)) { MidiSend(noteOn3, 49, velocity); lastC[3][0] =0; } //C50 if ((keysC[3][1] ==0) and (lastC[3][1] ==0)) { MidiSend(noteOff3, 50, velocity); lastC[3][1] =7; } //Write Midi Note Off if ((keysC[3][1] ==1) and (lastC[3][1] ==7)) { MidiSend(noteOn3, 50, velocity); lastC[3][1] =0; } //C51 if ((keysC[3][2] ==0) and (lastC[3][2] ==0)) { MidiSend(noteOff3, 51, velocity); lastC[3][2] =7; } //Write Midi Note Off if ((keysC[3][2] ==1) and (lastC[3][2] ==7)) { MidiSend(noteOn3, 51, velocity); lastC[3][2] =0; } //C52 if ((keysC[3][3] ==0) and (lastC[3][3] ==0)) { MidiSend(noteOff3, 52, velocity); lastC[3][3] =7; } //Write Midi Note Off if ((keysC[3][3] ==1) and (lastC[3][3] ==7)) { MidiSend(noteOn3, 52, velocity); lastC[3][3] =0; } //C53 if ((keysC[3][4] ==0) and (lastC[3][4] ==0)) { MidiSend(noteOff3, 53, velocity); lastC[3][4] =7; } //Write Midi Note Off if ((keysC[3][4] ==1) and (lastC[3][4] ==7)) { MidiSend(noteOn3, 53, velocity); lastC[3][4] =0; } //C54 if ((keysC[3][5] ==0) and (lastC[3][5] ==0)) { MidiSend(noteOff3, 54, velocity); lastC[3][5] =7; } //Write Midi Note Off if ((keysC[3][5] ==1) and (lastC[3][5] ==7)) { MidiSend(noteOn3, 54, velocity); lastC[3][5] =0; } //C55 if ((keysC[4][0] ==0) and (lastC[4][0] ==0)) { MidiSend(noteOff3, 55, velocity); lastC[4][0] =7; } //Write Midi Note Off if ((keysC[4][0] ==1) and (lastC[4][0] ==7)) { MidiSend(noteOn3, 55, velocity); lastC[4][0] =0; } //C56 if ((keysC[4][1] ==0) and (lastC[4][1] ==0)) { MidiSend(noteOff3, 56, velocity); lastC[4][1] =7; } //Write Midi Note Off if ((keysC[4][1] ==1) and (lastC[4][1] ==7)) { MidiSend(noteOn3, 56, velocity); lastC[4][1] =0; } //C57 if ((keysC[4][2] ==0) and (lastC[4][2] ==0)) { MidiSend(noteOff3, 57, velocity); lastC[4][2] =7; } //Write Midi Note Off if ((keysC[4][2] ==1) and (lastC[4][2] ==7)) { MidiSend(noteOn3, 57, velocity); lastC[4][2] =0; } //C58 if ((keysC[4][3] ==0) and (lastC[4][3] ==0)) { MidiSend(noteOff3, 58, velocity); lastC[4][3] =7; } //Write Midi Note Off if ((keysC[4][3] ==1) and (lastC[4][3] ==7)) { MidiSend(noteOn3, 58, velocity); lastC[4][3] =0; } //C59 if ((keysC[4][4] ==0) and (lastC[4][4] ==0)) { MidiSend(noteOff3, 59, velocity); lastC[4][4] =7; } //Write Midi Note Off if ((keysC[4][4] ==1) and (lastC[4][4] ==7)) { MidiSend(noteOn3, 59, velocity); lastC[4][4] =0; } //C60 if ((keysC[4][5] ==0) and (lastC[4][5] ==0)) { MidiSend(noteOff3, 60, velocity); lastC[4][5] =7; } //Write Midi Note Off if ((keysC[4][5] ==1) and (lastC[4][5] ==7)) { MidiSend(noteOn3, 60, velocity); lastC[4][5] =0; } //C61 if ((keysC[5][0] ==0) and (lastC[5][0] ==0)) { MidiSend(noteOff3, 61, velocity); lastC[5][0] =7; } //Write Midi Note Off if ((keysC[5][0] ==1) and (lastC[5][0] ==7)) { MidiSend(noteOn3, 61, velocity); lastC[5][0] =0; } //C62 if ((keysC[5][1] ==0) and (lastC[5][1] ==0)) { MidiSend(noteOff3, 62, velocity); lastC[5][1] =7; } //Write Midi Note Off if ((keysC[5][1] ==1) and (lastC[5][1] ==7)) { MidiSend(noteOn3, 62, velocity); lastC[5][1] =0; } //C63 if ((keysC[5][2] ==0) and (lastC[5][2] ==0)) { MidiSend(noteOff3, 63, velocity); lastC[5][2] =7; } //Write Midi Note Off if ((keysC[5][2] ==1) and (lastC[5][2] ==7)) { MidiSend(noteOn3, 63, velocity); lastC[5][2] =0; } //C64 if ((keysC[5][3] ==0) and (lastC[5][3] ==0)) { MidiSend(noteOff3, 64, velocity); lastC[5][3] =7; } //Write Midi Note Off if ((keysC[5][3] ==1) and (lastC[5][3] ==7)) { MidiSend(noteOn3, 64, velocity); lastC[5][3] =0; } //C65 if ((keysC[5][4] ==0) and (lastC[5][4] ==0)) { MidiSend(noteOff3, 65, velocity); lastC[5][4] =7; } //Write Midi Note Off if ((keysC[5][4] ==1) and (lastC[5][4] ==7)) { MidiSend(noteOn3, 65, velocity); lastC[5][4] =0; } //C66 if ((keysC[5][5] ==0) and (lastC[5][5] ==0)) { MidiSend(noteOff3, 66, velocity); lastC[5][5] =7; } //Write Midi Note Off if ((keysC[5][5] ==1) and (lastC[5][5] ==7)) { MidiSend(noteOn3, 66, velocity); lastC[5][5] =0; } //C67 if ((keysC[6][0] ==0) and (lastC[6][0] ==0)) { MidiSend(noteOff3, 67, velocity); lastC[6][0] =7; } //Write Midi Note Off if ((keysC[6][0] ==1) and (lastC[6][0] ==7)) { MidiSend(noteOn3, 67, velocity); lastC[6][0] =0; } */ //Expression Pedal controls //Expression pedal on analog pin A13 to Channel 6 int Cur6 =analogRead(13); int Map6 =map(Cur6, 0, 1023, 0, 127); if (abs(Cur6 - LastPot6)>=8) { MidiSend(chan6,Exp,Map6); LastPot6 =Cur6; } //Expression pedal on analog pin A14 to Channel 7 int Cur7 =analogRead(14); int Map7 =map(Cur7, 0, 1023, 0, 127); if (abs(Cur7 - LastPot7)>=8) { MidiSend(chan7,Exp,Map7); LastPot7 =Cur7; } //Expression pedal on analog pin A15 to Channel 8 int Cur8 =analogRead(15); int Map8 =map(Cur8, 0, 1023, 0, 127); if (abs(Cur8 - LastPot8)>=8) { MidiSend(chan8,Exp,Map8); LastPot8 =Cur8; }}void MidiSend(int one, int two, int three) { Serial.write(one); Serial.write(two); Serial.write(three); }

Schémas

Wiring diagram for 6x11 Matrix keyboards and pedalboard with potentiometer inputsWiring diagram for Bussed keyboards with potentiometer inputs

Processus de fabrication

  1. Certification ISO 26262 pour les composants logiciels
  2. Eclipse Idem 1.0 :Un framework pour les constructeurs de jumeaux numériques
  3. Composants pour les mises à jour logicielles basées sur le cloud dans l'IoT
  4. Solution de découpe pour l'industrie du tapis – Machine de découpe numérique
  5. Stratégies de gestion des actifs numériques
  6. PET chargé de verre pour composants extérieurs automobiles
  7. Trois tendances de la fabrication numérique pour 2020
  8. Planifier pour réussir la transformation numérique
  9. Matériaux pour composants Invar 36