졸업작품/MIDI

Midi Simulation using Proteus

ElectricShock 2013. 1. 7. 11:44

http://www.dutchforce.com/~eforum/index.php?s=a9f8ade386aff94bc71804ddc1b41d24&showtopic=36978&st=0&pid=323933&#entry323933

사용된 프로그램

 

vmpk-0.5.0-win32-setup.exe(Virtual MIDI Piano Keyboard)

 

application.windows_2.zip(◁ Serial MIDI Converter ....Java설치후 이용할것)

Use it after installing Java JDK or JRE

Along this way, The Virtual Key Board can communicate with ATMEGA48 on Proteus.

 


 ▼회로도 & 코드 & 시뮬레이션

참고 PDF 자료

 

9_MIDI_code.pdf

▲요약 내용

Midi message format은 Status Byte와 Data Byte로 구성되어있다.

 


아래 회로와 첨부파일을 기반으로 Proteus를 이용할 것이다.

 

MidiAllPIC16F877A.zip


▼아두이노 기반


 


ARDUINO.TXT (▶링크) 코드의뢰~~


 

Arduino-Diecimila-schematic.pdf(ARDUINO의 계략도)

 

△ 출처 http://www.captaincredible.com/abc/?page_id=1064

필요한 부품들

1. A bootloaded Atmega328 Chip

2. A 7805 5V Regulator or equivelant

3. Two 10μF Capacitors for the Regulator

4. A 10K Resistor

5. A 16MHz Xtal (=Crystal)

6. Two 22pF Capacitors (for the Xtal)

7. A Diode

8. A LED

9. An Optoisolator, I used a 4n28    (광절연소자 = Opto_Isolator = 빛을 따라가는 센서로도 응용가능)

10. Resistors for Optoisolator (100K, 3.3K, 200Ω each)

11.A MIDI DIN Connector

 

 

 








▼통신방식 & 케이블 관련

MIDI Communication

(Musical Instrument Digital Interface)

http://www.tigoe.com/pcomp/code/communication/midi/

 미디는 특정화되있다. for a 통신 프로토콜을 위해

between 디지털 신디사이저 & 디지털 음악 장비사이에서.

.

.

.

MIDI는 시리얼 통신 프로토콜이다.

동작하는 at 31,250 bits per second 에서

(31,250 BaudRate)

각 Byte는 갖고있다. 8개 비트를 (뭐, 다 아는 사실이지만)

Plus, 시작비트 & 종료비트.

 

표준 MIDI 커넥터는 5-pin DIN 커넥터이다.

 

▼MIDI 케이블 Pinout

그리고 보통 모든 커넥터들 on the 디바이스상의

은 암컷이다

디바이스의 모든 커넥터들은 Female Type 이다.

그리고 both 끝단들 of a MIDI 케이블의

은 수컷이다.

MIDI 케이블의 양 끝단은 Male Type 이다.

 

이 하드웨어는 요구한다. (아래것들을 ▽)

2개의 5핀 DIN female jacks,

3개의 220Ω 저항들,

1개의 270Ω 저항,

1개의 1KΩ 저항

1개의 IN914 Diode,

1개의 2N222 NPN 트랜지스터,

1개의 6N138 Opto_Isolator (=광 절연소자) (노이즈를 줄이기위해 사용됬음)

1개의 7404 Hex Inverter.

NOTE!!

The Hex Inverter가 필요하지않을 수도 있다.

만약 시리얼 디바이스가 이미 갖고있다면. the inversion을.

Stamp, BX-24, etc (☜ 7404 Hex Inversioin 필요없다.)

PIC                    (☜ Hex Inversion 필수~ !)

 

 

마지막으로,

여기 더 간단한 회로가있다. for MIDI 출력을 위한

that 잘 동작하는 with Wiring 혹은 Arduino와 함께.

PIC MicroController

BS-2

BASIC ATOM Pro24 (=$49)

Note that...

모든 3개의 마이크로컨트롤러는

보낼수있다. 비반전 시리얼 데이터를

 

△ For Non-inverted serial data

 

Midi Devices

  • Controller (MIDI messages를 보낸다.) --- Keyboard part

  • Receiver (MIDI messages를 받는다.) --- Synthesizer part

 

어느 MIDI 명령어는 구성한다. of at least 최소한 두 바이트로,

● Status Byte

● Data Byte

대부분의 일반 MIDI messages는 갖고있다. 3개의 Bytes를

● Action (Note ON, Note OFF)

● Pitch (plain old musical pitch ::: 평범한 오랜 음악적 피치)

● Velocity (How loud you want the sound to play)

 

MIDI 값은 보통 표현된다. 16진수 표기법(notation)으로.

모든 Status Bytes는 갖고있다. 128값 혹은 그 이상을

이것을 2진수로 생각해보면...

128 = 1000 0000     (10진수 = 2진수)

... Status Byte의 첫 bit는 항상 1이다. (128 ~ 끝까지)

 

Similarly, 모든 Data Bytes는 갖ㅅ고있다. 127값 혹은 그 이하를

...Data Bytes의 첫 bit는 항상 0이다. (127 ~ 0까지)

 

★ 각 MIDI byte는 갖고있다. 범위를

● 0~127 for Data Bytes

● 128~255 for Status Bytes.

Note ON 은 말한다. the Synthesizer에게 to 시작하라고 연주하기를

at 특정한 pitch에 & velocity에;

Note OFF는 말한다. the Synthesizer에게 to 멈추라고 연주하기를

at 특정한 pitch에 & velociry에;

 

Channel Pressure는 유사하다. to Key Pressure에,

하지만 적용한다. 모든 notes를 on a 주어진 채널상에.

 

Pitch Bend는 바꾼다. pitch를 of a note의

that has 이미 연주하는;

●2byte (least significant byte + most significant byte)

= 128 * 128 - 1 = 16,383 (Maximum Bend)

 

Control Changes는 변화들이다. to 특정 컨트롤러들로의

컨트롤러들은 might 또한 택할수있을런지모른다.

a 다른 사운드 뱅크

to 바꾸기위해 사운드를.

 

 

한가지 유용한 컨트롤러는 7B in 16진수이다.

7B = 모든 Note 끄기

연주를 멈출수 없을때 강제종료의 기능 !!!


http://itp.nyu.edu/physcomp/Labs/MIDIOutput