This is the first chapter of the MidicaPL tutorial, teaching the basics of the language.
- If you did not yet follow the preparation instructions, please do so before you continue reading.
+ If you did not yet follow the preparation instructions, please do so before you continue reading.
@@ -41,18 +41,18 @@
Instrument Definition Block
- The first thing to be defined inside of a source file must be the instruments that each channel uses.
- Each channel that will be used later must be initialized inside of a block beginning with
+ Before you can play any sounds, you must define the instruments to be used by each channel.
+ Every channel that will be used later must be initialized inside of a block beginning with
INSTRUMENTS and ending with END.
- The only exception is the percussion channel (channel 9) which may (but does not need to) be defined explicitely.
+ The only exception is the percussion channel (channel 9) which may (but does not need to) be defined explicitly.
{{> src-example src-examples.instruments }}
- Each line inside this block contains 3 columns, separated by one or more whitespaces.
+ Each line inside of this block contains 3 columns, separated by one or more whitespaces.
The last column may also contain more whitespaces. These are not interpreted as separator but as a part of the content.
@@ -69,10 +69,10 @@
1st column
2nd column
- The second column describes the instrument. It may contain a valid instrument ID or a MIDI program number.
+ The second column describes the instrument. It may contain a valid instrument ID or drumkit ID or the accoring MIDI program number.
- Valid instrument IDs can be found in the info window under Configuration / Instrument IDs
+ Valid instrument or drumkit IDs can be found in the info window under Configuration
@@ -83,8 +83,11 @@
3rd column
- In the above example we use an instrument ID for the channels 0 and 1 and a MIDI program number for the
- channels 2 and 9. The line defining the percussion channel (p) is optional. If it is omitted, the standard drumkit
+ In the above example we use an instrument ID for the channels 0 and 1, a MIDI program number for
+ channel 2, and a drumkit ID for channel 9.
+
+
+ The line defining the percussion channel (p) is optional. If it is omitted, the standard drumkit
(MIDI program number 0) is used.
The second tuplet is a 3:4 tuplet modifying all lengths by 4/3. So you see that a tuplet can also be defined to make notes longer
- instead of shorter. This tuplet contains a nested triplet (marked in blue) that has been explicitely defined as t3:2
+ instead of shorter. This tuplet contains a nested triplet (marked in blue) that has been explicitly defined as t3:2
instead of t. Because of the nesting, both tuplet modifiers have to be attached to each other.
@@ -349,7 +349,7 @@
Percussion Instruments
When playing something later in this channel, this is not a note but a certain percussion instrument.
Instead of the note name you write a percussion ID. Each percussion instrument has a long ID and a short ID.
- The valid IDs can be seen in the info window under Configuration / Percussion IDs.
+ The valid IDs can be seen in the info window under Configuration / Percussion IDs.
The next two examples are equivalent. They play the intro for "We Will Rock You" by "Queen".
@@ -368,6 +368,15 @@
Percussion Instruments
{{> src-example src-examples.billie-jean }}
+ The short percussion IDs from this example are equivalent to the following long IDs:
+
+
+
hhc equals hi_hat_closed
+
sd1 equals snare_drum_1
+
bd1 equals bass_drum_1
+
+
+ The first result score is easier to read for non-drummers. The second one is more compact and more what a dummer is used to.
@@ -376,26 +385,59 @@
Percussion Instruments
Using Soundfonts
- The first thing to be defined inside of a source file must be the instruments that each channel uses.
- Each channel that will be used later must be initialized inside of a block beginning with
- INSTRUMENTS and ending with END.
+
Include Soundfont File
+
+
+
+ In the preparation section you learned how to load a Soundfont manually in the main window of
+ the Midica application.
+
+
+ But there are a lot of different soundfonts out there, specialized for different kinds of music. So maybe you want to use different
+ soundfonts for different songs. And maybe you don't want to choose the soundfont file manually each time you switch to another
+ MidicaPL file containing another song.
+
+
+ In this case you can use the SOUNDFONT command. Its only parameter is the path to a soundfont file in the
+ .sf2 format. The path can be either absolute or relative to the source file containing the command.
+
+
+
{{> src-example src-examples.soundfont }}
+
+
+ Of cause this does not work on someone else's computer because he will probably not have the same
+ soundfont in the same file path inside of his fils system.
+ And it will also not work in an exported MIDI file because soundfont information cannot be stored in a MIDI sequence.
+
-
{{> src-example src-examples.instruments }}
-
- Each line inside this block contains 3 columns, separated by one or more whitespaces.
- The last column may also contain more whitespaces. These are not interpreted as separator but as a part of the content.
+
+
Bank Descriptions
-
{{!-- ensure a line break --}}
-
-
1st column
+
+
+ In chapter 1 you learned the simplest form of defining instruments for each channel.
+ Remember: In the second column of each line we used an instrument ID or a drumkit ID or a
+ MIDI program number.
+
- The first column contains the chanel number. Valid values are the numbers 0 - 15 and the symbol p.
+ Each ID is mapped to a program number internally. And program numbers can only have values from 0 to 127.
+ But comprehensive soundfonts can contain much more than 128 different instruments. In this case the instruments
+ are selected by a combination of a program number and a bank description.
- p is just an alias for 9 which is the percussion channel number.
+ In the second column of an instrument line the bank description can be attached to the ID or program number separated by a
+ , symbol. E.g. VIOLIN,5 or 40,5 would select a violin with the bank description 5.
+
+
+ A Bank description can consist of
+ Bank numbers can consist of an MSB and an
+ LSB. If they are not explicitly defined, they are set to 0 by default.
+
+
+ In most cases only the MSB is used. That means the LSB is 0.
-
+
2nd column
The second column describes the instrument or drumkit. In the simplest form it can just be identical with an
@@ -408,10 +450,6 @@
2nd column
bank MSB, if the LSB is 0.
-
-
3rd column
- The third column contains a description of the instrument. This will be displayed as a channel comment in the player.
-
The following example assumes that the currently loaded soundfont supports a multi-channel drumkit on bank 15360 (MSB 120, LSB 0).
Otherwise the drums could only be used in channel 9.
@@ -419,7 +457,7 @@
3rd column
{{> src-example src-examples.instruments-2 }}
diff --git a/src/partials/examples/billie-jean-2.svg.html b/src/partials/examples/billie-jean-2.svg.html
new file mode 100644
index 0000000..37ee113
--- /dev/null
+++ b/src/partials/examples/billie-jean-2.svg.html
@@ -0,0 +1,35 @@
+
\ No newline at end of file
diff --git a/src/partials/examples/instruments.midicapl.html b/src/partials/examples/instruments.midicapl.html
index c61ef55..7f51dba 100644
--- a/src/partials/examples/instruments.midicapl.html
+++ b/src/partials/examples/instruments.midicapl.html
@@ -2,5 +2,5 @@
0 ELECTRIC_GRAND_PIANO Piano
1 VIOLIN Fiddle
2 32 Bass
- p 0 Standard Drumkit
+ p STANDARD Standard Drumkit
END
\ No newline at end of file
diff --git a/src/partials/examples/soundfont.midicapl.html b/src/partials/examples/soundfont.midicapl.html
new file mode 100644
index 0000000..f0eff71
--- /dev/null
+++ b/src/partials/examples/soundfont.midicapl.html
@@ -0,0 +1 @@
+SOUNDFONT ../soundfonts/my-soundfont.sf2
\ No newline at end of file
diff --git a/src/partials/src-example.html b/src/partials/src-example.html
index 62fa462..a6f6e10 100644
--- a/src/partials/src-example.html
+++ b/src/partials/src-example.html
@@ -69,4 +69,18 @@