A note an octave higher than another is vibrating exactly 2 times of frequency of the lower note. The Just (meant correct, true) system divide an octave using notes which is simple faction of the base note. For example, the fifth is 2/3 of the frequency of the base note. The problem is that the Just system notes may not harmonized so well among them except with the base note. For example, the tonic and the fifth frequency coincide every a few cyclerates and thus they sound harmonized. But the 2nd (8/9) and 6th (3/5) coincide every 27 cycles and 40 cycles respectively and thus they do not sound harmonized.
The equal temperament system uses formula instead of fraction to divide the scale. Specifically, ratio of the frequency for every 2 consecutive semitone are the same. Both Just and ET system use 440 Hz for A. Comparing with Just system, the note in ET is slightly out of tune with the tonic t still close enough to sound harmonized. However, while not all chord in Just sound harmonized, all chord in ET sounds moderately harmonized. This is the main difference for the 2 systems
Sunday, November 5, 2017
Applying Chord
Typically, chord is chosen based on the rhythmically emphasized notes, which usually the first note in each bar. As melody is made up by a stream of notes usually rise or fall in small tone step, not every notes in the bar would fit to the chord chosen. Choose the chord which included most of the notes in the bar. When transiting from one chord to next, use inverted chord could "smooth" out the transition. For example, to transit from C to F
C: C, E, G
F: F, A, C
Each note transverse a distance of 4 tones
If we use a inverted chord for F would reduce the movement for the tones between the 2 chords
C: C, E, G
F: A, C, F
Similar we can invert C to achieve similar effect
C: E, G, C
F: F, A, C
C: C, E, G
F: F, A, C
Each note transverse a distance of 4 tones
If we use a inverted chord for F would reduce the movement for the tones between the 2 chords
C: C, E, G
F: A, C, F
Similar we can invert C to achieve similar effect
C: E, G, C
F: F, A, C
Saturday, October 28, 2017
Finding a Tune
How do we identify a tune (melody) from a music piece amidst the sound made by many instrument that may be playing different notes at the same time? Several of human survival skills helps us to group related items (tune) and identify pattern from chaos:
(1) Proximity - related item is likely to be close to each other. Music usually uses notes that are close (1 or 2 steps up of down) in a melody. Notes in a melody also has temporal proximity. The notes flow one after another in succession
(2) Similarity - notes in a melody is usually carried by a same musical instrument like voice or piano
(3) Continuity - power to connecting the dots. Following the note flow, one can "predict" the following notes that made up a melody, even if the melody is carried by multiple instruments successively.
(4) Common fate - melody and accompaniment flows in different note pitch level, different trend (one going up and the other going down) and different rhythm.
(1) Proximity - related item is likely to be close to each other. Music usually uses notes that are close (1 or 2 steps up of down) in a melody. Notes in a melody also has temporal proximity. The notes flow one after another in succession
(2) Similarity - notes in a melody is usually carried by a same musical instrument like voice or piano
(3) Continuity - power to connecting the dots. Following the note flow, one can "predict" the following notes that made up a melody, even if the melody is carried by multiple instruments successively.
(4) Common fate - melody and accompaniment flows in different note pitch level, different trend (one going up and the other going down) and different rhythm.
Sunday, October 22, 2017
Sensory Disonance
A note entering an ear causes the ear drum to vibrate. The in turn stimulate a patch of hairs in the cochlea in the inner year. Different frequency will stimulate a different cochlea patch. When several notes is heard, multiple cochlea patches are stimulated. Patches for 2 semitone may have overlapped area. The brain would need to work herder to identify them. This biologically caused us to sense the sound combination of 2 semitone as dissonant.
Interestingly, this same condition may appear to tones that are greater than semitones in the lower frequency range. In other words, chords in lower frequency range did not sound as smooth as the same chord in a higher frequency range. That's why musician does not play chord with bass instruments.
Object Serialization
Serialization is to make an object persistent across session. An object exists in memory of a program instance (e.g. Javascript). Once the program terminated, memory is released and the object ceases to exist. To preserve am object across different program instances, the object must be stored in an persistent media (disk). The object memory layout is converted to string and kept on disk.
JSON2 library contains routine to serialize a JavaScript object (stringify) and to recreate the object in memory from a serialize object (parse).
JSON
In addition to using "new" keyword, JavaScript Object can also be created directly from literal values. For example,
Obj1 = {“member1” : “this is member 1”, “member2” : “2”, member 3 : 3, member4 : Obj2};
Or using array notation:
Obj1 = [“this is member 1”, “member2”, 3, Obj2];
JSON is derived from the literal form of the Object in Javascript. The possible JSON value can be a string, number, object, array, true, false and null.
HttpServlet
As most servlet is written to handle request delivered by http protocol, the HttpServlet extends the GenericServlet and provide methods specially created to handle http requests.
HttpServlet defines doGet and doPut methods which can be overridden by the real servlet to process the request. doGet and doPut eventually returns to the Servlet service method. There are more "do" methods for the other http request types such as "head" etc.
HttpServlet also defines 2 new objects, httpRequest and httpResponse to be used in place of the ServletRequest and ServletResponse objects.
HttpServlet defines doGet and doPut methods which can be overridden by the real servlet to process the request. doGet and doPut eventually returns to the Servlet service method. There are more "do" methods for the other http request types such as "head" etc.
HttpServlet also defines 2 new objects, httpRequest and httpResponse to be used in place of the ServletRequest and ServletResponse objects.
Subscribe to:
Posts (Atom)