산업 제조
산업용 사물 인터넷 | 산업자재 | 장비 유지 보수 및 수리 | 산업 프로그래밍 |
home  MfgRobots >> 산업 제조 >  >> Manufacturing Technology >> 제조공정

디지털 오르간용 MIDI

구성품 및 소모품

Arduino Mega 2560
× 1
DIN 미디 플러그
× 1
저항 220옴
× 1
USB-A-B 케이블
× 1
AWM 케이블
× 1
남성 헤더 40 위치 1 행(0.1")
× 1
전위차계, 슬라이드
10K 선형
× 1
IDC 소켓
(선택 사항)
× 1
남성/남성 점퍼 와이어
(선택 사항)
× 1

필요한 도구 및 기계

납땜 인두(일반)
납땜 와이어, 무연
납땜 플럭스, 납땜
와이어 스트리퍼, 톱니 모양 플라이어 노즈
플라이어, 측면 절단
플라이어, 평평한 노즈

앱 및 온라인 서비스

Arduino IDE

이 프로젝트 정보

이 프로젝트는 단일 Arduino Mega를 사용하여 매뉴얼과 페달에서 하드웨어 MIDI 메시지를 보내는 데 사용할 수 있도록 오래된 오르간 콘솔을 변환하는 방법을 보여줍니다.

이 프로젝트는 원래 사운드 생성이 아직 손상되지 않은 상태에서 미디 메시지를 전송하려는 시도로 시작되었지만 원래 회로는 리버스 엔지니어링하기가 상당히 어려웠습니다. 코드와 함께 시간을 보낸 후 버스 유형 매뉴얼과 매트릭스 유형 매뉴얼 모두에 대한 코드를 개발했습니다.

참고:

<울>
  • 이 프로젝트는 원래의 키보드 전환이 더 이상 작동하지 않도록 오르간을 수정합니다.
  • <울>
  • 오래된 장기 내부에는 위험할 수 있는 전기 부품이 있습니다. 항상 플러그를 뽑은 상태로 오르간을 작업하고 이 프로젝트를 안전하게 작업할 수 있는 경험과 기술이 있는지 확인하십시오. 확실하지 않은 경우 이 프로젝트를 시도하기 전에 자격을 갖춘 지역 전자 기술자와 상의하십시오.
  • <울>
  • 오래된 장기 내부의 구성 요소는 종종 상당히 오래되어 오작동 직전에 있으므로 개조하면 장기가 손상될 수 있습니다. 여기에 제공된 지침을 따르는 것은 사용자 자신의 책임이며 이 지침을 따르려고 시도한 결과 장기, 장비 또는 사람에게 발생하는 손상에 대해 이 문서의 작성자는 책임을 지지 않습니다.
  • 1단계:장기 검사

    <울>
  • 내가 처음 게시한 코드에서는 수정하려는 오르간에 이미 개별 스위치와 다이오드가 있는 매트릭스 키보드가 있다고 가정했습니다. 첫 번째 버전을 게시한 이후로 버스 키보드 디자인에서 작동하는 코드도 개발했습니다. 지침을 따르고 귀하에게 적용되는 버전의 코드를 사용하십시오(Matrixed vs. Bussed). 그러나 두 디자인 모두 모든 스위치에 연결된 다이오드가 필요합니다. 이들은 저렴하게 얻을 수 있습니다. 그러나 Arduino Mega에 업로드된 코드는 매트릭스형과 버스형 디자인에서 다릅니다.
  • <울>
  • 이 예에서 미디파이된 특정 오르간에는 건반의 경우 NO(Normally Open) 스위치가 있고 페달의 경우 NC(Normally Closed Switch)가 있습니다. 멀티미터를 사용하여 변환하려는 오르간에 어떤 종류의 스위치가 있는지 확인할 수 있습니다. 스위치 유형이 이 오르간에 대해 수행된 것과 다른 경우 스위치 유형에 맞게 코드를 수정해야 합니다(코드에 제공된 예)
  • <울>
  • 건반과 페달보드 접점에 접근하기 위해 오르간을 여는 방법을 파악하고 오르간 내부에 Arduino를 부착할 적절한 장소를 찾습니다. Arduino에 전원을 공급하고 Midi 플러그를 장착하려면 구멍을 뚫거나 플러그를 설치해야 할 수 있습니다. 이 예에서는 3구 전원 플러그를 오르간 내부의 작은 전원 상자에 배선하여 Arduino에 전원을 공급하고 구멍을 뚫고 Midi DIN 플러그를 구멍에 부착했습니다.
  • <울>
  • 여기에 표시된 특정 오르간에는 6x11 매트릭스가 있는 두 개의 키보드와 6x7 매트릭스가 있는 페달보드가 있습니다. 매트릭스 경로를 사용할 계획이고 특정 오르간에 이미 8x8 매트릭스가 있는 경우 8x8 매트릭스에 맞게 코드와 배선을 수정하거나 원래 매트릭스를 6x11 매트릭스를 지원하도록 다시 배선해야 합니다.
  • 2단계:Arduino 연결

    -내 Arduino Mega는 오르간의 나무에 장착할 수 있는 작은 플라스틱 판과 함께 제공됩니다. 나는 작은 #4 나무 나사와 #4 기계 나사로 부착하여 Arduino를 플레이트에 부착했습니다. 각 케이블의 길이를 예상할 수 있도록 Arduino를 먼저 배치하는 것이 좋습니다. 이 시점에서 Arduino에 전원을 공급하는 방법도 찾을 수 있습니다.

    3단계:케이블 준비

    매트릭스 키보드:

    각 키보드에는 61개의 스위치가 있습니다. 여기에 사용된 예에서 각 키보드에는 6개의 행이 있으며 모든 스위치의 첫 번째 터미널에서 다른 모든 스위치 6 스위치의 첫 번째 터미널로 가는 와이어가 있습니다. 그런 다음 스위치의 두 번째 단자는 다이오드로 이동한 다음 열로 이동했으며, 그 중 스위치는 수동용 11개 열과 페달용 7개 열로 나뉩니다. 각 설명서와 페달에 대해 권장되는 AWM 와이어의 두 길이는 각 부분에서 Arduino 보드에 도달하도록 절단해야 합니다. 가급적이면 깔끔하게 정리할 수 있는 경로를 따르고 항상 필요한 것보다 더 많은 여유를 남겨두십시오. 기둥의 경우 아두이노로 가기 전에 키보드나 페달보드의 길이를 케이블로 연장하는 것이 좋습니다. 케이블의 각 길이를 측정하고 크기에 맞게 자릅니다. 작은 니퍼를 사용하여 끝에서 케이블의 개별 가닥을 분리하고 와이어 스트리퍼를 사용하여 와이어 끝을 덮고 있는 플라스틱을 벗겨냅니다.

    버스형 키보드:

    키보드는 61번째 스위치용 일반 와이어와 함께 6개의 AWM 케이블로 나눌 수 있습니다. 끝에서 케이블의 개별 가닥을 분리한 다음 와이어 스트리퍼를 사용하여 끝을 덮고 있는 플라스틱을 벗겨냅니다.

    4단계:수 헤더에 대한 납땜 케이블 끝

    매트릭스형 및 버스형 키보드 모두:적절한 케이블 끝을 수 헤더 핀에 납땜하거나 나사 터미널 보드를 사용하는 경우 나사 터미널에 적절한 케이블을 연결합니다.

    5단계:케이블의 다른 쪽 끝을 스위치에 납땜

    매트릭스 키보드:

    - 오르간에 이미 각 접점이 배선되어 있는 경우 이 프로젝트가 작동하려면 원래 배선을 납땜 제거하거나 잘라야 합니다. 오르간에 6x11 매트릭스가 있는 경우 각 스위치에서 다음 스위치 6 위로 가는 행 와이어를 유지하는 것이 좋습니다. 따라서 6개 중 첫 번째 세트에서 원래 컴퓨터로 가는 행 와이어를 제거하고 6개 행 와이어를 다른 6개가 있던 위치에 납땜합니다. 열의 경우 이미 다이오드가 있는 경우 다이오드의 다른 쪽 끝에서 원래 컴퓨터로 가는 리드를 클립하거나 납땜을 제거한 다음 Arduino로 가는 열 리드를 그 자리에 납땜합니다. 플라스틱 케이블 타이를 사용하여 오르간의 다른 케이블이 흐르는 곳을 따라 깔끔하게 배선되도록 케이블을 정리할 수 있습니다. 위 사진에 있는 오르간의 페달보드의 경우 리드 스위치가 있는 오르간 전면의 패널을 고정하고 있는 나사를 제거하여 제거해야 했으며 케이블은 전면 패널 중앙의 작은 구멍을 통해 배선되었습니다. 오르간.

    버스형 키보드:

    버스형 키보드 코드에서 각 스위치의 버스형이 아닌 쪽에 다이오드를 납땜한 다음 이를 케이블의 10개 와이어 중 하나에 납땜한 다음 6개 케이블 각각에 대해 반복한 다음 마지막 와이어에 대해 반복해야 합니다. (#61)

    6단계:저항을 MIDI 플러그에 납땜하고 다른 리드를 Arduino에 납땜합니다.

    7단계:헤더를 Arduino에 연결

    - 회로도와 같이 모든 헤더를 Arduino에 연결합니다.

    -수 헤더에 와이어를 납땜하는 다른 솔루션은 10개의 핀 IDC 소켓을 구입하여 AWM 케이블의 끝에 연결한 다음 수-수 점퍼를 사용하여 Arduino에 연결하는 것입니다. 이 솔루션은 납땜만큼 영구적이지 않지만, 재배선이 필요한 경우 게시된 코드를 수정하려는 경우 권장됩니다.

    8단계:Arduino에 소프트웨어 업로드

    - Arduino에서 컴퓨터에 USB 케이블을 연결하고 컴퓨터에 Arduino 소프트웨어가 설치되어 있는지 확인합니다. 귀하에게 적용되는 코드 버전을 선택하십시오(Matrixed vs. Bussed). Arduino 소프트웨어를 실행하고 제공된 코드를 복사하여 새 빈 스케치에 붙여넣습니다. Arduino가 USB 직렬을 통해 연결되어 있는지 확인하고 스케치 상단의 "업로드" 버튼을 클릭합니다.

    9단계:테스트

    <울>
  • 아직 연결하지 않았다면 MIDI 어댑터를 컴퓨터에 연결하고 오르간 MIDI 출력을 MIDI 어댑터에 연결합니다.
  • <울>
  • 소프트웨어를 사용하여 미디 신호를 모니터링하고 키를 눌렀을 때 각 키와 페달이 적절한 MIDI 메시지를 보내는지 확인하고 각 키를 누릅니다.
  • <울>
  • 컴퓨터에 연결하지 않고 사용할 계획이라면 아두이노의 전원 포트에 소형 5v 전원을 연결하거나 사용하던 USB 케이블 끝에 USB 전원 플러그를 연결하고 전원을 연결하면 됩니다. 콘센트에 연결하여 Arduino에 전원을 공급합니다.
  • 참고:

    <울>
  • 버스 키보드용으로 게시된 코드는 아직 테스트되지 않았지만 작동할 것으로 예상됩니다. bussed 코드를 시도하고 문제가 있는 경우 댓글에 게시해 주세요.
  • <울>
  • 코드의 버스 버전의 경우 제대로 작동하려면 다이오드가 필요합니다. 또한 스위치에 다이오드를 납땜할 때 음극이 스위치를 향하도록 다이오드를 납땜하는 것이 중요합니다. 매트릭스 디자인의 경우 다이오드의 음극이 스위치에서 떨어져 있어야 합니다.
  • <울>
  • 버스 디자인을 추가하는 것 외에도 익스프레션 페달에 사용되는 것과 같은 전위차계를 포함하도록 원래 디자인과 코드도 업데이트했습니다.
  • <울>
  • 버스 디자인이 핀 13에서 제대로 작동하려면 Arduino의 내장 LED를 어떻게든 비활성화해야 합니다. 이렇게 하려면 두 개의 인두를 사용하여 제거하거나 끝이 가는 펜치를 사용하여 조심스럽게 부수십시오.
  • <울>
  • 버스 디자인은 버스 키보드가 있는 많은 오르간에서 작동하지만 버스가 "인청동" 재질로 만들어진 경우 안정적으로 작동하지 않을 수 있습니다. 단일 매뉴얼에 대한 모든 버스를 함께 배선하고 단일 키에 대한 모든 접점을 함께 배선하면 간헐적 접촉을 방지하는 데 도움이되지만 인청동 버스 바의 경우 12V 키잉을 사용하는 것이 좋습니다(이 프로젝트에서는 할 것).
  • 전위차계용 익스프레션 페달 하드웨어

    앞으로 이에 대한 자세한 내용을 추가하고 싶지만 지금은 위에서 본 디자인에 대해 간략하게 설명하겠습니다. 익스프레션 페달에 대한 연결은 지역 철물점에서 구입할 수 있는 저렴한 "L" 브래킷입니다. 여기에 기존 브라켓과 연결하는 방식이지만 페달에 직접 부착된 두 번째 L 브라켓도 사용할 수 있다. 그것은 잠금 너트와 2개의 와셔를 사용하여 약간 느슨하게 유지되는 기계 나사에서 연결됩니다. 사진에서는 아주 긴 기계 나사를 사용했는데 그렇게 긴 나사는 필요하지 않고 그냥 손에 쥐고 있던 것입니다. 금속 막대의 경우 "JB 용접"을 사용하여 한쪽 끝에 아이 볼트를 부착하고 적절한 크기의 작은 나사를 사용하여 다른 쪽 끝에 "L" 브래킷에 부착했습니다.

    전위차계 마운트 자체의 경우 투명 아크릴 시트를 구입하여 취미용 칼로 깎은 다음 펜치와 클램프를 사용하여 선을 따라 잘라냈습니다. 전위차계를 부착하기 위해 작은 아크릴 조각을 만들어 큰 조각에서 높이를 높이고 작은 아크릴 조각의 표면을 샌딩하고 장착할 전위차계의 표면을 샌딩하고 더 큰 조각의 표면을 모든 것을 부착한 다음 JB 용접을 적용하고 JB 용접이 마를 때까지 모든 것을 함께 유지하기 위해 작은 클램프를 사용했습니다. 아크릴 조각의 구멍은 전기 드릴과 표준 드릴 비트로 뚫었습니다.

    더 큰 아크릴 조각의 바닥은 #4 기계 나사를 사용하여 작은 가구 경첩에 고정되고 가구 경첩의 다른 쪽 끝은 짧은 #4 나무 나사를 사용하여 오르간 바닥에 부착됩니다. 가구 경첩을 나무 바닥에 고정하기 위해 아크릴 브래킷을 만들었는데 가구 경첩의 디자인에 따라 필요하지 않을 수도 있습니다.

    막대가 미끄러지는 흰색 블록은 로봇 부품 공급 업체에서 구입 한 PFTE 블록입니다. 조각은 취미용 톱을 사용하여 더 큰 조각을 자르고 전기 드릴과 다른 크기의 드릴 비트를 사용하여 세 개의 구멍을 뚫었습니다. PFTE 블록은 기계 나사를 사용하여 아크릴 브래킷에 부착되었습니다.

    익스프레션 페달 브래킷에 대한 자세한 지침:

    (2021년 12월 9일 업데이트)

    -8x10인치 아크릴 시트

    - 테프론 블록

    -알루미늄 막대(1/4인치, 지역 철물점 또는 금속 상점에서 구입 가능)

    -JB 용접

    -선형 전위차계

    -작은 가구 경첩

    -작은 가구 버팀대

    -작은 아이볼트

    -짧은 #4 나무 나사

    -다양한 하드웨어:

    -잠금 와셔 X1(테플론 권장) 및 페달에 부착할 일치하는 기계 나사(현재 페달과 일치하는 지름 및 길이)

    - 아크릴판에 테프론을 고정하기 위한 기계나사 2개, 와셔 4개, 너트 2개(직경과 길이는 천공된 구멍의 직경에 따라 다름)

    -1/4알루미늄 봉에 브레이스를 부착하기 위한 작은 나사(내부 구멍의 크기에 따라 직경이 다름)

    - 아크릴 시트 바닥에 경첩을 부착하기 위한 기계 나사 x2, 와셔 x4 및 너트 x2.

    도구:

    -취미용 칼

    -스트레이트 에지

    -보석용 드라이버/일반 드라이버(가장 작은 나사용 보석상)

    -초승달 렌치(기계 나사와 너트를 조이기 위해)

    -플라이어

    - 전기 드릴 및 드릴 비트.

    -취미 톱

    -벤치 탑 바이스

    -작은 나무 클램프

    -고운 모래 사포

    - 아이스 캔디와 스크랩 판지.

    -젖은 천

    지침:

    -현재 페달을 검사하십시오. 마운팅 브래킷에 여분의 구멍이 있으면 그것을 사용할 수 있습니다. 그렇지 않으면 사용중인 기존 구멍을 사용할 수 있으며 현재보다 더 길지만 여전히 구멍에 맞는 작은 나사를 얻을 수 있습니다.

    - 오르간의 나무 바닥에 부품이나 전자 제품이 없는지 확인하고 필요한 경우 이동합니다.

    -아크릴 시트의 포장을 풀고 직선 모서리와 취미용 칼을 사용하여 시트의 양면을 3" x 4.5" 직사각형으로 깎은 다음 득점 선을 따라 균열을 가하여 벤치 탑 바이스와 펜치를 사용하여 자릅니다. 눈 보호 장치를 사용하십시오!). 또한 3" x 0.5" 조각과 2.4" x 0.3" 조각을 자릅니다.

    - 취미용 톱을 사용하여 테프론 블록을 끝에서 약 3/4" 잘라서 3' x 1.5' x 3/4인치 블록을 만듭니다.

    - 대형 아크릴 시트의 하단 가장자리를 따라 2개의 구멍을 뚫어 가구 경첩의 한쪽 면과 일치하도록 하고, 테프론 블록의 3x1.5인치 면에 2개의 구멍을 뚫어 경로에 방해가 되지 않도록 합니다. 알루미늄 막대가 그것을 통해 걸릴 것입니다. 블록이 큰 아크릴 시트의 상단에 위치하는 경우 테프론 블록의 구멍과 일치하는 2개의 구멍을 뚫습니다. 이전에 뚫은 구멍 맞은편, 테프론 블록의 가장자리가 아크릴의 가장자리 오른쪽에 오도록 합니다. 또한 2.4" x 0.3" 조각에 2개의 구멍을 뚫어 경첩 반대쪽의 구멍과 일치하도록 합니다.

    -전위차계의 한 면과 접착할 대형 아크릴 시트의 영역, 3x0.5” 아크릴 조각의 양면을 부드럽게 사포질합니다. 젖은 천으로 표면을 닦습니다.

    -팝시클 스틱을 사용하여 스크랩 판지에 JB 용접을 섞은 다음 아크릴 시트의 준비된 표면에 적용합니다. 3x0.5" 조각을 추가한 다음 JB 용접을 추가한 다음 전위차계를 추가하여 JB 용접이 샌딩된 표면에 부착되었는지 확인합니다. 작은 나무 클램프로 어셈블리를 부드럽게 고정하고 24시간 동안 경화되도록 둡니다.

    - 테플론 블록의 3/4x3인치 면에서 다른 면으로 블록에 있는 동안 1/4인치 드릴 비트를 사용하여 1/4인치보다 약간 큰 구멍을 뚫습니다. 알루미늄 막대의 선이 전위차계의 이동 선과 일치하도록 드릴로 뚫습니다.

    -완전히 밟았을 때 포텐셔미터 바닥에서 익스프레션 페달까지 대략 정확한 길이가 되도록 1/4인치 알루미늄 막대를 자릅니다.

    -JB 용접이 경화되면 기계 나사, 와셔 및 너트를 사용하여 큰 아크릴 판의 측면에 힌지와 테프론 블록을 부착합니다. 포텐셔미터의 가동부에 아이볼트를 끼우고 테프론 블록을 통과하는 1/4인치 알루미늄 막대에 부착합니다. 핏이 약간 헐렁한 경우 이전 단계에서 JB 용접을 적용할 때 아이볼트를 알루미늄 로드에 JB 용접할 수도 있습니다. 이 경우 아이볼트를 전위차계에 끼우고 테프론 블록을 통해 이동한 다음 테프론 블록을 기계 나사로 아크릴 판에 부착해야 합니다.

    - 아이볼트를 펜치로 올바른 위치에 고정한 상태에서 올바른 크기의 작은 나사를 사용하여 1/4인치 알루미늄 막대의 다른 쪽 끝에 가구 버팀대를 부착합니다. 조일 때 아이 볼트가 가구 버팀대에 올바른 방향인지 확인하십시오.

    - 전위차계 브라켓에 빈 구멍이 있으면 새 기계나사를 끼우고 테프론 잠금 와셔를 끼우고 가구 브라켓이 자유롭게 움직일 때까지 조입니다. 기존의 기계 나사가 사용하던 기존 구멍을 사용할 경우 기존 나사를 제거하고 더 긴 새 나사를 삽입하여 기존과 같이 부착한 후 여분의 길이에 가구 브래킷과 테프론 잠금 와셔를 추가합니다.

    - 1/4인치 알루미늄 막대가 일직선이 되는 위치가 될 때까지 오르간 내부 바닥에 있는 경첩 바닥을 앞뒤로 움직이고, 가장 작은 아크릴 판을 제자리에 놓고 페달을 움직입니다. 전위차계의 움직임을 가장 잘 근사합니다. 2개의 작은 나무 나사를 사용하여 전위차계 마운트의 바닥을 오르간 바닥에 부착하고 아크릴 판이 경첩과 나무 사이에 있는지 확인합니다(경첩의 적절한 이동을 보장함).

    마지막 메모:

    Arduino 프로젝트 허브에는 여기에 배치된 게시물 및 질문에 대한 알림이 없는 것 같습니다. 귀하의 질문에 대한 더 빠른 답변을 원하시면 이 포럼 페이지에 질문을 올려주시면 알려드리겠습니다.

    <섹션 클래스="섹션 컨테이너 섹션 축소 가능" id="코드">

    코드

    <울>
  • 매트릭스 키보드 코드
  • 버스 키보드 코드
  • 매트릭스 키보드 코드Arduino
    Matrixed Keyboard Schematic을 따를 때 Arduino에 업로드할 코드.
    // Name:Arduino Mega Midi Controller v21// Created:2021년 2월 4일// Author:Larason2// 감사의 말: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 velocity =100;int chan6 =181;int chan7 =182; int Exp =11;int LastPot6 =1;int LastPot7 =1;void setup() { // 직렬 시작 Serial.begin(31250); //키보드 A 초기화 pinMode(2, INPUT); 핀모드(22, 입력); 핀모드(24, 입력); 핀모드(26, 입력); 핀모드(28, 입력); 핀모드(30, 입력); 핀모드(32, 입력); 핀모드(34, 입력); 핀모드(36, 입력); 핀모드(38, 입력); 핀모드(40, 입력); 핀모드(42, 입력); 핀모드(44, 입력); 핀모드(46, 입력); 핀모드(48, 입력); 핀모드(50, 입력); 핀모드(52, 입력); //키보드 B 초기화 pinMode(3, INPUT); 핀모드(23, 입력); 핀모드(25, 입력); 핀모드(27, 입력); 핀모드(29, 입력); 핀모드(31, 입력); 핀모드(33, 입력); 핀모드(35, 입력); 핀모드(37, 입력); 핀모드(39, 입력); 핀모드(41, 입력); 핀모드(43, 입력); 핀모드(45, 입력); 핀모드(47, 입력); 핀모드(49, 입력); 핀모드(51, 입력); 핀모드(52, 입력); //키보드 C 초기화 pinMode(A2, INPUT); 핀모드(A3, 입력); 핀모드(A4, 입력); 핀모드(A5, 입력); 핀모드(A6, 입력); 핀모드(A7, 입력); 핀모드(A8, 입력); 핀모드(A9, 입력); 핀모드(A10, 입력); 핀모드(A11, 입력); 핀모드(A12, 입력); 핀모드(A13, 입력); pinMode(A14, INPUT);}void loop() { // 키보드 A 읽기 pinMode(22, INPUT_PULLUP); 핀모드(24, INPUT_PULLUP); 핀모드(26, INPUT_PULLUP); 핀모드(28, INPUT_PULLUP); 핀모드(30, INPUT_PULLUP); 핀모드(2, INPUT_PULLUP); 핀모드(32, 출력); 디지털 쓰기(32, LOW); 키A[0][0] =디지털 읽기(2); 핀모드(32, 입력); 핀모드(34, 출력); 디지털 라이트(34, LOW); 키A[1][0] =디지털 읽기(22); 키A[1][1] =디지털 읽기(24); 키A[1][2] =디지털 읽기(26); 키A[1][3] =디지털 읽기(28); 키A[1][4] =디지털 읽기(30); 키A[1][5] =디지털 읽기(2); 핀모드(34, 입력); 핀모드(36, 출력); 디지털 쓰기(36, 낮음); 키A[2][0] =디지털 읽기(22); 키A[2][1] =디지털 읽기(24); 키A[2][2] =디지털 읽기(26); 키A[2][3] =디지털 읽기(28); 키A[2][4] =디지털 읽기(30); 키A[2][5] =디지털 읽기(2); 핀모드(36, 입력); 핀모드(38, 출력); 디지털 쓰기(38, 낮음); 키A[3][0] =디지털 읽기(22); 키A[3][1] =디지털 읽기(24); 키A[3][2] =디지털 읽기(26); 키A[3][3] =디지털 읽기(28); 키A[3][4] =디지털 읽기(30); 키A[3][5] =디지털 읽기(2); 핀모드(38, 입력); 핀모드(40, 출력); 디지털 쓰기(40, 낮음); 키A[4][0] =디지털 읽기(22); 키A[4][1] =디지털 읽기(24); 키A[4][2] =디지털 읽기(26); 키A[4][3] =디지털 읽기(28); 키A[4][4] =디지털 읽기(30); 키A[4][5] =디지털 읽기(2); 핀모드(40, 입력); 핀모드(42, 출력); 디지털 쓰기(42, 낮음); 키A[5][0] =디지털 읽기(22); 키A[5][1] =디지털 읽기(24); 키A[5][2] =디지털 읽기(26); 키A[5][3] =디지털 읽기(28); 키A[5][4] =디지털 읽기(30); 키A[5][5] =디지털 읽기(2); 핀모드(42, 입력); 핀모드(44, 출력); 디지털 쓰기(44, 낮음); 키A[6][0] =디지털 읽기(22); 키A[6][1] =디지털 읽기(24); 키A[6][2] =디지털 읽기(26); 키A[6][3] =디지털 읽기(28); 키A[6][4] =디지털 읽기(30); 키A[6][5] =디지털 읽기(2); 핀모드(44, 입력); 핀모드(46, 출력); 디지털 쓰기(46, 낮음); 키A[7][0] =디지털 읽기(22); 키A[7][1] =디지털 읽기(24); 키A[7][2] =디지털 읽기(26); 키A[7][3] =디지털 읽기(28); 키A[7][4] =디지털 읽기(30); 키A[7][5] =디지털 읽기(2); 핀모드(46, 입력); 핀모드(48, 출력); 디지털 쓰기(48, 낮음); 키A[8][0] =디지털 읽기(22); 키A[8][1] =디지털 읽기(24); 키A[8][2] =디지털 읽기(26); 키A[8][3] =디지털 읽기(28); 키A[8][4] =디지털 읽기(30); 키A[8][5] =디지털 읽기(2); 핀모드(48, 입력); 핀모드(50, 출력); 디지털 쓰기(50, 낮음); 키A[9][0] =디지털 읽기(22); 키A[9][1] =디지털 읽기(24); 키A[9][2] =디지털 읽기(26); 키A[9][3] =디지털 읽기(28); 키A[9][4] =디지털 읽기(30); 키A[9][5] =디지털 읽기(2); 핀모드(50, 입력); 핀모드(52, 출력); 디지털 쓰기(52, 낮음); 키A[10][0] =디지털 읽기(22); 키A[10][1] =디지털 읽기(24); 키A[10][2] =디지털 읽기(26); 키A[10][3] =디지털 읽기(28); 키A[10][4] =디지털 읽기(30); 키A[10][5] =디지털 읽기(2); 핀모드(52, 입력); 핀모드(22, 입력); 핀모드(24, 입력); 핀모드(26, 입력); 핀모드(28, 입력); 핀모드(30, 입력); 핀모드(2, 입력); // B 키보드 읽기 pinMode(23, INPUT_PULLUP); 핀모드(25, INPUT_PULLUP); 핀모드(27, INPUT_PULLUP); 핀모드(29, INPUT_PULLUP); 핀모드(31, INPUT_PULLUP); 핀모드(3, INPUT_PULLUP); 핀모드(33, 출력); 디지털 쓰기(33, 낮음); 키B[0][0] =디지털 읽기(3); 핀모드(33, 입력); 핀모드(35, 출력); 디지털 쓰기(35, 낮음); 키B[1][0] =디지털 읽기(23); 키B[1][1] =디지털 읽기(25); 키B[1][2] =디지털 읽기(27); 키B[1][3] =디지털 읽기(29); 키B[1][4] =디지털 읽기(31); 키B[1][5] =디지털 읽기(3); 핀모드(35, 입력); 핀모드(37, 출력); 디지털 쓰기(37, 낮음); 키B[2][0] =디지털 읽기(23); 키B[2][1] =디지털 읽기(25); 키B[2][2] =디지털 읽기(27); 키B[2][3] =디지털 읽기(29); 키B[2][4] =디지털 읽기(31); 키B[2][5] =디지털 읽기(3); 핀모드(37, 입력); 핀모드(39, 출력); 디지털 쓰기(39, 낮음); 키B[3][0] =디지털 읽기(23); 키B[3][1] =디지털 읽기(25); 키B[3][2] =디지털 읽기(27); 키B[3][3] =디지털 읽기(29); 키B[3][4] =디지털 읽기(31); 키B[3][5] =디지털 읽기(3); 핀모드(39, 입력); 핀모드(41, 출력); 디지털 쓰기(41, 낮음); 키B[4][0] =디지털 읽기(23); 키B[4][1] =디지털 읽기(25); 키B[4][2] =디지털 읽기(27); 키B[4][3] =디지털 읽기(29); 키B[4][4] =디지털 읽기(31); 키B[4][5] =디지털 읽기(3); 핀모드(41, 입력); 핀모드(43, 출력); 디지털 쓰기(43, 낮음); 키B[5][0] =디지털 읽기(23); 키B[5][1] =디지털 읽기(25); 키B[5][2] =디지털 읽기(27); 키B[5][3] =디지털 읽기(29); 키B[5][4] =디지털 읽기(31); 키B[5][5] =디지털 읽기(3); 핀모드(43, 입력); 핀모드(45, 출력); 디지털 쓰기(45, 낮음); 키B[6][0] =디지털 읽기(23); 키B[6][1] =디지털 읽기(25); 키B[6][2] =디지털 읽기(27); 키B[6][3] =디지털 읽기(29); 키B[6][4] =디지털 읽기(31); 키B[6][5] =디지털 읽기(3); 핀모드(45, 입력); 핀모드(47, 출력); 디지털 쓰기(47, 낮음); 키B[7][0] =디지털 읽기(23); 키B[7][1] =디지털 읽기(25); 키B[7][2] =디지털 읽기(27); 키B[7][3] =디지털 읽기(29); 키B[7][4] =디지털 읽기(31); 키B[7][5] =디지털 읽기(3); 핀모드(47, 입력); 핀모드(49, 출력); 디지털 쓰기(49, 낮음); 키B[8][0] =디지털 읽기(23); 키B[8][1] =디지털 읽기(25); 키B[8][2] =디지털 읽기(27); 키B[8][3] =디지털 읽기(29); 키B[8][4] =디지털 읽기(31); 키B[8][5] =디지털 읽기(3); 핀모드(49, 입력); 핀모드(51, 출력); 디지털 쓰기(51, 낮음); 키B[9][0] =디지털 읽기(23); 키B[9][1] =디지털 읽기(25); 키B[9][2] =디지털 읽기(27); 키B[9][3] =디지털 읽기(29); 키B[9][4] =디지털 읽기(31); 키B[9][5] =디지털 읽기(3); 핀모드(51, 입력); 핀모드(53, 출력); 디지털 쓰기(53, 낮음); 키B[10][0] =디지털 읽기(23); 키B[10][1] =디지털 읽기(25); 키B[10][2] =디지털 읽기(27); 키B[10][3] =디지털 읽기(29); 키B[10][4] =디지털 읽기(31); 키B[10][5] =디지털 읽기(3); 핀모드(53, 입력); 핀모드(23, 입력); 핀모드(25, 입력); 핀모드(27, 입력); 핀모드(29, 입력); 핀모드(31, 입력); 핀모드(3, 입력); // 키보드 C 읽기 // 행 핀을 읽도록 설정 pinMode(A3, INPUT_PULLUP); 핀모드(A4, INPUT_PULLUP); 핀모드(A5, INPUT_PULLUP); 핀모드(A6, INPUT_PULLUP); 핀모드(A7, INPUT_PULLUP); 핀모드(A2, INPUT_PULLUP); 핀모드(A8, 출력); 디지털 쓰기(A8, LOW); 키C[0][0] =디지털 읽기(A2); 핀모드(A8, 입력); 핀모드(A9, 출력); 디지털 쓰기(A9, LOW); 키C[1][0] =디지털 읽기(A3); 키C[1][1] =디지털 읽기(A4); 키C[1][2] =디지털 읽기(A5); 키C[1][3] =디지털 읽기(A6); 키C[1][4] =디지털 읽기(A7); 키C[1][5] =디지털 읽기(A2); 핀모드(A9, 입력); 핀모드(A10, 출력); 디지털 쓰기(A10, LOW); 키C[2][0] =디지털 읽기(A3); 키C[2][1] =디지털 읽기(A4); 키C[2][2] =디지털 읽기(A5); 키C[2][3] =디지털 읽기(A6); 키C[2][4] =디지털 읽기(A7); 키C[2][5] =디지털 읽기(A2); 핀모드(A10, 입력); 핀모드(A11, 출력); 디지털 쓰기(A11, LOW); 키C[3][0] =디지털 읽기(A3); 키C[3][1] =디지털 읽기(A4); 키C[3][2] =디지털 읽기(A5); 키C[3][3] =디지털 읽기(A6); 키C[3][4] =디지털 읽기(A7); 키C[3][5] =디지털 읽기(A2); 핀모드(A11, 입력); 핀모드(A12, 출력); 디지털 쓰기(A12, LOW); 키C[4][0] =디지털 읽기(A3); 키C[4][1] =디지털 읽기(A4); 키C[4][2] =디지털 읽기(A5); 키C[4][3] =디지털 읽기(A6); 키C[4][4] =디지털 읽기(A7); 키C[4][5] =디지털 읽기(A2); 핀모드(A12, 입력); 핀모드(A13, 출력); 디지털 쓰기(A13, LOW); 키C[5][0] =디지털 읽기(A3); 키C[5][1] =디지털 읽기(A4); 키C[5][2] =디지털 읽기(A5); 키C[5][3] =디지털 읽기(A6); 키C[5][4] =디지털 읽기(A7); 키C[5][5] =디지털 읽기(A2); 핀모드(A13, 입력); 핀모드(A14, 출력); 디지털 쓰기(A14, LOW); 키C[6][0] =디지털 읽기(A3); 핀모드(A14, 입력); 핀모드(A3, 입력); 핀모드(A4, 입력); 핀모드(A5, 입력); 핀모드(A6, 입력); 핀모드(A7, 입력); 핀모드(A2, 입력); //키보드 C 데이터 반전 //(보통 닫혀 있는 스위치의 경우) //열 1 if (keysC[0][0] ==0) { keysC[0][0] =1; } else if (keysC[0][0] ==1) { keysC[0][0] =0; } //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) { 키C[1][1] =1; } else if (keysC[1][1] ==1) { keysC[1][1] =0; } if (keysC[1][2] ==0) { 키C[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(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, INPUT); 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, INPUT); 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); }

    회로도

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

    제조공정

    1. 소프트웨어 구성 요소에 대한 ISO 26262 인증
    2. Eclipse Ditto 1.0:디지털 트윈 빌더를 위한 프레임워크
    3. IoT의 클라우드 기반 소프트웨어 업데이트를 위한 구성요소
    4. 카펫 산업용 절단 솔루션 – 디지털 절단기
    5. 디지털 자산 관리 전략
    6. UL:플라스틱 부품의 가연성 테스트
    7. 자동차 외장 부품용 유리 충전 PET
    8. 2020년의 3가지 디지털 제조 동향
    9. 디지털 혁신의 성공을 위한 계획
    10. Invar 36 구성 요소용 자료