From the help for Tune Smithy
Skip navigation Overview Seeds etc User guide Main Window Musical note intervals Scales Midi in Analyse sound
Contents
Hide Contents

Making Audio Clips for a list of chords

Back to User Guide2 , or FAQ: How do I use the feature to make midi clips for all the file names in a web page?

Overview , The file name code , Parameters , Instructions

Overview

Makes audio clips for file names listed in CLIPS.TXT in the current directory. Here the current directory means the folder you see in FTS if you use File | Open or Save As . They are all saved into the current directory.

Suppose you want a midi clip of a major chord. Add this line to your CLIPS file:

1o1_5o4_3o2.mid

This is ordinary ratios notation, with 'o' instead of '/'. The reason for using 'o' is because '/' isn't valid in a Windows file name.

The clip this makes will be called ch_1o1_5o4_3o2.mid where the ch_ means that it is a chord - so a prefix gets added to show the type of clip. It will be bch_ for a broken chord or arp_ for an arpeggio. For broken chords and arpeggios, the file name also include an asc or desc to indicate if it is ascending or descending, or both, and red_ if reduced into the octave or some other interval.. You can also use these abreviations in the names yourself, e.g. if you want one of the clips to be a broken chord, prefix its file name with bch_ , and this will overrride whatever setting you have currently in use for all the other ones.

The conventions used here are designed to make url safe file names - ones that will work not just in Windows but on any web server if you upload your files for a web page. This means it has to use underlines for spaces (because spaces aren't url safe). It uses letters of the alphabet, numbers and underlines, and that's it.

The file name can specify the chord in any notation suitable for scales in FTS. E.g. cents, ratios, hertz, or the n-et notation (such as n5/19 for 5th degree of 19-et). You can mix cent, ratios and hertz in the same scale.

You need to include the 1/1 if you want to sound this note. That's because this is a chord definition rather than a scale, so for instance,

5o4_3o2_2o1.mid

is the first inversion of the major chord - we don't want to sound the 1/1 here, so we need to be able to leave it out.

top

The file name code

To make valid Windows file names, you can't have * or / in the file name.

You can use

s for *

o for /

The remaining ones are optional, but are recommended if you want the file names to be url safe for upload to any server.

Spaces, e.g. between the notes in the chord, can be replaced by underlines (spaces aren't url safe).

e for ^ (exponentiation)

d for . (decimal point) - this one is a matter of taste - it is url safe, but as the same character is used to indicate the start of a file extension, one may find it confusing in a url, leading to double extensions e.g. 700.0.mid.

p for +

Brackets:

a for (

b for ). - Sorry, can't think of a better alphabetic mnemonic for brackets.

The file names will use the SCALA convention that decimal point = cents. It doesn't matter whether you have chosen to use that convention in FTS or not - it is always used for these file names.

So, using the SCALA convention, this is the twelve equal major chord:

0d0_400d0_700d0.mid

or

0.0_400.0_700.0.mid

if you are happy with the extra dots in the file name.

You can alternatively use a c to indicate that the number following is in cents.

So this is also the twelve equal major chord:

c0_c400_c700.mid

Formulae can use other symbols too. For these, see the Calculator (non wordy style).

So for instance you can use g for golden ratio.

To use a, b, d, e, i, o, p, s, v or u ,in a formula, prefix it with 'v ' for verbatim (ditto also for v, you would do it as vv, but v currently has no meaning in the FTS formulae), for instance:

vp or vpvi for pi (as the p would otherwise be interpreted as a + sign, and the i as a start of an instruction - see below).

To prefix a descriptive word or phrase to the rest of the filename, follow it with a space or underline, then a u. Everything before a u, if present, gets ignored when constructing the midi clip.

Here is an example:

dekany_u_3s13_5s13_7s13.mid

The clip made will be same as for 3s13_5s13_7s13.mid . without the dekany prefix.

It will be saved (depending on the settings for the midi clips) as something like: dekany_u_ch_red_2__3s13_5s13_7s13.mid

top

Parameters

The pitch used for 1/1 is the one shown in the pitch window.

Note length for each chord follows the tempo for one beat for the fractal tunes - see Bs | Tempo and Volume for Tune | Tempo (or Time for one note).

The extra note length for a chord or the last note of broken chord is as in the Bs | Arpeggio & Scale playback Options window (you get to that also from the tied quaver (eighth note) icon: Tied quaver - eighth note in most of the main window tasks)

Whenever you make or remake the clips, your current tune smithying settings, including these ones and your selection of instruments for the parts, get saved as a file CLIPS,TS in the same folder. So if you want to revert to the settings you last used to make the clips, open this file.

You will also find a CLIPS.tsProj file in the same place - which has all your settings from last time you made the clips - including all settings in FTS, colours, window positions etc etc (depending on your current settings for what to save to Tune Smithy Projects).

top

Instructions

You can include various instructions in the body of the list of file names file instead - these then overrides your setttings in FTS.

Lines beginning with a / are treated as instructions - anything else on the same line after the instruction gets ignored.

Here they are:

/NOPREFIX - saves the clip with the file name exactly as given in the clips file - doesn't add any prefixes such as ich, ired, iasc etc.. This is often the best for a web page of midi clips, as you can just use the midi file names in the clips file as they are in the web page urls.

/CHORDS = make chords (or /CH)

/BROKEN_CHORDS = make broken chords (or /BCH)

/ARPEGGIOS = arpeggios (or /ARP or /SEQ)

/DESC = descending, /ASC = ascending,

/REDUCE <nn> - reduce into interval (or /Z <nn>),

e.g. to reduce into 2/1 you use /REDUCE 2/1

/NOREDUCE - don't reduce - use the notes as they are (or /X),

/PITCH pitch of the 1/1 in hertz.

/NOTE note length in seconds.

/INSTR Instrument to play the notes on.

/EXTRANOTE extra sustain for last note of broken chord or arpeggio, in seconds.

/RESET - has same effect as File | New in the Tune Smithy tasks. Idea is to clear any such things as the fibonacci tonescapes, and effects for channels etc. It needs to be done with an instruction, because one may want to save the clips with particular settings for the midi effects etc, so one mightn't want to overrride all these settings.

/ALL - Save all the types of clips - arpeggio, chord and broken chord for each one.

/SPECIFIED - Save the specified file type only.

/MID - Save in midi format

/MP3 - Save in mp3 format

/OGG - Save in ogg format

/JAVA_AU - Save in the au format suitable for Java applets.

/WAV - Save in wav format

/AUDIO - Save in currently selected audio format (rather than midi format)

/AutoPan <min> <max> .auto stereo pans the notes of the chord so that the first note is at a pan position of <min> and the last note at a pan position of <max> . Example /AutoPan 32 96 If no numbers are set, stereo pans all the way from 0 (leftmost) to 127 (rightmost). Use /AUTOPAN 0ff to switch it off

/SpreadAcrossParts <min> <max> plays the notes on successive parts from part <min> to part <max> . Example /SpreadAcrossParts 4 8 If no numbers are set, plays on the parts 1 to 8. Use /SpreadAcrossParts 0ff to switch it off

/AutoPanSpreadParts <min> <max> auto stereo pans the parts the notes are spread over so that the first part is at a pan position of <min> <max> and the last part at a pan position of <max> .Example /AutoPanSpreadParts 32 96 If no numbers are set, stereo pans all the way from 0 (first part) to 127 (last part). Use /AutoPanSpreadParts 0ff to switch it off

/END_REST 0.5 ends the midi or audio clip with a rest of 0.5 seconds to let the resonances of the last note die away - if you use a voice with a lot of sustain you may want to set this higher to say 1 or 2.

/END_PAUSE 0.5 adds a pause between each recording and the next, again useful if the notes take a fair while to die away - not used for the midi clips.

The instruction will stay in force throughout the rest of clips.txt until overriden by another one of the same type. The clips are made, and the instructions arefollowed sequentially from the start to the end of the file..

You can change these parameters within the file name too, all except the Reset one, by prefixing with I instead of /. This is a way to change the parameters for a single file only - when done this way it doesn't affect subsequent files.

Like this:

ix_4o9.mid

(this won't be reduced, so you hear a 4/9)

or

iz_2o1_7.mid

(this will reduce 7/1 into the octave because the iz_2o1 is all one instruction, leaving 7 as the note to play).

Another instruction can be used in the file name:

ISTEPS or IS = interpret the scale as a series of steps (standard setting is, intervals from 1/1).

To include the 1/1 in the MIDI clip when using step notation, use 1/1 or 0 cents as the first step.

So the file

IS_1o1_5o4_6o5.mid

will be saved as the just intonation major chord again, while

IS_5o4_6o5_4o3.mid

is the first inversion.

You also have a couple of instructions which can be used to do a search / replace of a web page to change its links to audio files.

/REPLACE <file name> - this is a search and replace of the file specified. It just searches the file for all occurrences of .wav" , . mp3" , . au" etc - for all extensions in the list of audio formats you see in Bs | Record to File Options . It replaces them with the currently selected audio file extension. Note that it searches for the extension followed by a quotation mark. This is a method that can work with web pages, but other types of file too such as VRML - any file format that uses the convention that the url is placed in quotes, and that is unlikely to have the likes of . wav" in it to mean anything else (this is unlikely in html because any quotes in the text of the web page itself get saved as character entities rather than as quotes in the html)..

/MAKE_URLS_AND_REPLACE <file name> Same as /REPLACE , looks for all quotations ending with . wav" etc in the file - then changes them all into file names into ones suitable for urls. So for example if you have "1/(3*5).mid" somewhere in the file, it changes this to "1oa3s7b.mid".

Then, you can also make those audio clips as well. Use these instructions with especial care - any old versions of the audio clips get replaced without warning once you use Ctrl + Yes to the message in FTS to ask if you want to replace them all - and they make audio clips for All the clips linked to in the file (apart from background sound)..

/MAKE_CLIPS_FOR_AND_REPLACE <file name> Same as /MAKE_URLS_AND_REPLACE - then adds all the audio clip urls found to the list of audio clips to make. You can see which files got made by clicking the Show button after you make the clips.

/MAKE_CLIPS_FOR <file name> Makes the clips but doesn't do any conversion of file names into ones suitable for urls. Use this if you want to have file names with spaces in them and brackets, and other characters that can appear in Windows file names but are not suitable for general use in urls.

It makes all audio clips found in the file, because it isn't easy to tell from a name whether it is a url encoded formula or a more ordinary name for a file. If the file or web page has a mixture of some linksyou want FTS to make, and others that you don't want it to make, I suggest, place the web page in a new folder first, on its own. Then make the clips in FTS, and when finished copy the other audio files you have for the page on top of the versions FTS made for them.

If it's an html file, the replace options look for hrefs only, and also ignore anything within html comments. They don't make background sound clips.

The instructions for broken chords, chords , arpeggios, and whether to reduce or not and the interval to reduce into can all be embedded in the html files as comments, e.g
<!--MidiInstr NOREDUCE --> or <!--MidiInstr REDUCE 2 -->
These html comment instructions affect any clips that follow in the file.

You can also use FTS to make the clips from the DOS command line - could be useful in a batch file perhaps.

"fractal tune smithy.exe" CLIPS.TXT

where you can also include the path in the file name, such as:

"fractal tune smithy.exe" "C: \VRML DEKANY\CLIPS.TXT"

top