There is, in fact, a very deliberate relationship between Baroque music and emotions. This is a fascinating topic that sits at the intersection of muisc, history, philosophy, and rhetoric. As noted, Johann Mattheson's Der vollkommene Capellmeister (1739) is an excellent source on this topic. Extended portions of an English translation can be found in, "Johann Mattheson on Affect and Rhetoric in Music" from the Journal of Music Theory, 1958, archived at JSTOR (Part I and Part II). Unfortunately, JSTOR requires a payment to view the article, but I found rogue copies on the internet.

The Passions

First, let's look briefly at how the philosophy of the time viewed emotions, known as passions or affections. I'm not an expert here, but apparently these are well expounded in Descartes' Passions of the Soul (1649). Descartes was a dualist - the immaterial mind and material body were separate entities that nevertheless interacted to form a complete union. Thus he discusses passions as "perceptions… of the soul", but they also were given a grounding in physical causes (i.e. "some movement of the spirits" in the blood). The key take away here is that they could explained in a rational, scientific manner, as a natural, physical process. External causes induced passions, and those passions in turn could produce actions. All passions were good in moderation, and potentially dangerous in excess or in misuse; but they could also be mastered by force of mental discipline.

Mattheson refers to Decartes' dualism when describing the relation between music and emotions:

the effects of well-disposed sounds on the emotions and the soul… is material that is as far-reaching as it is useful… Of much assistance here is the doctrine of the temperaments and emotions, concerning which Descartes is particularly worthy of study, since he has done much in music. This doctrine teaches us to make a distinction between the minds of the listeners and the sounding forces that have an effect on them.

However, he's content to leave the details to philosophers:

What the passions are, how many there are, how they may be moved, whether they should be eliminated or admitted and cultivated, appear to be questions belonging to the field of the philosopher rather than the musician. The latter must know, however, that the sentiments are the true material of virtue, and that virtue is nought but a well ordered and wisely moderate sentiment.

According to Mattheson, it's important for music to invoke passions in order to be "virtuous", but one should not get carried away:

Where there is no passion or affect, there is no virtue. When our passions are ill they must be healed, not murdered. It is true, nevertheless, that those affects which are our strongest ones, are not the best and should be clipped or held by the reins. This is an aspect of morality which the musician must master in order to represent virtue and evil with his music and to arouse in the listener love for the former and hatred for the latter. For it is the true purpose of music to be, above all else, a moral lesson.

Of course, even as early as the ancient Greeks, the power of music to influence emotion was well recognized. This brings us to the next topic: Rhetoric.

Rhetoric

Strictly speaking, rhetoric is the art of discourse, oration, and public speaking. More generally, it is the art of persuasion. At first blush, it might seem odd that crafting debates and speeches should have anything to do with music, but they are actually closely related.

As far back as Aristotle, rhetoric has recognized different modes of persuasion that can be applied to an audience. On one hand is logos which is an appeal to reason, using arguments based on facts and logic. But an equally valid approach is to use pathos -- an appeal to emotion (a third approach, ethos, is an appeal to the credibility of the speaker). Indeed, a well constructed oration should use pathos to appeal to the emotions, with the goal of moving the listener's passions, urging them to action. The Latin orator Cicero claimed in De oratore (55 BC) that rhetoric's "full power" was seen in "calming or kindling the feelings of the audience."

Insofar as music moves the emotions, it is a form of pathos, and thus falls into the realm of rhetoric. As put by the German Baroque music theorist Johann Neidhardt (quoted by Mattheson): "The purpose of music is to stir all the affects by nothing but sounds and their rhythm and thus to outdo the best orator." The key to applying the principles of rhetoric to music is to realize that "argument" refers not to a logical argument over the truth of some statement, but to an emotional appeal to persuade the audience to feel a certain way. During the end of the Rennaissance and the beginning of the Baroque, the application of rhetoric to music composition was sometimes known as musica poetica.

The art of rhetoric has 5 basic practices (known as canons) that are employed in the construction of a oration, but the ones that apply the most to composition are: Inventio (the selection of topic, and discovery of arguments), Dispositio (organization of arguments), and perhaps Elocutio (style, including rhetorical figures). The other two canons, Memoria (memorization) and Pronuntiatio (delivery), have more to do with performance rather than composition.

Invention

In oratory, Invention, is used to create a thesis and discover arguments. It can be thought of as somewhat analogous to a more methodical form of brainstorming. It often used certain stock relationship patterns (definitions, subdivisions, comparisons, contradictions, cause/effects), known collectively as loci or topoi, as sources of ideas for exploring a subject. Musically speaking, invention is the creation and development of a theme. Themes can be created from combining figures, and from using topics of invention.

Figures

Mattheson advocates building up a theme from a collection of smaller figures, which form a sort of vocabulary:

...one must have a store of particular formulas that can be used in oratorical generalization. This means that, by experience and attentive listening to good music, the composer must have collected 'moduli' [motifs], little turns, clever passages, and pleasant runs and jumps.

He is rather against creating a catalog of these though:

One must not use these devices in such a way that one has an index of them and that one treats them, in an academic manner, like a box of inventions. Rather, they should be considered in the same way as the vocabulary and the expressions used in speaking. We do not put these on paper or in a book, but keep them in mind and by means of them we are able to express ourselves in the most comfortable way without constantly consulting a dictionary. If one desires and needs to do this, one may, of course, make oneself a collection of all the fine passages and moduli that one has ever come upon… However, lame and patchy things will result from this laborious and deliberate piecing together of such fragments…

Topics of Invention

Mattheson also admits that the loci topici "are occasionally very fine aids", and makes a big deal of applying the exact same loci that one might find in regular rhetoric to music. He describes two specific loci as being the most important:

Locus notationis (notation) he uses to refer to the technical aspects of the written notes themselves -- their durations, inversions, repetitions, etc…

Locus descriptiones (description) is considered the "most essential guide to invention", and "contains the bottomless sea of the human sentiments which… are to be represented and described in music." Essentially, this form of invention deals with creating themes to depict the desired emotion. Mattheson writes that it is hard to categorize:

Because of the manifold and mixed nature of the passions, however, one cannot list as many clear and particular rules for the locus descriptiones as for the preceding one.

Mattheson continues to (briefly) apply numerous other rhetorical loci of invention, which could lead to choices of musical texture, instrumentation, usage of consonance or dissonance, and even the effect of the performance venue (church vs. ballroom). Another important locus is using contrast (of any sort: fast vs. slow, high vs. low, etc...) which provides "almost infinite possibilities of invention" regardless of "whether or not these are occasioned by a text." Even imitating other composers can be a source of ideas: "As long as it is done modestly, it need not be condemned."

To see that J. S. Bach viewed Invention as an important basis for composition, one need look no further than the title of his aptly-named keyboard Inventions, which, beyond teaching students to play 2 and 3 part keyboard music, also provided examples of:

not only getting good inventions, but developing the same satisfactorily... all the while acquiring a strong foretaste of composition.

Disposition

Disposition is the arrangement of this material, and thus has to do with the resulting structure of the composition. This can be thought of as providing a generic rhetorical template, similar to today's "three act films". In speeches, the structure tends to follow a preset (but somewhat flexible) pattern including the following elements: exordium (an introduction), narratio (a narrative account of the facts), propositio (proposition), confutatio (refutation of counter-arguments), confirmatio (the proof of the case), peroratio (conclusion). Different authors give slightly different names or orders for these items. The ones I list here are the ones Mattheson uses, and he once again makes a point of applying the exact same rhetorical structures to music as one would to a speech ("Musical disposition differs from rhetoric only in its medium, for it must observe the same six parts as does a speaker…").

He does admit that strictly and deliberately following this pattern can lead to pedanticism, and that most good musicians tend to more-or-less follow this subconsciously, the same way that people talking arrange what they are saying by "natural mental instinct". Thus disposition might be better seen as a tool for analysis; indeed Mattheson analyzes an Aria in such a fashion. Honestly, though, it's not completely clear to me from his writing how these rhetorical functions are applied to the structural form of the music. For a similar analysis, I found this page, which is an analysis of a Bach cantata movement using the same rhetorical breakdown.

The New Music

One could credibly claim that using rhetoric in music to convey emotional texts was the primary motivation for the creation of the Baroque style. At the end of the Rennaissance, in Florence, Italy, there was a group of poets, musicians, and intellectuals known as the Florentine Camerata who met under the patronage of the Italian Count de Bardi with the purpose of reviving the ancient Greek tradition of musical drama (or at least their imagination of what Greek musical drama might have been). Among others, this group included Vincenzo Galilei (scientist, musician, and father of Galileo) and the composer Giulio Caccini, who published a collection of songs in 1602 called "Le nuove musiche" ("The New Music"). In his introduction to this set, he explains (with shameless self-promotion) the development of this new style. I found a portion of an English translation in this pdf, as well as a blog article that also contains an extensive translation and discussion. To avoid link-rot, I'll summarize it here as well.

Essentially, the Camerata recognized that the Polyphony of the day, as typified by the music of Palestrina (youtube), was unsuitable to the emotional singing required for drama, because it

prevents the words from being well understood and thus spoils the sense and the form of the poetry. I refer to the kind of music that elongates a syllable here and shortens one there to accommodate the counterpoint, turning the poetry to shreds.

He appeals to Plato and ancient Greeks who taught

the purpose of music is to penetrate the minds of others and create the marvelous effects that writers admire. In modern music, these effects could not be achieved through counterpoint… not a word could be understood in the pervasive vocalises, whether on short or long syllables… It was evident, therefore, that such music and musicians could offer no delight other than that which harmony gave to [the sense of] hearing alone, for they could not move the intellect, lacking the understanding of the words.

For Caccini, extensive use of ornamentation was not expressive. It might tickle the ear, but by obscuring the text, it was only suitable for less expressive music.

I believe that passagework brings a certain titillation to the ears of those who do not really understand what it means to sing with expression. For, if they knew, they would undoubtedly detest such passagework since nothing could be further from expression… lengthy runs in the voice are badly used. Nevertheless, I have allowed some passagework in… less expressive music.

As an alternative, the Camerata pictured the ideal of a Greek bard, reciting poetry while strumming chords on a lyre. As a result, the rules of polyphony were relaxed, and the bass line and inner voices were de-emphasized.

The thought occurred to me to introduce a kind of music for which someone else would be able to make musical speech… This kind of music passes through dissonances sometimes while holding on to the bass note… The middle parts played by the instrument express [only] certain figures since these parts are not much good for anything else.

The new style of music that was created (later referred to as Monody), and as typified by Le nuove musiche (youtube), involved a single vocalist singing a melody line, with all the other parts of the music playing a subservient role of background accompaniment. In fact, these parts weren't even written out in full, but were rather notated as interval numbers underneath a bass line, representing the harmonies to play. This technique: "figured bass," "thoroughbass," or "basso continuo," became a ubiquitous distinguishing feature of Baroque music, and even helped inspire new ideas about harmony and tonality. (See: When were the terms "Major" and "Minor" applied to keys?)

This new melodic style was largely successful, and was used in the development of the entirely new genre of Opera which marks the beginning of the Baroque. The recitatives of opera especially demonstrate this new style, though it was also employed in arias. The idea of monody can also be heard in instrumental music, especially in the slow movements of early sonatas. In actuality, the new style (stile moderno) did not supplant the old style (stile antico). Both monody and polyphony survived and evolved side-by-side, (and even intermingled into trio sonata texture) providing composers with a larger palette of tools to convey the intended meaning.

Vocal Music

Notice that the impetus for the creation of Baroque music largely had to do with vocal music, and not instrumental music. It is easier to spot these rhetorical connections in music for voice because the text generally makes clear the intended effect of the music, while instrumental music tends to be more abstract. Mattheson makes a similar argument that vocal music is easier to compose than purely instrumental, although even instrumental music has rhetorical meaning:

The assumption that the locus under discussion depends on the character of the words to be set to music is not far from right, since the so-called text of vocal music serves chiefly to describe affects. However, one must know that even where there are no words, in purely instrumental music, in fact in any melody, the purpose must be that of picturing the governing sentiment. Thus even the instruments can speak intelligibly and understandably, by means of [nothing but] their sound. In writing instrumental music… the composer may sometimes write according to some special emotion of his own invention; in vocal pieces it is the poet who… usually determines the affect. This is a supporting reason for one of my axioms, namely, that it is easier to write for singers than for players. It requires much more feeling and sensitivity to express one's emotions without prompting than to follow the suggestions of someone else.

Since Handel (a good friend of Mattheson's) is the most prominent master of English language Baroque works, he's a good place to turn for examples of the use of rhetoric in vocal music. The Ode for St Cecilia’s Day (HWV 76) seems especially apt for study, since it musically makes the argument that music can "raise and quell" any passion, with numerous examples. Of course, rhetorical devices abound in Bach as well.

Discussion

With that philosophical, rhetorical, and historical background out of the way, I'll address some of the specifics in your question.

Emotional Restraint

You mentioned that you thought Baroque music often showed a certain emotional "restraint", which I found really interesting and insightful, but is something that I'd never really thought too much about. I can think of a couple reasons why that might be so.

Modern Interpretation Sometimes, performers can get stuck in a modern mindset that this music is so old and venerable that it must be played very seriously and stuffy; this can cause the emotion of a piece to suffer. Fortunately, the interest in reviving historically authentic performances has been doing a lot to help in this area, and some recordings are quite fresh sounding. Ex: I was recently listening to Handel's Messiah, and the tempo for the movement Oh Thou, That Tellest Good Tidings was so plodding it was practically a dirge, where something more active and cheerful might better fit the lyrics. "Good tidings", "Get thee up", "lift up thy voice with strength", "Be not afraid", "Arise", "Shine". Imperatives abound; this is clearly meant to be a bold call to action, not a lullaby (the following movement is a Chorus, as if the choir responded to the soloist's call to raise their voice. This call/response structure is another rhetorical device Handel used!)

A product of it's time Baroque music may sound restrained to today's post-Romantic ears, accustomed as they are to styles as diverse as Beethoven, Jazz, film score, and Pop. But compared to the preceding era of Renaissance music, it is often quite daring, especially in its freer use of dissonance, and chromatic harmonies, which were a relatively new fad at the time, but today sound rather old hat.

Introverted Emotions Not all emotions are necessarily raw, intense, unbridled passion in the first place. Many very specific emotions, such as contentment, yearning, and apprehension are of a more mild, reflective nature. But these emotions were at least as likely to be the subject of a piece as the more rowdy and rambunctious ones (and probably more so: see the next point).

Moral Restraint Recall that in Descartes' doctrine of the passions, emotions were good, but could also be misguided or overindulged, and thus needed to be restrained (but not eliminated!). By analogy, food is good and necessary, but overindulgence is harmful to one's health, and is the sin of gluttony. This idea of emotional restraint also dates back to ancient Greek philosophers like Aristotle, who saw emotional control as a mark of morality and virtue. The idea here is to avoid being controlled by your emotions; if you got accustomed to feeling intense emotions too frequently, you might enjoy the feeling, overindulge, and loose yourself to them.

But sometimes, you'll find pieces that really just seem to let loose: For example, here's a particularly impassioned and "unrestrained" (and insanely virtuosic) interpretation of the final movement from a Telemann concerto (TWV 52 e1), which I believe was likely influenced by Telemann's exposure to Eastern Europe "gypsy" folk dances -- an exposure that Telemann said left him with enough ideas to last a lifetime.

Musical Elements Employed

You ask whether these affects are created only through organization, or with other things like harmony. You probably noticed this from the discussion on Invention, but the truth is that any musical element can be utilized to create the desired affect, whether that effect is restrained or not. These include (but are not limited to) elements such as: tempo, meter, key, structure, instrumentation, choice of themes, use of consonance and dissonance, harmonic progressions, dynamics, and ornamentation. The more you learn about music theory, the better able you are to appreciate how these are used to create various affects.

Regarding the Durante movement that you ask about, the effect seems to be largely caused by the frequent use of dissonance to create tension, and a reluctance to resolve them in the expected timely manner.

As far as various melodic forms, Mattheson discusses their resulting affects at some length. Here's a small handful of excerpts:

The minuet "has no other affect than moderate gaiety."

"has no other affect than moderate gaiety." The gigue 's affect is "hot and hurried eagerness"

's affect is "hot and hurried eagerness" The sarabande "expresses no passion other than ambition."

"expresses no passion other than ambition." "The passion or affect expressed by the courante is sweet hope."

is sweet hope." Regarding the sonata , I'll quote Mattheson at length, because it relates to your question about creating single a single affect at a time. It seems that a sonata's goal is to please everyone, so each of the various movements should have different, contrasting affects. A much more distinguished position among the instrumental melodies is occupied by the sonata… Its purpose is mainly to oblige and to give pleasure. What must rule in the sonata is a certain complaisance, ready to do anything, and of service to every listener. A person who is sad will find in it something plaintive and sympathetic; a sensualist will find something pretty; an angry person can find violence, etc., in the various movements of the sonata. The composer who keeps this in mind in his adagio, andante, presto, etc., will succeed.

, I'll quote Mattheson at length, because it relates to your question about creating single a single affect at a time. It seems that a sonata's goal is to please everyone, so each of the various movements should have different, contrasting affects. Similarly, about concerti grossi, he says: The affects of the grand concerto are manifold and of an alternating type, as in the case of the sonata. There is not such frequent alternation, however. Sensuality reigns in a concerto of this type… Contests… are not lacking. Thus jealousy and revenge, envy and hatred, and other such passions are represented in the concerto.

A Single Affect

You ask about movements covering a single affect. As you can see from the discussion above, this is largely the case, especially with dance movements, although each movement in a suite, sonata, or concerto may support different, contrasting affects. It's also often true in individual movements of vocal works, such as arias, since the music is meant to support a single text.

However, as we saw earlier, an affect can be explored from multiple angles, including from an opposing viewpoint. In vocal music, this leads to an important case worth discussing. The most common form of aria was the Da Capo Aria. This is a ternary form consisting of an introductory section, a contrasting section, and a (possibly abbreviated) reprise of the original section: ABA'. The B section is usually in an alternate key (such as the relative minor), and the lyrics and music of this section often contain contrasting material: possibly the same topic but from an alternative point of view, or a supporting argument, or a counter-argument that is to be refuted (rhetorically, a confutatio).

Sometimes (but not always) the difference between these sections can be quite pronounced. A few examples that come to mind are provided below, but the main take away is that these contrasting passions are used to support a single overall argument:

The Trumpet Shall Sound gets a mention here mostly because of this excellent youtube video that uses it as an example to describe the Da Capo Aria form.

Perhaps my favorite example is the aria Es ist vollbracht, from Bach's St. John Passion, reflecting on the final words of Christ ("It is finished/accomplished"). The first section is a lament, as one might expect for the death of Christ. It is in a minor key and a slow tempo, with close dissonances, and lyrics that speak of hope for suffering souls and the ending of sin's night: the result of Christ's death. To drive the magnitude of this accomplishment home, Bach completely changes the mood in the B section. In a major key, the voice clearly imitates the harmonic series of a trumpet fanfare while singing about "the hero of Judah" who "triumphs in his might.", and the da gamba is replaced by vigorous string tremelos.

Another example from Handel's Messiah can be found in the Aria But Who May Abide. The A section uses a rhetorical question to make a somber condemnation: no one can stand before God's judgement. The B section expands on this idea, portraying the judgement as a refiner's fire by using rapid tremolos in the strings to represent leaping flames. Technically, this isn't strictly a Da Capo Aria. To the usual ABA', Handel adds a reprise of the B section: ABA'B'.

The Da Capo Aria is especially important, because it's basic format frequently got copied over to purely instrumental forms, such as sonata and concerto movements, and may have become a basis for the later Sonata Allegro form of the classical era. You can also see here Mattheson's ideal of sonatas and concertos portraying multiple sentiments.

On a smaller-scale individual phrases could undergo word painting in a way that supported various parts of the text in different ways. For example, the aria from Messiah that we looked at earlier (Oh Thou, That Tellest Good Tidings) has a generally happy and active mood, but the phrase that supports the text "Lift up thy voice, with strength lift it up" has an ascending melody line consisting of numerous upward trumpet-like leaps that give it a strong, bold character (and which appears only with these words). Meanwhile, the accompaniment for "Behold thy God" suddenly halts all the runs of sixteenth notes, as if to stop and take a look. The accompaniment for the parallel passage, "The glory of the Lord," has a very similar progression, but now the violins are providing dazzling arpeggios that depict said glory. These kinds of small phrases don't really change the overall mood of the piece, and may seem trivial in comparison to some of the tone painting that was done later, in the Romantic Era, but they still provide a rhetorical basis for persuasively depicting various portions of the text and thus contribute to the overall affect.