Interval is the distance between two notes. In a scale, interval is measured from the root note. The root note is counted as 1.
For example, in C Major:
C-C
C-D = Major Second
C-E = Major Third
C-F = Perfect Forth
C-G = Perfect Fifth
C-A = Major Sixth
C-B = Major Seventh
C-C = Perfect Octave
For C Minor:
C-D = Major Second
C-Eb = Minor Third
C-F = Perfect Forth
C-G = Perfect Fifth
C-Ab = Minor Sixth
C-Bb = Minor Seventh
C-C = Perfect Octave
Major interval can only be used for the 2/3/6/7 notes in Major scale
Minor interval can only be used for the 3/6/7 notes in Minor scale. Minor interval is always half step shorter than the major interval of the same name.
Pythagoras, born circa 580 BC, initiated the idea that if a vibrating string is divided in half, it produces the octave above the open vibrating string. In other words, the ratio of the fundamental string to to the divided string is 1:2 will create a octave interval.
Perfect intervals (unison, forth, fifth and octave) is perfect because they are produced from perfect or pure frequency ratio. For fifth, the ration is 2:3 and for forth is 3:4
Wednesday, January 26, 2011
Identifying Key
The key signature does not differentiate Major or Minor key. 99.99999% of time, Minor key seldom appears in its natural form. Usually the melodic or harmonic minor keys are used in music. And both forms contain a leading note (raised 7th). Major key does not need to do so because the 7th note is already raised. So if you found one note is sharped frequently and that is the leading note of the related minor key, the piece is likely in the minor key.
For example, if to know if the piece is A minor, look for appearance of G# in the piece.
For example, if to know if the piece is A minor, look for appearance of G# in the piece.
Monday, January 24, 2011
Scale
(1) Pentatonic scale comprises 5 notes (1, 2, 3, 5 6) which simple fractional relationship with each other in term of frequency.
1, 1+1/8, 1+1/4, 1+1/2, 1+2/3, 2 or
1, 1+1/8, 1+2/8, 1+4/8, 1+6/9, 2
There is no semitones within the pentatonic scale that make the notes sound good together. The scale has the following interval pattern:
1 1+1/8 1+1/4 1+1/2 1+2/3 2
The interval between the third and forth notes is more than 1 tone. Likewise between the fifth and the next octave note.
(2) Major scale is built from the pentatonic scale plus two notes. Two note was added in the interval higher than 1 tone - sub-dominant and the leading note. The pentatonic notes have the follow relative frequency to the tonic:
The two additional notes are 1+1/3 (which is 1 semitone above 1+1/4) and 1+7/8 which is 1 tone above 1+2/3 and 1 semitone below 2 (octave).
1, 1+1/8, 1+1/4, 1+1/3, 1+1/2, 1+2/3, 1+7/8. 2
Major scale has the following interval pattern:
WWHWWWH
A drawback of the major scale is the tendency towards definite, complete statements.
(3) Minor scale has less definite full stops. Minor scale takes the same set of note as a major scale but use a different tone as the root. For example, C manor and A minor uses the same set of note but the root (tonic) is C and A respectively.
There are 3 different forms of minor scale.
Natural minor scale has the following interval pattern:
WHWWHWW
Comparing to the major scale, 3 notes (including the leading note) move down 1 semitone.
Comparing C Major to C Minor, the 3, 6 and 7 notes (E A B) are flat in C Minor.
C, D, E, F, G, A, B, C
C, D, E♭, F, G, A♭, B♭, C
The relative frequency is:
1, 1+1/8, 1+1/5, 1+1/3, 1+1/2, 1+3/5, 1+3/4, 2
Natural minor lacks the leading note. So it does not sound good when the melody going up as the seventh and the octave note is too far apart. It sounds good for melody travelling down in pitch (descending melodic minor).
For the ascending melodic minor, 2 of the notes are re-instate to their major positions. The leading note is restored and its neigbouring note also to smoothing out the big gap. The sixth note also bumped up a semitone so that it does not sound too far apart from the leading note too.
Ascending melodic minor scale has the following interval pattern:
WHWWWWH
C, D, E, F, G, A, B, C
C, D, E♭, F, G, A, B, C
The relative frequency of ascending melodic minor are
1, 1+1/8, 1+1/5, 1+1/3, 1+1/2, 1+2/3, 1+7/8, 2
For composing melody, we use the natural minor for the part going down and melodic for the part that going up. However, the two minor scales pose a problem for creating chord which sounds good for both directions. The harmonic minor is a compromise by only restoring the leading note from the natural minor.
WHWWHW#H
The 6 and 7 note is now 1.5 notes apart. This creates a melodic awkward.
Classical musician practice minor scales by playing melodic minor as the scale ascend and natural minor in descend. Harmonic minor scale is rarely practised. This is more a harmonic tool and not a melodic one.
1, 1+1/8, 1+1/4, 1+1/2, 1+2/3, 2 or
1, 1+1/8, 1+2/8, 1+4/8, 1+6/9, 2
There is no semitones within the pentatonic scale that make the notes sound good together. The scale has the following interval pattern:
1
The interval between the third and forth notes is more than 1 tone. Likewise between the fifth and the next octave note.
(2) Major scale is built from the pentatonic scale plus two notes. Two note was added in the interval higher than 1 tone - sub-dominant and the leading note. The pentatonic notes have the follow relative frequency to the tonic:
The two additional notes are 1+1/3 (which is 1 semitone above 1+1/4) and 1+7/8 which is 1 tone above 1+2/3 and 1 semitone below 2 (octave).
1, 1+1/8, 1+1/4, 1+1/3, 1+1/2, 1+2/3, 1+7/8. 2
Major scale has the following interval pattern:
WWHWWWH
A drawback of the major scale is the tendency towards definite, complete statements.
(3) Minor scale has less definite full stops. Minor scale takes the same set of note as a major scale but use a different tone as the root. For example, C manor and A minor uses the same set of note but the root (tonic) is C and A respectively.
There are 3 different forms of minor scale.
Natural minor scale has the following interval pattern:
WHWWHWW
Comparing to the major scale, 3 notes (including the leading note) move down 1 semitone.
Comparing C Major to C Minor, the 3, 6 and 7 notes (E A B) are flat in C Minor.
C, D, E, F, G, A, B, C
C, D, E♭, F, G, A♭, B♭, C
The relative frequency is:
1, 1+1/8, 1+1/5, 1+1/3, 1+1/2, 1+3/5, 1+3/4, 2
Natural minor lacks the leading note. So it does not sound good when the melody going up as the seventh and the octave note is too far apart. It sounds good for melody travelling down in pitch (descending melodic minor).
For the ascending melodic minor, 2 of the notes are re-instate to their major positions. The leading note is restored and its neigbouring note also to smoothing out the big gap. The sixth note also bumped up a semitone so that it does not sound too far apart from the leading note too.
Ascending melodic minor scale has the following interval pattern:
WHWWWWH
C, D, E, F, G, A, B, C
C, D, E♭, F, G, A, B, C
The relative frequency of ascending melodic minor are
1, 1+1/8, 1+1/5, 1+1/3, 1+1/2, 1+2/3, 1+7/8, 2
For composing melody, we use the natural minor for the part going down and melodic for the part that going up. However, the two minor scales pose a problem for creating chord which sounds good for both directions. The harmonic minor is a compromise by only restoring the leading note from the natural minor.
WHWWHW#H
The 6 and 7 note is now 1.5 notes apart. This creates a melodic awkward.
Classical musician practice minor scales by playing melodic minor as the scale ascend and natural minor in descend. Harmonic minor scale is rarely practised. This is more a harmonic tool and not a melodic one.
Wednesday, January 12, 2011
Key Signature
The sharp and flat have fixed position and sequence in key signatures.
#: Father Charles Goes Down And Ends Battle
b: Battle Ends And Down Goes Charles's Father
Sharp Key Trick - For keys that have sharp, find the last sharp and go one note higher. If the note is sharped in the key signature, the key is sharped.
For example, for A Major, there are 3 sharps. The last one is G. So the key is A Major. For F# major with 6 sharp, the last sharp is on E. since note F is sharped, the key is F# Major.
Flat Key Trick - Find the second last flat (from the right). The name of the flat note is the name of the key. Similarly, if the note is flatted in the key signature, the key is flatted.
For example, Ab Major with 4 flat, the last flat is D and the second last flat is A. As note A is flatted in the key signature, the key is Ab major
#: Father Charles Goes Down And Ends Battle
b: Battle Ends And Down Goes Charles's Father
Sharp Key Trick - For keys that have sharp, find the last sharp and go one note higher. If the note is sharped in the key signature, the key is sharped.
For example, for A Major, there are 3 sharps. The last one is G. So the key is A Major. For F# major with 6 sharp, the last sharp is on E. since note F is sharped, the key is F# Major.
Flat Key Trick - Find the second last flat (from the right). The name of the flat note is the name of the key. Similarly, if the note is flatted in the key signature, the key is flatted.
For example, Ab Major with 4 flat, the last flat is D and the second last flat is A. As note A is flatted in the key signature, the key is Ab major
Sunday, October 24, 2010
Remote Database Access
There are 2 programmatic interfaces. One approach is to use Dynamic SQL, of which the SQL text is passed from client to server. The other approach is to disguise the remote database access underneath the normal database interface. The database schema indicates that certain tables reside on a remote machine. The database is used by the programmer in a normal way, just as if they are local (except for performance and additional error messages to handle).
Remote database access generated large network overhead because of the sheer amount of data that passed back from the server to the client. This is not good for transaction processing. Most database supports stored procedure. This turns remote database access into a form of RPC with 2 differences:
(1) it is run-time and not a compile-time interface with no IDL equivalent
(2) the procedure is typically written in proprietary language or commonly in Java.
Stored procedure approach is faster than remote database access in general. On the other hand, for ad hoc queries, remote database access is more suitable. The reason was the returned data is too dynamic (number, type etc) for RPC-like call to handle efficiently.
There are many remote database access technology. Microsoft has ODBC (Open Database Connectivity), OLD DB (Object Linking and Embedding Database), ADO (Active Data Objects) amd ADO.NET. In Java environment, there is JDBC and JDO (Java Data Objects). Oracle has Oracle Generic Connectivity and Oracle Transparent Gateway. IBM has DRDA. Each vendor wanted the customer to use their technology and integration engine. Most database however supports ODBC and JDBC.
Remote database access generated large network overhead because of the sheer amount of data that passed back from the server to the client. This is not good for transaction processing. Most database supports stored procedure. This turns remote database access into a form of RPC with 2 differences:
(1) it is run-time and not a compile-time interface with no IDL equivalent
(2) the procedure is typically written in proprietary language or commonly in Java.
Stored procedure approach is faster than remote database access in general. On the other hand, for ad hoc queries, remote database access is more suitable. The reason was the returned data is too dynamic (number, type etc) for RPC-like call to handle efficiently.
There are many remote database access technology. Microsoft has ODBC (Open Database Connectivity), OLD DB (Object Linking and Embedding Database), ADO (Active Data Objects) amd ADO.NET. In Java environment, there is JDBC and JDO (Java Data Objects). Oracle has Oracle Generic Connectivity and Oracle Transparent Gateway. IBM has DRDA. Each vendor wanted the customer to use their technology and integration engine. Most database however supports ODBC and JDBC.
Remote Procedure Call
Procedure calls are a major feature of most programming language. Therefore, it is logical to extend this to access remote service. The idea is that both client and server program can remain the same, just as if they were on the same machine.
The best-known RPC mechanisms are Open Network Computing (ONC) from SUN Microsystems (now Oracle) and Distributed Computing Environment (DCE) from the Open Software Foundation (OSF), a group formed in late 1980s by IBM, HP and DEC. OSF was to be an alternative to AT&T who owned the UNIX brand name and had forma group, which include UNISYS, called UNIX International.
For C program, one include a header file in the program that contains the moduile's callable procedure declarations (procedure name and parameters) minus the logic. For RPC, instead of a header file, it uses an Interface Definition Language (IDL) file. IDL file is syntactically similar to a header file but it is also used to generate client stubs and server skeletons, which are small chunk fo C code that is compiled and linked to the client and server programs.
The purpose of the stub is to convert parameters into a string of buts and send the message over network. The skeleton does the reverse and call the server. The action of converting parameters to message is called marshalling. The advantage of marshalling is that it handles differing data formats in varions platforms. The newer term for marshalling is called serialization.
The problem with RPCs is multithreading. A client program is blocked when it is calling a remote procedure. just as it would be calling a local procedure. The wait is subject to loss of message in transport, netowrk congestion, server response problem and other unpredictable conditions which render the client to wait forever. If a program read input from user while requesting for data at the backend via RPC, two threads are required.
For server, RPC requires a separate server thread for every client connetion. If threads need to share resource, the programmer must use locks, semaphores or events to synchronize accesses.
Multithreaded programs are hard to write becuase it is extremely difficult to test due to race conditions.
The best-known RPC mechanisms are Open Network Computing (ONC) from SUN Microsystems (now Oracle) and Distributed Computing Environment (DCE) from the Open Software Foundation (OSF), a group formed in late 1980s by IBM, HP and DEC. OSF was to be an alternative to AT&T who owned the UNIX brand name and had forma group, which include UNISYS, called UNIX International.
For C program, one include a header file in the program that contains the moduile's callable procedure declarations (procedure name and parameters) minus the logic. For RPC, instead of a header file, it uses an Interface Definition Language (IDL) file. IDL file is syntactically similar to a header file but it is also used to generate client stubs and server skeletons, which are small chunk fo C code that is compiled and linked to the client and server programs.
The purpose of the stub is to convert parameters into a string of buts and send the message over network. The skeleton does the reverse and call the server. The action of converting parameters to message is called marshalling. The advantage of marshalling is that it handles differing data formats in varions platforms. The newer term for marshalling is called serialization.
The problem with RPCs is multithreading. A client program is blocked when it is calling a remote procedure. just as it would be calling a local procedure. The wait is subject to loss of message in transport, netowrk congestion, server response problem and other unpredictable conditions which render the client to wait forever. If a program read input from user while requesting for data at the backend via RPC, two threads are required.
For server, RPC requires a separate server thread for every client connetion. If threads need to share resource, the programmer must use locks, semaphores or events to synchronize accesses.
Multithreaded programs are hard to write becuase it is extremely difficult to test due to race conditions.
Saturday, September 18, 2010
NetBIOS Scope
Scope is defined as the set of NetBIOS nodes that participate in a virtual LAN. Each scope as a name called Scope Identifier (Scope ID). The most common Scope ID is an empty string ("") which is default in Windows and Samba. Scope ID are used to identify different set of nodes on the same IP LAN. In a broadcast or multicast operation, nodes with different scope ID will ignore the packet. WINS server handles requests form nay node regardless of SCOPE ID, Thus a single WINS server can support multiple scopes.
A node may belong to more than one scope. NetBIOS has no concept of scope. It is a feature of NBT (NetBIOS over TCPIP). Program calling the NetBIOS API has no way to tell NBT which scope to use. Extending NetBIOS to include scope will break existing program and creating incompatibility problem with other transport (e.g. Netware).
Scope ID are used by Name Service and Datagram Service, but not Session Service. Scope ID is used to idefntify virtual NetBIOS LAN and operates at a lower level than the NetBIOS API.
A node may belong to more than one scope. NetBIOS has no concept of scope. It is a feature of NBT (NetBIOS over TCPIP). Program calling the NetBIOS API has no way to tell NBT which scope to use. Extending NetBIOS to include scope will break existing program and creating incompatibility problem with other transport (e.g. Netware).
Scope ID are used by Name Service and Datagram Service, but not Session Service. Scope ID is used to idefntify virtual NetBIOS LAN and operates at a lower level than the NetBIOS API.
Subscribe to:
Posts (Atom)