SongTrellis
Music and Musical Know-how For You

Members
Join Now
Login

Home | How-Tos | Directory | Our Composers | The Rhythms | Play Rhythm | Rhythm Web | Tonematrix | Chord Grid | The Changes | Song Discussions | Public Ideas | SongTrellis Recommends... | Video Links | Great Performances | SongTrellis Music Editor | The Lessons | Jukebox | The Animations | Our Contributors | Latest Topics | Tunetext | Workscore Chord Entry | Chord Entry By Grid | Workscore Composer | Music Tool Lore | Harmonic Interval Palette | Harmony Projects | Search | Video Demonstrations | Playlists | What's a Songtrellis? | FAQ | Feedback

Author David Luebbert
Posted 9/2/09; 8:12:28 PM
Msg# 5663 (top msg in thread)
Prev/Next 5662/5664
Reads 499

Demo: how to make a Tunetext Button to display and play a melody

A tunetext button is a smallish musical score wrapped within a rectangular border that is clickable within a web posting. The hint text "Click on music to play" always is displayed below the graphic that shows the score, like this:

hrmintettxt
Click on music to play

When you click on a Tunetext button, a page is launched which performs the score as a MIDI background sound and shows the score again.

There is a "Edit This Tunetext" button shown immediately to the right of the score on a Tunetext page, which opens a form that shows the parameter lists that the SongTrellis Tunetext Service interpreted to create the score.

This demo will show you how a simple little language with a small number of parameter types can describe arbitrarily complex melodies in sufficient detail to produce a MIDI performance and a score that notates these melodies.

The goal of this demo is to provide you with enough information so that you understand how Tunetext parameters specify a score and so that you can change the parameter lists of an existing score, or type your own lists to create a new score.

You'll be able to press the "Submit" button in a Tunetext Entry form and hear your music played an instant later.

Make sure you click on the Tunetext Buttons listed below to hear the notated music play. Then when the Tunetext page launches, press the "Edit This Tunetext" button to open the editing form for that tunetext, which will show you the parameters that were used to build the score for the button.

Unadorned pitch names entered in a Tunetext parameter list cause unadorned whole notes to be built on those pitch names.

The definition of the example below contains nearly the simplest possible tunetext definition. If you click on the score you'll see that parameters for Melody Voice 1, consist of only an instrument specification, a list of note names, and an 'up' operator to place the very last note, the 'c' into the next higher octave.

This list goes like this:

'inst:41,c,d,e,f,g,a,b,up,c'

(click on the score below and then press "Edit This Tunetext" in the Tunetext form that launches to see where this tunetext parmeter list was entered to create this music)

Here's the English translation of the parameter list:

Play this voice using Standard MIDI Instrument number 41, Violin. Since there is no specification of the octave where the new notes are going to be placed, they will be placed in octave range 4 except for the last 'c' note which will be placed in octave 5, an octave higher because of the presence of the 'up' operator.

Since there are no modifications made to the default whole note duration for the voice, all eight of the notes will be whole notes placed on the pitches, c,d,e,f,g,a,b, and then the next higher c.

Tunetext demo1
Click on music to play    Submitted on 8/30/09; 12:52:55 PM  by David Luebbert



Adding integer numbers to the list tells the Tunetext interpreter to place the following notes in that numbered octave

The parameter list for the next next Voice 1 specification contains three copies of the list used for the previous example, except that we've prefixed the second and third copies with an integer number which declares that the following notes will be entered into the octave range specified by that integer.

Here's the parameter list with the octave specifying integers that were added colored in teal:

'inst:41,c,d,e,f,g,a,b,up,c,3,c,d,e,f,g,a,b,up,c,5,c,d,e,f,g,a,b,up,c'

The first set of 8 notes are placed into octave range 4 by default. The second 8 are placed in octave range 3, and the last set of 8 is placed in octave range 5.

Tunetext demo2
Click on music to play    Submitted on 8/30/09; 12:56:29 PM  by David Luebbert


Adding the '/2' operator to the list decreases the durations of the notes that follow by making them last half as long as the previous notes entered

For this example we've added a fourth set of 8 notes to the list, again built on the pitches c,d,e,f,g,a,b and c. The interesting thing here is that were using operations that change the durations of the notes that we are adding. Every time we start playing notes in a new octave range, we include a "/2" to divide the duration that will be given to next range of notes at the beginning of each new group of 8 notes.

Since the default note entry duration is whole note, the first 8 notes are whole notes. Because we do '/2', the next run of 8 notes are half notes. Because there is a '/2' in front of the names of the next group of 8 notes, those are entered as quarter notes. The next /2' causes the notes that followed to be entered as eight notes, and the final '/2' operator causes the final grouping of 8 to be entered as sixteenth notes. Here's what the Melody Voice 1 parameters look like. The '/2' operators we've added are colored teal. The octave change operators are red colored in this example.

'inst:41,c,d,e,f,g,a,b,up,c,3,/2,c,d,e,f,g,a,b,up,c,5,/2,c,d,e,f,g,a,b,up,c,4,/2,c,d,e,f,g,a,b,up,c,2,/2,c,d,e,f,g,a,b,up,c' Tunetext demo3
Click on music to play    Submitted on 8/30/09; 1:01:57 PM  by David Luebbert

Using the '*2' operator to the list increases the durations of the notes that follow by making them last twice as long as the previous notes entered. We've also used the 'r' operator 4 times to add 4 rests to the score.

Here's the parameter list we used for this one:

'inst:41,/16,c,d,e,f,g,a,b,up,c,3,*2,r,r,r,r,c,d,e,f,g,a,b,up,c,5,*2,c,d,e,f,g,a,b,up,c,4,*2,c,d,e,f,g,a,b,up,c,2,*2,c,d,e,f,g,a,b,up,c'

We divide by 16 at the beginning of the parameters to ensure the first eight notes we enter will be 16th notes. The we did '*2' to change the durations of the following rests and notes we enter to have 8th note duration. We do '*2' again to transition to using quarter note durations, '*2' again to enter half notes, and finally do '*2' a final time to enter whole notes.

Note that you can use any integer you wish after the * to scale the note entry duration to have a new larger value.

>Tunetext demo4
Click on music to play    Submitted on 8/30/09; 1:05:52 PM  by David Luebbert


Same as last except we reversed the pitch name order and introduced the 'do' operator which places the following note in the next octave down from the previously entered notes

Here's the parameter list we used:

'inst:41,/16,7,c,do,b,a,g,f,e,d,c,*2,r,r,r,r,c,d,e,f,g,a,b,up,c,3,*2,c,do,b,a,g,f,e,d,c,5,*2,c,do,b,a,g,f,e,d,c,4,*2,c,do,b,a,g,f,e,d,c'

The 'do' operators are shaded red.

Tunetext demo5
Click on music to play    Submitted on 8/30/09; 1:11:20 PM  by David Luebbert


We introduce the use: operator to set a pitch, then enter notes on that pitch by entering the durations as fractions. We can enter note durations to build notes on the last used pitch, or can enter pitches to build notes on the last used duration. This trick usually lets us type smaller parameter lists (roughly half the size of lists where we type everything out).

Here's the parameter list we used:

'inst:41,use:eb,1/4,1/4,1/4,1/4,use:d,1/3,1/3,1/3,use:c,1/2,1/2'

'use:eb,1/4,1/4,1/4,1/4' means to build four quarter notes on eb in the default octave, octave number 4.

'use:d,1/3,1/3,1/3' means to divide the next measure into three equal notes that are built on d in the fourth octave.

'use:c,1/2,1/2' means to divide the last measure into half notes build both of those notes on c.

Tunetext demo6
Click on music to play    Submitted on 8/30/09; 1:13:33 PM  by David Luebbert


Now we build exactly the same score be setting the duration using "/" and "*" and repeat the pitch names of the notes to build notes of those pitches built on the last durations that we set.

Here the parameter list goes:

'inst:41,/4,eb,eb,eb,eb,*4,/3,d,d,d,*3,/2,c,c'

We are telling the Tunetext interpreter to divide the default whole note duration in four and to enter four notes on eb using the quarter note duration. The '/4,eb,eb,eb,eb' operator substring does this.

Next we multiply by four to recover whole note duration then divide that by three to set the next note duration to whole triplet duration. We enter three notes with that duration on d. The '*4,/3,d,d,d' operator substring does this.

Finally, we multiply by three to recover whole note duration, then divide by two to set the next nore duration to half note duration. Then we enter two half notes on c in the fourth octave. The operator substring '*4,/3,d,d,d' accomplishes this.

Tunetext demo8
Click on music to play    Submitted on 8/30/09; 1:16:52 PM  by David Luebbert


If you know the following Tunetext parameters you can enter melodies of arbitrary complexity using seven types of operators in Tunetext parameter lists:

1) The names of pitches. The permissible pitch names are a,b,c,d,e,f,g,a#,b#,c#,d#,e#,f#,g#,ab,bb,cb,db,eb,fb,gb,ab, and gb.

You can also use uppercase A,B,C,D,E,F, and G, if you wish, without penalty.

2) Integer numbers between 1 and 8 to set the octave range where next notes will be entered.

3) The 'up' operator to enter notes in the next higher octave range and the 'do' (down) operator to enter notes in the next lower octave range. These can be repeated when the next notes needed to be entered several octaves highr or lower than the last note

4) The '/' and '*' operators to scale the duration given to next entered notes by dividing that or multiplying that by an integer number (eg. *8, /7, /3, *6)

5) You can tell the Tunetext interpreter to use a particular duration given as a fraction (eg, use:1/12) and then list pitch names to build notes on those pitches using that duration.

6) You can tell the interpreter to use a particular pitch name (eg. use:f#) and then list durations expressed as a comma delimited list of fractions.

(eg. 1/4,1/8,1/8,1/12,1/12,1/12,1/4) to build a quarter note, two eighth notes, three eighth triplets and another quarter note on the given pitch.

7) You use 'r' to enter a rest with the currently set next duration value.

blog comments powered by Disqus

Please join our community at SongTrellis. Our contributors welcome your comments, suggestions and requests. As soon as you join the site (or login if you are a member) a response form will appear here.




Last update: Monday, July 19, 2010 at 5:29 PM.