The Gemara in Masechet Rosh Hashanah establishes that the Torah obligation to sound the Shofar on Rosh Hashanah requires blowing three "Terua" sounds, with a Tekia blown before and after each Terua. However, the Gemara teaches, different views exist as to how to define the word "Terua." One view identifies the Terua as a series of brief, staccato sounds – what we call "Terua," whereas according to another view, the word "Terua" means three longer sounds – what we call "Shebarim." There is also a third opinion, that the Terua is the combination of both these sounds – what we call "Shebarim-Terua."
The Gemara then cites the remark of Rabbi Abahu that given this uncertainty, we should blow all three sounds. And so we blow three sets of "Tashrat" (Tekia, Shebarim-Terua, Tekia), three sets of "Tashat" (Tekia, Shebarim, Tekia), and three sets of "Tarat" (Tekia, Terua, Tekia).
The Bet Yosef (commentary to the Tur by Maran, author of the Shulhan Aruch), in Orah Haim (590), brings a responsum written by Rav Hai Gaon (d. 1038) addressing a very simple question: what did the Jews do before Rabbi Abahu’s ruling? How could they have been uncertain about the meaning of a Terua? Why did they not simply see how Jews were blowing the Shofar?
To answer this question, Rav Hai Gaon postulates a novel theory – that in truth, one fulfills the Misva of Shofar regardless of which of these three sounds are blown as the Terua. As far as the Torah obligation is concerned, one has to blow the Terua as a crying sound, and the Gemara brings the three different sounds that qualify for this requirement. Thus, each congregation chose which Terua sound to blow. Rabbi Abahu then came along and decided that it would be preferable for there to be a uniform procedure followed by all communities within Am Yisrael, and so he instituted that all congregations should blow all three Terua sounds.
The Rambam (Rav Moshe Maimonides, Spain-Egypt, 1135-1204), however, in Hilchot Shofar, writes that the tradition of how to blow a Terua was forgotten. Over the course of the tumultuous exiles, certain traditions were forgotten, and the meaning of the term "Terua" is one such tradition. Rabbi Abahu therefore instituted that in order to ensure we fulfill this Torah obligation, we must blow all three Terua sounds.
There is some discussion as to where the Shulhan Aruch stands on this issue. On the one hand, he writes (Orah Haim 590) that we blow all three sounds because we are uncertain of the meaning of "Terua" – expressing the view of the Rambam. However, two chapters later, the Shulhan Aruch discusses the requirement to blow the Shofar again during Musaf, and he writes that the "Tashrat" sequence is blown during the "Malchuyot" section of Musaf, "Tashat" is blown during "Zichronot," and "Tarat" is blown during "Shofarot." We would have thought that according to the Rambam, all three would have to be blown in each section of Musaf in order to ensure that we fulfill the requirement in each of the three sections. Accordingly, the Shulhan Gavoah (Rav Yosef Molcho, 1692-1768) writes that the Shulhan Aruch felt that both views should be taken into consideration. By contrast, the Mishna Berura (Rav Yisrael Meir Kagan of Radin, 1839-1933) explains that since the basic requirement of Shofar blowing is fulfilled before Musaf, there is no need to blow all three sounds during each of the sections of Musaf. In the Mishna Berura’s view, the Shulhan Aruch indeed follows the Rambam’s view, but felt we can be more lenient during Musaf, since the Torah obligation had already been fulfilled.
Interestingly enough, this difference of opinion between the Rambam and Rav Hai Gaon might yield practical Halachic implications. Rav Haim Vital (1543-1620) writes in Sha’ar Ha’kavanot that his mentor, the Arizal (Rav Yishak Luria, 1534-1572), would recite Vidui (confession) during the sounding of the first 30 Shofar sounds on Rosh Hashanah. The Arizal taught that during this time, the Satan becomes confounded, such that he is unable to interfere with our confession. The time of the sounding of the Shofar, then, is the most opportune time to confess. The Rashash (Rav Shalom Sharabi, 1720-1777) taught that Vidui should be recited in between the three sequences of Shofar blasts – meaning, in between "Tashrat" and "Tashat," and in between "Tashat" and "Tarat." This custom is mentioned also by the Ben Ish Hai (Rav Yosef Haim of Baghdad, 1833-1909), in Parashat Nisavim. Indeed, some editions of the Mahzor present the Vidui text at this point in the service.
At first glance, it would seem that according to the Rambam’s view, it would be improper to verbally declare Vidui during this time. After all, according to the Rambam, we do not know for certain that we’ve fulfilled the Misva of Shofar blowing until we’ve blown all three sequences – "Tashrat," "Tashat," and "Tarat." As such, we would assume, speaking – even reciting Vidui – would be forbidden once the Beracha over the Shofar is recited until after all three series of sounds have been blown, in order not to make a Hefsek (disruption) between the Beracha and the fulfillment of the Misva. According to Rav Hai Gaon, however, one fulfills the Torah requirement of Shofar once the first sequence is blown, and thus in his view, it is perfectly acceptable to recite Vidui in between the sequences of Shofar sounds.
However, Hacham Bension Abba Shaul (Jerusalem, 1924-1998) writes in his Or Le’sion (1:31) that in truth, even the Rambam would permit reciting Vidui in between the sequences of Shofar blasts. He explains that even if the first sequence did not fulfill the Misva, nevertheless, the final Tekia in that sequence can potentially serve as the introductory Tekia to the correct Terua sound. Therefore, after completing a sequence, one has begun the Misva, insofar as the final Tekia can, potentially, be the Tekia which introduces the actual Terua with which one fulfills the obligation. Hacham Bension draws a comparison to a Halacha concerning one who does not have a vegetable for Karpas at the Seder. The Shulhan Aruch rules that he uses a piece of Marror for the Karpas, and he recites the Beracha over the Misva of Marror ("Al Achilat Marror") at that point, when he eats a small piece for Karpas. Then, when he eats his Ke’zayit of Marror later, he does not repeat the Beracha. This shows that it is legitimate to recite a Beracha before beginning a Misva, even it is not completed until later, and even though one will be speaking in between the beginning of the Misva and the completion of the Misva. In the case of Shofar, too, one may recite Vidui after having begun fulfilling the Misva by hearing the final Tekia of the sequence which had just been completed.
Hacham Bension adds that even if this would be considered a Hefsek, it would still be acceptable to recite this Vidui. Since the Misva is fulfilled even if this interruption is made, he explains, it is worth reciting the Vidui to gain the benefits of Vidui during this time even at the expense of making a Hefsek. Regardless, Hacham Bension does not believe that this constitutes a Hefsek, as explained above.
Summary: According to Kabbalistic teaching, the sounding of the first 30 Shofar sounds before Musaf is an opportune time for the recitation of Vidui. The Vidui is recited in between the sequences of "Tashrat," "Tashat" and "Tarat," and the Vidui text appears at these points in some editions of the Mahzor.