First, guidance professor and the author
Professor guidance: Tour Guizhong teacher
Tour Guizhong Teacher is currently serving as the special teacher of the Truth University.
Perform a national sector plan. After graduating from the doctoral degree from the Central University,
Zhang Zhiyong, director of the capital department, hired Truth. Teacher once said
Over: "The expertise of this study is basically, that is what the meeting, everyone
The same is true, but the foreign language is really good, it is very important,
Nowadays, Taiwan has a great ability to win others.
The field of tourism learned is an image.
Processing, graphical identification, wireless network
aspect.
Author group: The capital department four A Peng Wenyu - I am a transfer student, it is ahead of entering the university.
The students of the five special works, reading the electronics, the direction of learning is relatively biased toward hardware and practice operations. Enter
After the university, it is only comparable to the theory and software applications due to the understanding of the understanding and electronics.
So, so there is no pressure to learn.
资 系 系 四 b 系 系 系 系 系 系 系 系 系 系 系
资 系 系 系 系 系 系 系 系 系 系 系 系 系 系 系 系
Second, the author's order:
At first we study the feasibility of adding floating watermarks in MIDI, found that MIDI header can be hooded
The space is too small, so it will be taken to the speech (WAV) identification.
In humans
Sound identification, due to people
There are many voices, sometimes even the same person's
sound
The ears are not necessarily distinguished, and although people can distinguish from different people.
Sound, but the computer is calculated
Analyze the characteristic value, then you can distinguish
Sound, so naturally not a human ear in terms of identification ability.
greasy.
Enter one
When we can use some mathematical operations
Sound
Process, then
Basic base in the library
Voice value comparison, control
Whether the sound is better than others
The sound is closer
this
Sound, then identify if it is the same person
sound.
in
The sound identification is not easy, because the tone is slow, and the frequency is constant, the energy is constant;
From this to identify
The possibility of sound. Finally found
A person with a particular sound feature,
Sound identification
High. Future school brothers can test different microphone tests
Sound difference, or seek more accurate identification
Method, make more complete
Sound identification system.
Third, the card history
Peng Wenyu: The topic of the three semester is finally ended, and many out of these three semes.
What is expected from me, during the period, experience the special teacher, replace the group, and replace the size event.
At first, I was working with Chen Yumei and a few classmates who were in the same class.
There is no big problem at the beginning, I put my mind in the learning database SQL and new program language.
On Java, in order to understand the database SQL, refer to some relevant books, it has been reported to the end of the semester.
At the time, I found that the classmates in the topic concept is not too consistent, so I chose the group.
I didn't think I would like to replace the question of the special teacher, but I thought that I can
What kind of topic is done alone? This seems to be difficult. Then and several more than a few talks exchanged each other.
After the experience, I decided to join them and their same group, change new group, new topic, new teacher, new
Departure.
In the new field, there are many new knowledge that I have never been touched, such as the so-called float.
Watermark,
Sound files, etc., these are waiting for me to learn. We will focus on the topic
Voice analysis,
So learning
The format and data type of the sound is my first homework, the second homework is to use the program.
Read
Sound file, learning
In the process of sound mapping, it is not so smooth, exchange us on the opinion
Slowly there have a bad communication, this problem also caused my learning to be interrupted, but fortunately
Wipe, or after the semester.
In the third semester, our group members have some more, but the topic still continues the topic of the last semester.
No more. When the semester started, I really had a little stunned for this topic. I don't know how to continue doing.
Go down, later, and Tour Guizhong talked about our ideas to set the work of this semester.
The progress of the overall topic does not have a fast, so I feel that I feel on the content and other groups.
Less less, but we are still very hard to do the topic, I hope this semester will end smoothly.
Chen Yunqu: Before the participation of the topic, the heart is really a bit fear. In the first semester, it is
The study of floating watermarks, in the process of studying the floating water print Paper, as if it is back to me
At the beginning of the first high-vocational hospital, many English words must be checked by the dictionary, and finally, the only translation, but the only one
Different parts are, there are many computer-specific nouns, making it difficult to understand, these are the first semester.
Things. In the second semester, we changed the topic, the title turned "
Sound write system, and Huiqi
Look at Paper, learn together
Matlab and use the Goldwave this soft body record
Sound, learning
On MATLAB, in addition to the application teacher, there are some functions and conversions to go back.
Book test; the most fun is to recording, many students have been recorded by us to Huiqi, after recording,
Listen to the sound of your own record, and read these
The sound file uses our previous
Matlab is formalization (in all people,
The sound array is the longest length, taking the number, to make a complement 0
Action), then make Fourier conversion, write automation, showing wave type. The third semester, continuation
The content of the second semester is mainly using Java's system, except for the use of last semester.
MATLAB technology
Outside (after Fourier conversion, the result is a TXT file), and 2, 3 Java small rules will be written.
The data of the TXT file is operational, first of all the two or two of each person
The sound is plus, and there is a value, then
These values are the operation between distances, and the results discover their own and their own values, the distance is relatively close,
This will reach the results we want, although the content you have made is less than other groups, but always
I feel that I have improved more than one progress, this is a place I feel very happy; but do the topic, it is really very
Hard work, it is also a very pressure, I hope this semester will end smoothly.
Chen Huiqi: Honestly
The problem of sound is very awkward, after all, unlike images, you can see
Also touched,
If the sound passes, it is gone, how to study it is really a big question. Then three semesters,
After some storms, I also walked to this point, it is really moving. Everyone is very serious
A topic, it is also because of the topic, our feelings are also very good. Finally, some results come out
I am very happy, after all, I want to identify who is
The sound is not easy, but it is very glad to help the teacher.
I have a little clue. In addition, we have a lot of difficulties in the program, after all, the program is not strong in the topic.
It's very hard, but fortunately, it's more. The SQL database can be more complete and provided.
The user's more humane function, and the functions of Java and SQL are very powerful, which can be described as future trends.
It is, it is necessary to rely on learning brothers to improve the identification ability of this system.
Fourth, background motivation
Explore the addition of digital floating watermarks - because the piracy is rampant, how to use the floating watermark,
To protect the effect of smart property rights. This is the case of Taiwanese music, the big subsidy, there should be an impedance role;
Simple replication is to copy the original file with bit-to-bit, simple and cost-to-life;
The low-cost distribution of online networks, samples, and information will have new problems. Digital floating watermarks have been applied to music
On the CD, the user can't transcribes to the computer, although the copyright controls some music, but consumers are not
Often dissatisfied with money, I bought the CD but I can't easily listen to songs, and Audio Data should let file users can depend
I am used to using it.
Therefore, how to join, how to add a plurality of floating watermarks is the technology that is not stunned.
Leave in the whole environment will lose control, and there are some IPRs (Intellectual property Rights wisdom
Property rights) Protection, like well-known floating watermark technology, put the IPR's related information in the archive.
discuss
Sound identification system - At present, Taiwan's social soup is uneasy, and there are several social news, and no trouble.
Everyone is worried about whether the home is safe, and the home is not a safe place?
Set
The sound can enter the voice identification system in the house, and it is necessary to protect the lives and property of the people.
There is a great helpful, and Mr. Police does not have to tired of running the prisoner. Study the visual accepted access control system, prevent
The warming of crime and other crimes can ensure the safety of life and property of everyone.
In addition, there are many home appliances on the market, and also tried to use voice control to increase the use.
Convenience.
It can be seen that the speech identification is bound to be future trends.
V. System function
Use Goldwave software and microphone record
sound.
On the one hand
Matlab will
Sound (WAV) does the test, Fourier conversion test,
There is a database in the database.
On the other hand, use Java
Sound read, do Fourier conversion, then put this
Sound and database
The archive comparison of the file is identified is the same person.
sound.
※ Value conversion: Four Fourier Data file that stores a string format into a digital format.
※ Energy conversion analysis: make the characteristic value of the information after the Fourier conversion, to push
Calculate
Sound feature points.
※ Feature selection:
※
Sound characteristics: a series of dynamic signals that change over time. ※ Four Fourier
Transform (FFT) conversion: convert the time function into a frequency function. By
Matlab can see
Sound file (WAV file) performs Fourier conversion, its waveform energy
Divide the naked eye, therefore simply studying the method of taking the characteristic value of the characteristic value, that is, the program can be taken out.
personal
The characteristics of sound, then and existing in the database
The sound value is comparable, and finally can identify the same
A person's
Sound? Still another person
sound?
Six, system environment
MATLAB interface:
Screen of the database:
Database Structure:
Seven, hard body architecture
"A computer microphone that can be used normally
Eight, soft architecture
(1)
MATLAB 6.0: It is easy to use, can be used flexibly,
Strong, but also has ductility.
※
MATLAB features: 1. Value of functional numerical operations
2. Advanced data visualization
3. High-order but simple programming
4. Open and extendable architecture
(2) Visual C
(3) Goldwave Version 4.25Mssql 7.0TextPad
(7) Fast Fourier Transfer FunctionMICROFT Access 2000 (9) Microsoft Windows
2000 Professional
Nine, system architecture
(1) Recording part: First use the recording system (microphone) will "open the door" in different 10 people
sound
Recorded, everyone said 20 "opens", a total of 200 times, once a time, once, then this
200 times "open door", intercepting the same length
Sound file (regularization - blank part] increased
Degree 80000), establish a database, then follow these
Sound conversion, with PR to become the same mode.
(2) Site part: start from JMF,
The Coding part of the voice is written in J ava.
1. Complete the database to establish
2. Fourier conversion frequency
3. Compare different
Sound frequency characteristics
◎ use
MATLAB reads the WAV file, after the Fourier conversion, then calculates the result value into text
Arrival, compare before and after operation
The difference in sound and the analysis results in the database.
◎ The purpose of the database is to make DATA search, let
The sound ratio is better than the efficiency.
Database section:
JDBC-ODBC Bridge:
Ten, function block diagram
XI, installation and implementation
MATLAB's actual:
※ It can be performed in the manner of J ava.
Twelve, human distribution analysis
[Three]
Chen Yunqu (Research on Floating Watermarking Technology): Seeking to add floating watermark more perfect methods.
Chen Huiqi (Floating Water Printing Technology): Calculated Formula, Utilization
MATLAB tests its feasibility.
Cai Gen Road (Sub-watermarking technology): Add floating watermark, take out the floating watermark action test.
[Three]
Chen Yunqu:
Matlab reads WAV files, test
Sound, show the sound pattern, will
The sound file is converted to a value
Primary analysis, use Fourier conversion to find features, to store the analysis results into text file, compare Fourier turn
Change the difference between the front and rear wave, and design the automated program to read the WAV file.
Chen Huiqi: Automation Read
Sound, get basic
The sound is recorded into a database, and the data library captures the information.
Peng Wenyu: Read Java
Sound (WAV), it is judged whether the read file is WAV file, showing WAVE file
Format, then make Fourier conversion.
Cai Zhengdao: The comparison of information is compared and the frequency is calculated.
[Four] (Java Practical)
Chen Yunqu: will turn into a value
Sound modification analysis: Reading
Sound file, will
Sound file
Numerical adoption of Chen Huiqi: Connection Database, Building a Database System
Thirteen, system development map
Fourteen, outcome picture display
※ Utilization
Matlab look
Sound frequency waveform change
Original waveform (MIX)
10 original waveforms (MIX)
Original file 0.7 (MIX)
Original file -0.7 (MIX)
Original file * 2 (MIX) Original file / 2 (MIX) original waveform (1D) original waveform (two-dimensional): read header
Code code
Read the archive information code to establish a new file
Merged audio file program test numerical change program code implantation of floating water printing
Value conversion 1:
Import java.util.StringTokenizer;
Fourier
Import java.io. *;
Public Class Trans2
{
Public static void main (string [] args) throws exception {
Int size;
File filename = new file ("02.txt");
FileInputStream filein = new fileinputstream (filename);
DataOutputStream Fileout = New DataOutputStream (New
FileOutputStream ("Fourier2.fft");
SIZE = filein.available ();
BYTE [] data = new byte [size];
System.out.println ("Total Position:" (size = filein.availe
()));
Filein.read (DATA);
Value conversion 2:
String Temp = New String (data);
StringTokenizer ST = New StringTokenizer (TEMP, "/ N");
// String [] DataS = new string [st.countToKens ()];
// float [] Fourier = new float [st.countToKens ()];
Double [] fourier = new double [st.countToKens ()];
For (int i = 0; i { // fourier [i] = float.parsefloat (st.nextToken ()); Fourier [i] = double.parsedouble (st.nextToken ()); Fourier [i] = float.parsefloat (Fourier [i]); System.out.println ("Partial (i 1) " Group: " Fourier [i]); Fileout.writeDouble (Fourier [i]); } Filein.close (); Fileout.close (); } } Energy Conversion Analysis 1: Import java.io. *; Public class country { Public static void main (string [] args) throws oException { Java.io.bufferedreader keyin; Keyin = new java.io.bufferedreader (New Java.io.InputStreamReader (System.in)); System.out.print ("Enter Dynamic:"); String filename = keyin.readline (); DataInputStream filein = new DataInputStream (New FileInputStream (FileName)); Float [] count = new float [80]; For (int i = 0; i <80000; i ) Energy Conversion Analysis 2: { INT j = math.Round (I / 1000); FLOAT K = filein.readfloat (); Count [j] = count [j] ((k *k) / 1000); IF ((i% 1000) == 999) { System.out.print ("Count [" J "] =" Count [J]); IF ((j 1)% 5 == 0) System.out.println (""); Else System.out.print (""); } } Filein.close (); } } The sampling number must be two times. Cheng (1): will read The program and Fourier conversion program of the sound file merged. Information after Fourier conversion Cutting with fixed intervals, and the total calculation is calculated. Sound adds array, and another Sound plus total array Make a comparison operation. The value will be added to the fixed interval, and the plus amount of each interval (1 ~ 10000) is deposited. Among the arrays. Comparison analysis: subtract the numerical value in the two arrays, square, accumulate, and do the action of the open root number; of The sound is operational, and the alignment is made with the value in the database. ※ Sound identification system final result: Explanation: 3 group members (Mioko ANNN MELODY) The sound is compared. When a new one mikeko Sound and existing Comparison of sound data, found Mioko and Mioko The sound error is the smallest, Judging to judge - this is MiOko sound. Fifteen, program Process flow chart Connect the database process: Load JDBC driver Class.Forname ("Sun.jdbc.odbc.jdbcodbcdriver"); 2. Connect to the database String Url = "JDBC: ODBC: Voice"; Connection Con = DriverManager.getConnection (URL, "Account", "Password"); 3. Send SQL Statement to the database statement stmt = con.createstatement (); ResultSet RS = Stmt.executeQuery ("SELECT NAME, ROW01 from Voice, TBID WHERE ID = name_id and name like 'mikeko%' "); 4. Read the result of the repository backup While (rs.next ()) {} XVI, manual and operation manual Sound (WAV file) When the Fourier conversion is performed, the more data samples, the more of the conversion frequency band The fine, the more you can show the original Sound waveform. This voice identification system requires human input between data acquisition, which is to be improved. SQL Database Construct Information can be more complete, providing users more user-friendly features. Java and SQL The function is powerful, which can be described as a future trend. If the error is slightly larger, it cannot be determined to be the same person. Sound, but as long as Sound feature Obvious people, The sound recognition will be higher. ※ "Study of floating watermarks": Type of floating watermark: Hidden floating watermark 2. Demonstrative floating watermark Features of floating watermarks: Restability 2. Defense 3. Application of Open Digital Floating Watermark: 1. Smart property protection: IPR (Intellectual Property Rights) 2. Information Tamper detection 3. Secret communication ◎ Floating water is not easy to be changed, recognizable; and floating water prints with transparency (Strong), Security, Capacity (Capacity). (2) WAVE music format: ※ Commonly used MATLAB directive: ANS% preset calculation result of variable name DIR OR LS% Show all files Plot% show the waveform of the file Figure% open another new graphics window CLEAR% Clear variable CLC% Clear screen EXIT% leaving the window ※ Standard Musical Instrument Digital Interface File Type Dustin Caldwell (Record) 1 Overview MIDI's full name is Muscial Instrument Digital Interface, which is the world of musical instruments. Language. There are basically 2 things in the MIDI (Digital Interface) file, Header Chunks And track chunks. The second large section of this paper interprets the header block, and the third large section is interpreted Orbital part. The "only" one header block is used to describe this archive (MIDI file) in the midi file. Information and other materials, and record all the number of magnetic track blocks. We can take a magnetic rail block to become a There are many card belts of many magnetic tracks. We can use a magnetic track as a Sound, a pronunciation, any one Music or any imaginable instrument. 2. Header block The header block as the name is the beginning of the file, which is divided into three parts to indicate the MIDI file. Content. The format of the header file is fixed is: 4D 54 68 64 00 00 00 06 FF FF NN DD DD The ASCII code fixed in the four bit groups (byte) is MTHD (that is, 4D 54 68) 64). The four bit groups after the MTHD indicate the size of the header. It fixes 00 00 00 06, because the actual length of the header will only have 6 position tunnels. FF ff is the format of the file. There are 3 formats: 0-monorail 1-multi-rail, synchronous dial 2-multi-rail, asynchronous dial The monk papers are only one magnetic track. And the synchronous multi-track means that all tracks will be synchronized, or In other words, these magnetic tracks start at the same time, so different parts in a song can be expressed (theoretical Some). As for asynchronous multi-track, it is not necessarily at the same time, and it may even be completely different. NN NN pointed out how many magnets in the MIDI file. DD DD is the number of pieces of each section in the score (Delta-Time). (This will be later Description) 3. Magnetic Rails block Some of the remaining parts behind the header block is the magnetic rail block. There is one on each track. The magnetic rail header and can contain many MIDI commands. Each track header and gear The head is very similar: 4D 54 72 6B XX XX XX XX Its front four metades also have a similar ASCII code similar to the front four gauges of the archive header. But this is MTRK. 4 positions after mtrk indicate the length of this magnetic track (not including this magnetic track The length of the head). Records after the magnetic rail header is MIDI event. These incidents have Information is transmitted and received by MIDI from the mixer (these Events Are Identicial to the THE Actual Data Send and received by Midi Ports on a synth with one address.). Event move = 128). These commands will be written in the table. Each command has different parameters and lengths, but the commands following the command There are 0 (less than 128) of MSB. Exceptions is a transform event (Meta-Event), it There may be 1 MSB. However, the transform event needs to be able to easily deactivate the confusing length parameters. A subtle differential execution mode capable of causing confusion (One SubtleTlety Which Cause Confusion is running mode). This is where the MIDI command is missing, and finally released MIDI commands (by) taken. This represents the MIDI event consists of a beat and some parameters. Midi Event: Hexadecimal: 8X Two bits: 1000xxxx Information: NN VV Narrative: Note OFF (Key Is Released) 2. nn = Note Number 3. vv = velocity 4 Conclusion If this explanation will be more confusing MIDI's release, then it is able to help clarify the hair in the schedule. An example of cloth. In addition, there are 2 practical and one picture file included in this file: Dec.exe It is convenient to convert binary files (like .mid) to an equivalent decree. Rec.exe is the opposite of Dec.exe, is the additional form that converts the decimal file into binary-.midinote .ps indicates the standard digital record of the piano keyboard (※ Appendix 1). MIDI cannot add floating watermark. ※Appendix I MIDI event command Each command bit component is divided into two parts. Left Nybble (4-bit) stores the actual command, and right Nybble stores the MIDI channel number of the command to be executed. There are 16 MIDI channel, and 8 MIDI commands (command NYBBLE must have a MSB). In the following table, X represents the MIDI channel number. Note that all the data bit yuan group will be less than 128 (MSB is set to 0). The transformation events without MIDI channels are listed in the table below. Their formats are: FF XX NN DD All transform events are stored by FF, then the length of the instruction (XX), the length of the data (NN), There is also practical data (DD). Sixteen-in-one binary data narrative 8X 1000XXXX NN VV Note Off (Key Is Released) NN = Note Number vv = velocity 9x 1001xxxx NN VV Note on (Key Is Pressed) NN = Note Number vv = velocity AX 1010xxxx Nn VV Key After-Touch NN = Note Number vv = velocity BX 1011xxxx CC VV Control Change CC = Controller Number vv = new value CX 1100XXXX PP Program (Patch) Change PP = New Program Number DX 1101xxxx CC Channel After-Touch CC = Channel Number EX 1110xxxx BB TT Pitch Wheel Change (2000h is Normal or no change) BB = Bottom (Least Sig) 7 BITS of Value Tt = TOP (MOST SIG) 7 BITS OF VALUE Sixteen-in-one binary data narrative 00 00000000 NN SSSS Sets The TRACK'S Sequence Number. NN = 02 (Length of 2-Byte Sequence Number) SSSS = SEQUENCE NUMBER 01 00000001 nn tt .. Text event- any text you want. NN = Length in bytes of text Tt = text characters 02 00000010 nn tt .. Same as text Event, But Used for CopyRight Info. NN TT = Same As Text Event 03 00000011 nn tt .. Sequence or TRAME NN TT = Same As Text Event 04 00000100 nn tt .. TRACK INSTRUMENT NAME NN TT = Same As Text Event 05 00000101 nn tt .. ilric NN TT = Same As Text Event 06 00000110 nn tt .. Marker NN TT = Same As Text Event 07 00000111 nn tt .. Cue Point NN TT = Same As Text Event 2F 00101111 00 this EVENT MUST COME AT THE END OF Each TRACK 51 01010001 03 TTTTTTTT TEMPOTTTTT = Microseconds / Quarter Note 58 01011000 04 NN DD CCBB Time Signature NN = numerator of time sig. DD = Denominator of Time Sig. 2 = quarter 3 = EIGHTH, ETC. CC = Number of Ticks in MetronomE Click BB = Number of 32nd Notes to the quarter Note 59 01011001 02 SF MI Key SIGNATURE sf = sharps / flats (-7 = 7 flats, 0 = Key of C, 7 = 7 Sharps) Mi = major / minor (0 = major, 1 = minor) 7f 01111111 xx dd .. Sequencer Specific Information XX = Number of bytes to be SENT DD = DATA The following table lists the system messages of the control system, which has no channel number. (Usually they only Will use musical instruments such as MIDI Keyboard.) Sixteen-in-one binary data narrative F8 11111000 Timing Clock Used When Synchronization is Required. FA 11111010 Start Current Sequence FB 11111011 Continue a stopped sequence where left off FC 11111100 Stop a sequence The numbers listed below are equivalent to logging instructions. Octave Note Numbers C C # D D # e f F # g # a a a # b 0 0 1 2 3 4 5 6 7 8 9 10 11 1 12 13 14 15 16 17 18 19 20 21 22 23 23 2 24 25 26 27 28 29 30 31 32 33 34 35 3 36 37 38 39 40 41 42 43 44 45 46 47 4 48 49 50 51 52 53 54 55 56 57 58 59 5 60 61 62 63 64 65 66 67 68 69 70 71 6 72 73 74 75 76 77 78 79 80 81 82 83 7 84 85 86 87 88 89 90 91 92 93 94 95 8 96 97 98 99 100 101 102 103 104 105 106 107 9 108 109 110 111 112 113 114 115 116 117 118 119 10 120 121 122 123 124 125 126 127 The evolution and brief history of MIDI specifications In 1978, a musical instrument exhibition was held in Japan. At that time, a Japanese electronic musical instrument manufacturer Roland, some feeling of electronic synthetic musical instruments is bound to be the style of future, if it is not consistent in advance Soching specifications, then there will be great inconvenience to instrument manufacturers and consumers in the future. Therefore, Roland actively invited several major manufacturers of Yamaha, Korg, and Europe, and discusses electricity together. The performance of the child musical instrument, and the manufacturer hopes to make a university through this seminar. One data transfer type, which makes the synthetic instruments manufactured by each manufacturer can communicate with each other. West, 1981, Sequential Circuits's Dave Smith, Roland I. Kakehashi, Tom Oberheim with Oberheim Electronics, in Namm (National June Show's June SHOW, I want to set up a SynthesizerControl standard, so that Synthesizer produced by different companies can communicate with each other. Afterwards, DAVE SMITH plans to have a related proposal called USI (Universal Synthesizer Interface), and November 1981 is disclosed at the Audio Engineers Society meeting. In January 1982, USI caused a wide range of interest in the NAMM venue, syquential Circuits, Roland, Oberheim, Yamaha, Korg and Kawai these big factory representatives meeting discussion Related House Friendship, because most of them have alone communication standards on their own products. These companies make NAMM is more active to improve the original USI specification make it more perfect ... The original USI specification objective is to allow each other to be controlled between synthesizers, can There is a common language standard that makes each other's data can be properly interpreted and received by different labels. The engineer of this Synthesizer engineer and Sequential Circuits hopes that USI will join it in the future. It is like the Controller control standards such as Pitch Wheels, Foot Pedal, Modulation, Wheels ..., etc. When these vendors re-meet again at the Namm Show meeting in June 1982, they strive to study The result of the discussion has been released, and it is a skeleton of today's MID. At the same time, the name of USI is also canceled (because For everyone, "Universal" is not very satisfied), the new name will be more refined to show this standard. Righteousness and Target: Musical Instrument Digital Interface (MIDI). With this standard, the manufacturers have added the necessary devices in their new Synthesizer. Slightly The processor allows yourself to communicate with other MIDI devices. By this end of 1982, MIDI The specification is finally made, and the musical instrument of the MIDI specification is truly launched. It is 1983. Things ... Implementation of MIDI specifications In 1983, several electronic musical instruments were almost simultaneously introducing musical instruments that complied with MIDI specifications. Such as: Yamaha DX-7 / ROLAND JX-3P / Sequential Prophet-600 ... etc. January 1983 On Namm Show, SEQUENTIAL CIRCUITS Prophet 600 successful Roland JP-6 connection communication, The representatives of the meeting cheered to celebrate, and the MIDI specifications finally successfully officially launched. However, the MIDI specification produced at the beginning is not perfect, it hosted part of the definition. There is no disclosed documentation, which makes these MIDI Synthesizer not all what they can do. Can communicate with each other, causing a chaotic industry. In order to solve this problem, improved MIDI Format 1.0 is disclosed in August 1983 ... On June 29, 1983 in Japan, Synthesizer established their own group. Japanese MIDI Specifications, Japanese Midi Standard Committee, followed by Japan After the United States also established an institution name IMUG (International MIDI) Users' group), to help manufacturers and related music workers, very fast, this organization is booming Later, and renamed the International MIDI Association, referred to as IMA (International Midiassociation). Subsequent development of MIDI specifications Of course, the MIDI specification does not allow everyone to be very satisfied, these unsatisfactory people try to join IMA Go to change the MIDI specifications, and some manufacturers are not willing to produce their contents in accordance with the contents of MIDI specifications. Products make MIDI have no effect. So in the fall of 1984, Yamaha's Jim Smerdel has established MMA (Midi Manufacturers Association) to the representative of other manufacturers. Protect the MIDI specification. They print a complete detailed MIDI specification, eliminate everyone in MIDI Doubt. Now, MMA maintains MIDI specifications together with JMSC. Any member of them is willing to compromise with MIDI specifications, because they find that if Synthesizer is able to communicate with each other, then MIDI It is not possible. Since 1984, MIDI is stable in the music industry. From then on MIDI We can explain it this ... 1) MIDI is one of the important functions of computer music. 2) MIDI is a unified industrial standard. 3) MIDI is a interface device. 4) MIDI is a new but different from traditional musical instruments. 5) MIDI is a bit language. Yamaha DX7 amazing sales makes the manufacturer that did not produce MIDI SYNTHESIZER They have went to the MIDI camp, people gradually feel the convenience of MIDI, and also begins to require other related facilities. Midi must be equipped with amplifier, or Signal Processor. Computer user is very obvious, MIDI's digital message can be received by the computer without errors, so the software vendors have developed many applications. Software to control Synthesizer, make the user's hands can do more imagination, and MIDI It seems to be an object that the future computer development must be enrolled. In the future, it can be sure that there will be more More than MIDI surrounding products were born. What is MIDI? MIDI's full name is Muscial Instrument Digital Interface, we can translate it to "music Digital interface. "See" Interface "words, we can know that MIDI is not One can be seen, can touch the obtained material, nor any software that can be performed on a computer, MIDI It is a standard that allows Synthesizer manufacturers to make their musical instruments in accordance with this standard. Synthesizer of different labels can communicate with each other by MIDI's standard specification. For example, let's assume that I have encountered an alien on the road today, I speak Chinese, he said the alien Language, I can't communicate, if the Dutch knows English, I also understand English, then we can use English Tong, at this time, English is "interface" I communicated with aliens. Let's take a look at these electronic musical instruments! Before there is a language that doesn't work in Midi, the armor is said. The language that the gun instrument knows, and the language instrument said the language of Brass instruments, so that A and B two instruments are fundamentally It is impossible to communicate, just like I have a Dutch, but if the arm is Midi, B is also MIDI, Name and B The music instrument can be communicated by MIDI. So, we can say this: MIDI is the world language of the instrument. Midi Device Message of circulating China We call these MIDI Message for Cable We said We are called MIDI Port for MIDI Cable. And connect MIDI CABLE. What can be MIDI DEVICE? As long as there is a micro Processor, you can send MIDI Message, Treatment reaction MIDI Message, And in accordance with the MIDI specifications, we can call it Midi Device. It can be seen that MIDI Device It is not necessarily referring to the keyboard shape, or a black-shaped BOX-shaped sound source machine, but as long as it is in it. The appropriate device can sound We can regard the mechanism for transforming into MIDI Message For MIDI Device; put on a guitar to convert a vibration of the string to MIDI Message Pickup, this guitel is a MIDI Device. In addition to the instrument, insert a MIDI interface card in your computer, make it Handling MIDI News Interest, at this time your computer is a MIDI Device. This more, if you have a lighting equipment with MIDI Port. In response to the received MIDI Message, change the color of the light or light; Processor's MIDI The mixer (Mixer) can react MIDI Message to control the volume and produce special effects; The west is not necessarily musical, but they can be Midi Device. Midi Channel Midi Channel is very like a TV program's Channel, the MIDI specification defines 16 MIDIs. Channel, number of numbers from 1 - 16. When there is no MIDI CHANNEL, MIDI can let all MIDI The device in System is simultaneously, but there is no way to do different things separately. All the Device in all system can only do the same thing. After Midi Channel, we can specify an item only for N number Channel uses, other non-N-Channel Devices ignores this message, so MIDI 16 of the 16 Channel can specify MIDI Device simultaneously do 16 different things. There are four types of MIDI CHANNEL reception mode: Mode1: Omni ON / POLY Mode2: Omni ON / MONO Mode3: Omni Off / Poly Mode4: Omni Off / Mono Omni ON means that Midi Device will track all Channel and respond to all CHANNEL Message, Omni Off only receives Channel Message specified by the specified Channel, and other it is not tube. Poly and Mono means what way to use when MIDI Device receives this message? It, POLY is like synthesizer, which is averaged, it will play multiple NOTEs at the same time, unless received This Note's end message is still stopped when the Synthesizer speaks. Just opposite, it only Play a note, as long as you play a new note, the previous Play Note will be interrupted. Midi Message Midi Message is considerable in MIDI, and they decide what kind of music events can To circulate between MIDI Device, if you want to know MIDI, MIDI Message is known Tao. How does Midi Device send a message? MIDI is a digit interface, so the information it receives is made up of 0 and 1, which is by MIDI. Cable is sent between MIDI Device, which is a group of 1byTe (8bits), and the 2-in-one 8 digits The word can express the number between 10 bits 0-255, so it can transmit 256 different messages. MIDI is to transmit information in the way in Serial Data Transmission, that is, 1bit, The 1 bit lost, although many of the way of transmitting Parallel Data Transmission compared, although it was slow, However, it is possible to reduce the chance of errors in the process of interference during transmission, in normal state, MIDI can transfer 31250 BITS information every second. (PS: Although we say a group of messages is 8 bits, but MIDI will add 1 bit to 1 bit to judge the type of information, so it is correct, The material should be 10 bits.) MIDI Message Midi Device usually uses 2 - 3 Byte to represent a MIDI Message, any MIDI Message's first Byte called Status Byte, later known as data byte.status Byte is used Note the type or role of this MIDI Message, it may indicate that this message is a Note On Message or Pitch Bend Change Message ... et al. Data Byte is a value for a given STATUS. For example, you can see this instructions later in the source manual: Note ON: Status Second Third ----- ------ ----- 9nh kkh vvh n = MIDI CHANNEL NUMBER: 0H-FH (0-15) KK = Note Number: 00H-7FH (0-127) VV = velocity: 01H-7FH (1-127) Status Byte tells Midi Device This is a Note On Message because Mote on Message Is a MIDI CHANNEL message, so we have to specify the Channel to it, n value is specified Transfer Channel number. The back followed by Second and Third is Data Byte, used to assume the value of Status Byte, KK means this Note number, number of numbers by 0-127; VV represents this Note's strength, range from 1-127 (0 representative Sound, belongs to Note Off. To distinguish between Status Byte and Data Byte, MIDI uses 0-127 represents Data Byte, 128-255 STATUS BYTE. Midi Message Type Midi Message can be divided into two kinds of system message and channel message, CHANNEL The Status Byte in Message contains the Channel number, specifying the message is received by a channel; system Message is not, so every Channel can receive .System Message and Channel The content of Message is as follows: .System message Comman Message Zong Position Pointer 2.song select 3.Tune Request 4.eox (end of exclusive) b. Real-time message Ttiming Clock 2.start 3.stop 4.Continue 5.active sensing 6.System RESET c. System Exclusive Message Channel Message a. Mode Message 1.Local Control 2.all notes off 3.omni mode OFF 4.omni mode on 5.Mono Mode ON 6.Poly Mode ON b. Voice Message 1.note on 2.Note Off 3.Polyphonic KEY PRESSURE 4.Channel Pressure 5.Program Change 6.Control Change 7.PITCH BEND CHANGE The list of Control Change Message in CHANNEL Message is as follows: -------------------------------------------------- - 0 Undefined 1 MODULATION WHEEL OR LEVER 2 BREATH Controller 3 Undefined 4 Foot Controller 5 Poramento Time 6 Data Entry MSB 7 Main Volume 8 balance 9 Undefined 10 PAN 11 EXPRESSION CONTROLLER 12-15 undefined 16-19 General-Purpose Controllers (Number 1 To 4) 20-31 undefined 32-63 LSB for Values 0 to 31 64 DAMPER PEDAL (SUSTAIN) 65 Portamento 66 SOSTENUTO 67 Soft Pedal 68 undefined 69 Hold 2 70-79 undefined 80-83 General-Purpose Controllers (Numbered 5 to 8) 84-91 Undefined 92 Tremolo Depth 93 Chorus Depth 94 CELESTE (DETUNE) DEPTH 95 Phaser DePth 96 Data Increment 97 Data Decrement 98 Non-Registered Parameter Number LSB 99 Non-Registered Parameter Number MSB 100 Registered Parameter Number LSB 101 Registered Parameter Number MSB 102-121 undefind122 reserved for channel mode message. Seventeenth, reference materials Website: http://spinserve.com/stairway/midim/midim.htm Http://cslin.auto.fcu.edu.tw/scteach/scteach88/tidsp/index.html http://cslin.auto.fcu.edu.tw/scteach/scteach88/pack/index4.htm books: ◎ Java program constructed thinking - from getting started to advance Author: Zhou Zheng Hong Publishing House: Wenkuo Information Co., Ltd. March 2002 2 brush = 10) { Switch (x% 10) = 10) { Switch (x% 10) { Case 0: System.out.print ("a"); Break; Case 1: system.out.print ("b"); Break; Case 2: System.out.print ("c"); Break; Case 3: System.out.print ("D"); Break; Case 4: System.out.print ("E"); Break; Case 5: system.out.print ("f"); Break; } = 10) { Switch (Y% 10) { Case 0: System.out.print ("a"); Break; Case 1: system.out.print ("b"); Break; Case 2: System.out.print ("c"); Break; Case 3: System.out.print ("D"); Break; Case 4: System.out.print ("E"); Break; Case 5: system.out.print ("f"); Break; } } Else { IF (y! = 0) {system.out.print (y); Else {IF (x! = 0) System.out.print (Y); } } / / -------------------------------------------------------------------------------------------- ----------------------------------- Public static void main (string [] args) throws oException { FileInputStream FileRead = New FileInputStream ("Mioko2.wav"); INT C, NUM = 1; INT N [] = new int [4], j = 0; int V [] = new int [2]; / / -------------------------------------------------------------------------------------------- ---------------------------------- System.out.println ("HEADER Site (0x0-0XB)"); System.out.print ("(0x0-0X3) 4 BYTES fixed to"); While ((c = fileread.read ())! = -1 && num <= 4) { N [J] = C; J ; Num ; IF (Num == 5) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int A = 0; a <= 3; A ) System.out.print (CHAR) N [A]); System.out.print (")"); } } System.out.print ("/ n (0x4-0x7) 4 BYtes is Wave Chunk Size 0x"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } System.out.print ("Bytes"); } } System.out.print ("/ n (0x8-0x11) 4 BYTES fixed to riff type"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1) && (Num <= 12)) { N [J] = C; J ; Num ; IF (NUM == 13) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int i = 0; i <= 3; i ) System.out.print ((char) n [i]); System.out.print (")"); } } System.out.println ("/ N / NFORMAT part (0xc-0x23)"); System.out.print ("(0xC-0xF) 4 BYTES fixed to"); J = 0; N [J] = C; J ; Num ; While ((c = fileRead.read ())! = -1 && num <= 16) { N [J] = C; J ; Num ; IF (Num == 17) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int i = 0; i <= 3; i ) system.out.print ((char) n [i]); System.out.print (")"); } } System.out.print ("/ n (0x10-0x13) 4 Bytes is Format Chunk Size 0x"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num <= 20)) = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } System.out.print ("Bytes"); } } System.out.print ("/ n (0x14-0x15) 2 BYtes is format type"); J = 0; V [J] = C; J ; NUM ; While (((c = fileread.read ())! = -1) && (num stereo ");} } } System.out.print ("/ n (0x16-0x17) 2 BYTES defined channel number"); J = 0; V [J] = C; J ; NUM ; While ((c = fileread.read ())! = -1) && (NUM " V [1] V [0] " a Channel "); } } System.out.print ("/ n (0x18-0x1b) 4 BYTES definition sampling rate: this WAVE file sampling frequency 0x "); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } } } System.out.print ("/ n (0x1c-0x1f) 4 BYtes define the number of 0x per second"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } } } System.out.print ("/ n (0x20-0x21) 2 BYtes define each sampling BYTES number"); J = 0; V [J] = C; J ; NUM ; While ((c = fileread.read ())! = -1) && (Num <= 34)) { V [J] = C; J ; Num ; = 0; A -) System.out.print (v [a] ""); } } System.out.print ("/ n (0x22-0x23) 2 BYTES defines the number of bits of each sample"); J = 0; V [j] = C; J ; Num ; while ((c = fileread.read ())! = -1) && (Num = 0; A -) System.out.print (v [a] ""); } } System.out.println ("/ N / NDATA part (0x24 ~)"); System.out.print ("(0x24-0X27) 4 Bytes fixed to"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && num <= 40) { N [J] = C; J ; Num ; IF (Num == 41) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int A = 0; a <= 3; A ) System.out.print (CHAR) N [A]); System.out.print (")"); } } System.out.print ("/ n (0x28-0x2b) 4 BYtes is Data Chunk Length 0x"); J = 0; N [J] = C; J ; Num ; While (c = fileread.read ())! = -1 && (Num = 10) { Switch (x% 10) { Case 0: System.out.print ("a"); Break; Case 1: system.out.print ("b"); Break; Case 2: System.out.print ("c"); Break; Case 3: System.out.print ("D"); Break; Case 4: System.out.print ("E"); Break; Case 5: system.out.print ("f"); Break; = 10) { Switch (Y% 10) { Case 0: System.out.print ("a"); Break; Case 1: system.out.print ("b"); Break; Case 2: System.out.print ("c"); Break; Case 3: System.out.print ("D"); Break; Case 4: System.out.print ("E"); Break; Case 5: system.out.print ("f"); Break; } } Else { IF (y! = 0) {system.out.print (y); Else {IF (x! = 0) System.out.print (Y); } } // -------------- Fu Liye conversion ------------------------- Static Double [] swap (double data [], int a, int b) {double tempr = data [A]; Data [A] = DATA [B]; Data [B] = Tempr; Return Data; } Static Double [] Four1 (Double Data [], INT NN, ISIGN { INT N, MMAX, M, J, ISTEP, I; Double WTEMP, WR, WPR, WPI, Wi, Theta; Double Tempr, TEMPI; n = nn << 1; J = 1; For (i = 1; i) { Data = swap (data, j, i); Data = SWAP (Data, J 1, I 1); } mmax) { Istep = mmax << 1; Theta = isign * (6.28318530717959 / mmax); WTEMP = Math.sin (0.5 * Theta); WPR = -2.0 * wtemp * wtemp; WPI = Math.sin (Theta); WR = 1.0; Wi = 0.0; FOR (M = 1; M FOR (i = m; i <= n; i = istep) { J = i mmax; TEMPR = WR * DATA [J] -wi * data [j 1]; Tempi = WR * DATA [J 1] Wi * Data [J]; Data [J] = DATA [I] -Tempr; Data [J 1] = DATA [i 1] -Tempi; DATA [I] = Tempr; Data [i 1] = TEMPI; } WR = (wtemp = WR) * WPR-WI * WPI WR; Wi = Wi * WPR WTEMP * WPI WI; } mmax = istep; } IF (isign == - 1) FOR (m = 1; m ) { Data [M] / = NN; } Return Data; } / / -------------------------------------------------------------------------------------------- ------------------------------------------- Public static void main (string [] args) throws oException { FileInputStream FileRead = New FileInputStream ("08.wav"); INT C, NUM = 1; INT N [] = new int [4], j = 0; int v [] = new int [2]; double data [] = new double [9]; // -------------------------------------- Header part ------ ------------------------------- System.out.println ("HEADER Site (0x0-0XB)"); System.out.print ("(0x0-0X3) 4 BYTES fixed to"); While ((c = fileread.read ())! = -1 && num <= 4) { N [J] = C; J ; Num ; IF (Num == 5) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int A = 0; a <= 3; A ) System.out.print (CHAR) N [A]); System.out.print (")"); } } System.out.print ("/ n (0x4-0x7) 4 BYtes is Wave Chunk Size 0x"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } System.out.print ("Bytes"); } } System.out.print ("/ n (0x8-0x11) 4 BYTES fixed to riff type"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1) && (Num <= 12)) { N [J] = C; J ; Num ; IF (NUM == 13) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int i = 0; i <= 3; i ) System.out.print ((char) n [i]); System.out.print (")"); } } / / ------------------------------------------------------------------------------------------- --------------------------------- System.out.println ("/ N / NFORMAT part (0xc-0x23)"); System.out.print ("(0xC-0xF) 4 BYTES fixed to"); J = 0; N [J] = C; J ; Num ; While ((c = fileRead.read ())! = -1 && num <= 16) { N [J] = C; J ; Num ; IF (Num == 17) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = n [a] / 16; int y = n [a]% 16; DECIDE1 (X, Y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int i = 0; i <= 3; i ) System.out.print ((char) n [i]); System.out.print (")"); } } System.out.print ("/ n (0x10-0x13) 4 Bytes is Format Chunk Size 0x"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } System.out.print ("Bytes"); } } System.out.print ("/ n (0x14-0x15) 2 BYtes is format type"); J = 0; V [J] = C; J ; NUM ; While ((c = fileread.read ())! = -1) && (num mono ");} STEREO "); } } System.out.print ("/ n (0x16-0x17) 2 BYTES defined channel number"); J = 0; V [J] = C; J ; NUM ; While ((c = fileread.read ())! = -1) && (NUM " V [1] V [0] " a Channel "); } } System.out.print ("/ n (0x18-0x1b) 4 BYTES definition sampling rate: this WAVE file sampling frequency 0x "); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } } } System.out.print ("/ n (0x1c-0x1f) 4 BYtes define the number of 0x per second"); J = 0; N [J] = C; J ; Num ; While (c = fileread.read ())! = -1 && (Num <= 32))) { N [J] = C; J ; Num ; = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } } } System.out.print ("/ n (0x20-0x21) 2 BYtes define each sampling BYTES number"); J = 0; V [J] = C; J ; NUM ; While ((c = fileread.read ())! = -1) && (NUM = 0; a -) System.out.print (v [a] ""); } } System.out.print ("/ n (0x22-0x23) 2 BYTES defines the number of bits of each sample"); J = 0; V [J] = C; J ; NUM ; While ((c = fileread.read ())! = -1) && (Num = 0; A -) System.out.print (v [a] ""); } } // ---------------------------------------------- ---------------------------- System.out.println ("/ N / NDATA part (0x24 ~)"); System.out.print ("(0x24-0X27) 4 Bytes fixed to"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && num <= 40) { N [J] = C; J ; Num ; IF (Num == 41) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int A = 0; a <= 3; A ) System.out.print (CHAR) N [A]); System.out.print (")"); } } System.out.print ("/ n (0x28-0x2b) 4 BYtes is Data Chunk Length 0x"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } System.out.print ("Bytes"); } } System.out.print ("/ n"); int E = 0; INT Q = 1; While (c = fileread.read ())! = -1 && (Num <= 52 e)))) { Data [0] = 0.0; DATA [q] = C; Q ; Num ; } System.out.print ("/ n conversion"); For (int u = 1; u <= 8; u ) System.out.print ("" Data [u] "/ t"); Four1 (DATA, 4, 1); System.out.println ("/ N Translation"); For (int P = 1; p <= 8; p ) System.out.println (" DATA [P]); Four1 (DATA, 4, -1); System.out.println ("/ N conversion back to the original information"); For (int P = 1; p <= 8; p ) System.out.println (" DATA [P]); FileRead.Close (); } } -------------------------------------------------------------------------------------------------------------------------------------------------- - Import java.io. *; Public Class Readline { Public static void main (string args []) THROWS EXCEPTION { Double B [] = new double [16]; INT i = 0; Double F, A; FileReader fr = new fileReader ("02.txt"); BufferedReader Br = New BufferedReader (FR); String line = br.readline (); For (int J = 0; j <16; j ) { While (Line! = NULL && I <= 9999) { System.out.println ("Record" i ", / T" "value:" line); a = double.parsedouble (line); B [J] = A; System.out.println ("Record" i ", / T" "value:" a); Line = br.readline (); i ; } i = 0; } For (int J = 0; j <16; j ) System.out.println ("SUM [" J "] =" B [J]); br.close (); Fr.close (); } } ------------------------------------------------------------------------------------------------------------------------ ------------- Import java.io. *; Public Class Cal { Public static void main (string args []) THROWS EXCEPTION { Double A [] = {- 12.94415288168802541991, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 384.3178300 517009, 70.82904190851768, 58.939048922740255, 66.91218671296072, 67.72228973 "296078, 59. Double B [] = {- 18.054321451327972, 2.070862511619985, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -106.547688 73349997, -32.56270462765004, -26.531717235440034, -14.147701522292923, -14.262758538992873998, -27.0223252765601, -95.0871843334993} INT i = 0; Double C, D = 0.0, E = 0.0; For (int J = 0; j <16; j ) { C = a [j] -b [j]; C * = C; D = C; i ; } E = math.sqrt (d); System.out.println ("calculation results:" E); } } -------------------------------------------- ----- Import java.io. *; Public Class Cala { Public static void main (string args []) THROWS EXCEPTION { Double F, G, H = 0.0, E = 992.4565135112156, R = 542.9029162631446 // Double Sum [] = new double [64] // int T; // for (int T = 0; t <64; t ); // { H = E * 0.8; f = e-h; G = E H; //} IF (r = f) {System.out.println ("Information is in line with!"); // system.out.println ("h =" h "f =" f "g =" g); } Else {System.out.println ("Information is not in conformance!"); // system.out.println ("h =" h "f =" f "g =" g); } } } ---------------------- JDBC connection Search information ----------------------- --- Import javax.swing. *; Import javax.swing.event. *; Import java.awt. *; Import java.awt.event. *; Import javax.swing.table.tablemodel; Import java.net. *; Import java.sql. *; Import java.lang. *; Public Class JDBC7 Extends Jframe { Private JTable Table; Private string [] [] DATA; Public static void main (string [] args) { JDBC7 frame = new JDBC7 (); Frame.setsize (300, 300); Frame.PACK (); Frame.setVisible (TRUE); } Public JDBC7 () { String [] colornnames = {"name", "row1", "row2", "row3", "ROW4", "Row5", "Row6", "Row7", "ROW8", "Row9", "Row10", "Row11", "Row12", "Row13", "Row14", "Row15", "ROW16" } Connection Connection; Statement Statement; ResultSet ResultSet; IRECordnum = 0; 0) { Data = new string [irecordnum] []; // Data takes the second-dimensional capital in the database material ResultSet.BeforeFirst (); // Back to the first column System.out.println ("IRecordnum =" IRecordnum); For (int i = 0; i { ResultSet.next (); Data [i] = new string [17]; // a few columns For (int J = 0; j <17; j ) // line { Data [i] [j] = new string (resultset.getstring (j 1)); System.out.println ("DATA [" i "] [" J "] =" Data [i] [j]); } 0) { // CREATE TABLE Table = new JTABLE (DATA, ColumnNames); // put the data and the number of rows JTable Table.SetPreferredscrollviewViewPortsize (New Dimension (300, 100)); // Text table size Jscrollpane TablePane = New Jscrollpane (Table); // Scroll Settitle ("Demo of Table"); // Label Container content = getContentPane (); Content.add (TablePane, BorderLayout.center); // Close AddWindowListener (New Windowadapter () { Public void WINDOWCLOSIG (WindowEvent E) { System.exit (0); } }); // Single Selection ONLY Table.setSelectionMode (ListSelectionModel.single_selection); } } } ---------------------------------- Sound identification system completes ----------------------------------- Import java.io. *; Public Class Test13 { Static void Decide1 (int X, int y) = 10) { Switch (x% 10) { Case 0: System.out.print ("a"); Break; Case 1: system.out.print ("b"); Break; Case 2: System.out.print ("c"); Break; = 10) { Switch (Y% 10) { Case 0: System.out.print ("a"); Break; Case 1: System.Out.print ("b"); Break; Case 2: System.out.print ("c"); break; Case 3: System.out.print ("D"); Break; Case 4: System.out.print ("E"); Break; Case 5: system.out.print ("f"); Break; } } Else { IF (y! = 0) {system.out.print (y); Else {IF (x! = 0) System.out.print (Y); } } // ------------------------------------ Fu Liye conversion -------- ------------------------------------ Static double [] swap (double data [], int A, int b) { Double Tempr = Data [A]; Data [A] = DATA [B]; Data [B] = Tempr; Return Data; } Static Double [] Four1 (Double Data [], INT NN, ISIGN { INT N, MMAX, M, J, ISTEP, I; Double WTEMP, WR, WPR, WPI, Wi, Theta; Double Tempr, TEMPI; n = nn << 1; J = 1; For (i = 1; i mmax) { Istep = mmax << 1; Theta = isign * (6.28318530717959 / mmax); WTEMP = Math.sin (0.5 * Theta); WPR = -2.0 * wtemp * wtemp; WPI = Math.sin (Theta); WR = 1.0; Wi = 0.0; FOR (M = 1; M FOR (i = m; i <= n; i = istep) { J = i mmax; TEMPR = WR * DATA [J] -wi * data [j 1]; Tempi = WR * DATA [J 1] Wi * Data [J]; Data [J] = DATA [I] -Tempr; Data [J 1] = DATA [i 1] -Tempi; DATA [I] = Tempr; Data [i 1] = TEMPI; } WR = (wtemp = WR) * WPR-WI * WPI WR; Wi = Wi * WPR WTEMP * WPI WI; } mmax = istep; } IF (isign == - 1) FOR (m = 1; m ) { Data [M] / = NN; } Return Data; } //-------------------------------------------Comparison--- -------------------------------------------- Static Double Sum (Double Sum [], Double AS []) { Double C, D = 0.0, E = 0.0; INT i = 0, k = 0; For (int J = 0; j <64; j ) { C = SUM [J] -AS [J]; C * = C; D = C; } E = math.sqrt (d); Return E; } / / -------------------------------------------------------------------------------------------- -------------------------------------------------- --Public static void main (String [] args) throws oException { FileInputStream FileRead = New FileInputStream ("Mioko1.wav"); // new Sound file INT C, NUM = 1, J = 0, f = 0, DataSize = 1024, N [] = new int [4], v [] = new int = Double Data [], sum [] = new double [64], as [] = new double [64], r, bs [] = new Double [64], cs [] = new double [64]; Data = New Double [DataSize 1]; FileReader fr = new fileReader ("mikeko02.txt"); // read into the comparison Sound 1 BufferedReader Br = New BufferedReader (FR); String line = br.readline (); While (Line! = NULL && F <64) { R = double.parsedouble (line); AS [f] = R; Line = br.readline (); F ; } f = 0; FileReader fr1 = new fileReader ("anny01.txt"); // read into the comparison Sound 2 BufferedReader Br1 = New BufferedReader (FR1); String line1 = br1.readline (); While (Line1! = NULL && F <64) { R = double.parsedouble (line1); BS [F] = R; LINE1 = br1.readline (); F ; } f = 0; FileReader fr2 = new fileReader ("melody02.txt"); // read into the sound to be aligned Sound 3 BufferedReader Br2 = New BufferedReader (FR2); String line2 = br2.readline (); While (Line2! = NULL && F <64) { R = double.parsedouble (line2); CS [F] = R; Line2 = br2.readline (); F ; } // --------------------------------------- ----------------------------------- System.out.println ("HEADER Site (0x0-0XB)"); System.out.print ("(0x0-0X3) 4 BYTES fixed to"); While ((c = fileread.read ())! = -1 && num <= 4) { N [J] = C; J ; Num ; IF (Num == 5) { System.out.print ("/"); for (int a = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int A = 0; a <= 3; A ) System.out.print (CHAR) N [A]); System.out.print (")"); } } System.out.print ("/ n (0x4-0x7) 4 BYtes is Wave Chunk Size 0x"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } System.out.print ("Bytes"); } } System.out.print ("/ n (0x8-0x11) 4 BYTES fixed to riff type"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1) && (Num <= 12)) { N [J] = C; J ; Num ; IF (NUM == 13) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int i = 0; i <= 3; i ) System.out.print ((char) n [i]); System.out.print (")"); } } // ----------------------------------- ---------- ------------------------------------- System.out.println ("/ N / NFORMAT part (0xc-0x23)"); System.out.print ("(0xC-0xF) 4 BYTES fixed to"); J = 0; N [J] = C; J ; Num ; While ((c = fileRead.read ())! = -1 && num <= 16) { N [J] = C; J ; Num ; IF (Num == 17) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = n [a] / 16; int y = n [a]% 16; DECIDE1 (X, Y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int i = 0; i <= 3; i ) System.out.print ((char) n [i]); System.out.print (")"); } } System.out.print ("/ n (0x10-0x13) 4 Bytes is Format Chunk Size 0x"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } System.out.print ("Bytes"); } } System.out.print ("/ n (0x14-0x15) 2 BYtes is format type"); J = 0; V [J] = C; J ; NUM ; While (((c = fileread.read ())! = -1) && (num stereo ");} } } System.out.print ("/ n (0x16-0x17) 2 BYTES defined channel number"); J = 0; V [J] = C; J ; NUM ; While ((c = fileread.read ())! = -1) && (num <= 24)) { V [J] = C; J ; Num ; IF (Num == 25) { " V [1] V [0] " Channel "); } } System.out.print ("/ n (0x18-0x1b) 4 BYTES definition sampling rate: this WAVE file sampling frequency 0x "); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } } } System.out.print ("/ n (0x1c-0x1f) 4 BYtes define the number of 0x per second"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } } } System.out.print ("/ n (0x20-0x21) 2 BYtes define each sampling BYTES number"); J = 0; V [J] = C; J ; NUM ; While ((c = fileread.read ())! = -1) && (NUM = 0; a -) System.out.print (v [a] ""); } } System.out.print ("/ n (0x22-0x23) 2 BYTES defines the number of bits of each sample"); J = 0; V [J] = C; J ; NUM ; While ((c = fileread.read ())! = -1) && (Num = 0; A -) System.out.print (v [a] ""); } } // ---------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------- System.out.println ("/ N / NDATA part (0x24 ~)"); System.out.print ("(0x24-0X27) 4 Bytes fixed to"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && num <= 40) { N [J] = C; J ; Num ; IF (Num == 41) { System.out.print ("/"); For (int A = 0; a <= 3; A ) { INT x = N [a] / 16; int y = n [a]% 16; Decide1 (x, y); System.out.print (""); } System.out.print ("/" " " " " ("); For (int A = 0; a <= 3; A ) System.out.print (CHAR) N [A]); System.out.print (")"); } } System.out.print ("/ n (0x28-0x2b) 4 BYtes is Data Chunk Length 0x"); J = 0; N [J] = C; J ; Num ; While ((c = fileread.read ())! = -1 && (Num = 0; A -) { INT x = N [a] / 16; int y = n [a]% 16; Decide2 (x, y); } System.out.print ("Bytes"); } } System.out.print ("/ n"); int E = 0, D = 0, g = 0; Double CC = 0.0; DO //do...While Recycling Time 324 is more than once, deposited in the SUM array { Data [0] = 0.0; INT Q = 1; CC = (double) C / 256; DATA [q] = cc; q ; Num ; G ; While ((c = fileread.read ())! = -1 && (Num <= DATASIZE-1 45 E)) { CC = (double) C / 256; DATA [q] = cc; Q ; Num ; g ; } E = E 1023; Four1 (Data, DataSize / 2, 1); // ---------------- Call Fourier Conversion ----------------------------------- For (int P = 1; P <= DataSize; P ) SUM [D] = DATA [P]; D ; } while (c! = -1); Double H = SUM (SUM, AS); // ------------------ Call Alignment --- Sound 1 operation -------------------- Double H1 = SUM (SUM, BS); // ------------------ Call Alignment --- Sound 2 -------------------- Double H2 = SUM (SUM, CS); // ------------------ Call Alignment --- Sound 3 -------------------- System.out.println ("/ N and Mikeko calculation results:" h); System.out.println ("/ N and Anny calculation results poor:" H1); System.out.println ("/ n and melody calculation results:" H2); / / -------------------------------------------------------------------------------------------- -------------------------------------------------- - FileRead.Close (); } }