There are two main melodies within this piece. It's worth analysing them to be familiar with how they are constructed. Both are notated below.
The first idea is very short and is heard at bar 1. It is very stepwise overall with the exception of the ascending leap at the beginning (a perfect 4th) and the descending leap at the end (a perfect 5th). There are some passing notes although most of the notes belong to the tonic triad of D major, particularly the first three notes which could be described as triadic. Overall it is very playful and jovial, clearly in a major key (diatonic).
During the B section, this original idea is often returned to in alternation with a newer idea. This is sometimes called a ritornello (literally meaning 'return'). Examples include bar 157 (2'28) and 161 (2'32).
The second idea is heard from the start of the B section at bar 79 (1'13). This is longer (8 bars) but is still very stepwise with an overall descending trajectory in pitch. It also has an ascending leap of a perfect 4th and is rhythmically very similar, providing contrast but in a very cohesive way. Most notable are the use of appoggiaturas (the small notes). These are a type of non-harmony note, providing a sense of tension and resolution (see Harmony). They act as an ornament or melodic embellishment. Adding appoggiaturas like these was often up to the performer's discretion. Confusingly, the appoggiaturas cannot be heard by the flute from bar 79 but can be heard when the violin takes the tune a few bars later.
There are lots of devices Bach uses to develop the melodies from above. The key melodic devices include:
Ascending sequences - the flute part in bar 8 (0'07) includes a triplet idea which is repeated a tone higher on the following beat. Ascending sequences help to elevate the sense of excitement.
Descending sequences - these are often used in the process of modulation. An example is heard from bar 177 (2'46).
Scalic passages are often heard, particularly in the harpsichord to bring about a feeling of virtuosity. The passage from bar 174 (0'37) is a good example.
Trills are heard a lot in this movement. The harpsichord part seems to be littered with them! (e.g. bar 19, 0'17) The other two concertino instruments (flute and violin) also have some moments with trills (e.g. bar 110, 1'43). These are highly decorative and embellish the music in a very stylistic way.
This comparison piece is a lively gigue performed on a trumpet with piano accompaniment. It is very similar to Bach's Brandenburg Concerto movement. It is also in the style of a gigue and has a lively, rhythmic feel which is light-hearted and merry. Here are some comparable melodic features:
It is very stepwise with occasional leaps. The first 3 notes of bar one (excluding the anacrusis) is made up of three notes descending by step.
At the start of bar 2 (0'02) this idea is developed by taking the three notes and making them ascend in pitch. Turning the notes upside down like this is called an inversion.
The fifth and sixth bar (0'08) is quieter in dynamics and includes a slightly varied idea which is repeated with an ascending sequence.
At 0'23 there is an ascending interval of an octave which allows for a sense of drama as the phrase comes to an end. Though there are some intervals this large in Bach's piece they aren't nearly as noticeable.