Bach created this composition when he was very young, perhaps 18 years old. At that time he imitated the North German style which composers like Buxtehude, Bruhns, Lubeck and many other were using.
Toccata or Praeludium in North German style is composed in the so-called Stylus Phantasticus - a multi-sectional composition which has alternating free improvisatory and fugal imitative sections.
Very often such composition has 7 sections: Free-Strict-Free-Strict-Free-Strict-Free.
When composing or improvising such piece, use these 7 steps:
1. Choose a key. Open with Passagio in 4/4 meter - a melodic line in 1 voice, 2 voices for manuals or pedals which emphasizes the tonic notes. Then write the free section based on the figure from the Passagio. The first modulation is in the Dominant key. Also use excursions in the relative keys. End this section with a perfect cadence.
A sample chordal plan for this section might look something like this:
I ii42 V65 I V6 ii7-vii6/V V V6 I V65/V V V65/vi I6 IV V7 V46 V7 V46 V43 V7 I.
Duration - 1 page.
2. First fugal section in 4/4 meter. Find or compose a theme and use a basic plan - exposition and counter-exposition. End with a perfect cadence in the tonic key. Duration: 2 pages.
3. A short free section: use more suspensions here, modulations, runs and passages in the hand parts. End with a half cadence. Duration: 8 measures.
4. Second fugal section: convert your fugue theme to another meter (3/2). Create exposition and counter-exposition. End with a perfect cadence. Duration 1-2 pages.
5. Short free section: similar as Step 3. Use different figure this time. Duration 8 measures.
6. Third fugal section: convert you theme to triple meter (6/8, or 9/8 or 12/8), use the same plan as in Step 2. Duration 1-2 pages.
7. Ending short free section. Emphasize the key of Subdominant with extended plagal cadence. Duration 8 measures. If this section is a continuation of the preceding fugal section, keep the same meter and tempo.
Bottom line: for best results, always study first the works of above mentioned composers, especially those of Buxtehude.
Final tip: in order to create free sections, you could analyze his piece of your choice, take his harmonic structure but add your own figures in different keys.
By the way, do you want to learn to improvise in the style of Bach? If so, I suggest you check out my 9 day mini course in Keyboard Prelude Improvisation.
Or if you want to learn my special powerful techniques which help me to master any piece of organ music up to 10 times faster? If so, download my video Organ Practice Guide.