KeyKit :: Library Functions

addbootfunc(func)
Adds a function to the list of functions that will be automatically invoked when KeyKit is rebooted.

allsusoff()
Return a phrase containing a "sustain off" on all channels. Useful for resetting things if you have a hanging note.

ano()
Return a phrase containing all-notes-off messages on each channel. This does not include note-offs for each individual note, however.

apply(target,source,apptype,startquant)
Apply stuff (pitch, volume, timing, etc.) from the source phrase to the target phrase. The apptype is the bitwise-or of PITCH, VOLUME, DURATION, TIME, EXACTTIME, CHANNEL. Default apptype is TIME|DURATION

applyfunc(p,func,chunksize)
This function splits a phrase into chunksize-sized chunks, applies the function func to some of them (every other one, by default), and returns the result, pasted back together.

arpeggio(phrase)
Returns an arpeggiated version of the phrase. One way of describing it is that all the notes have been separated and then put back together, back-to-back.

arrayprint(array)
Prints all the elements in the given array. Works for arrays of any dimension.

arraysort
Sorts the elements in the given array, and returns the sorted array.

attime(phrase,time)
Returns those notes in the specified phrase that are sounding at the specified time. If a note ends exactly at the specified time, it is not included.

bpm(beatsperminute)
Changes the tempo based on beats per minute, rather than microseconds per beat

bsdemo()
This is an example of using the bsguide() function.

bsguide(arr,arrkey,keyguide,noteguide,stepsize,lng)
Synthesize a monophonic phrase based on these arguments: arr .br An array whose elements are phrases, each one specifying the allowable notes that can be used on a given step. For example, if bsarr contained these elements: arr[1]='c' ; arr[2]='c,e,g' ; arr[3]='c,g' ; arr[4]='g' then only a 'c' would be allowed in the first step, and the second step would allow a 'c', 'e', or 'g'. The arr array can be of any size; when it runs out, it is reused from the beginning. For example, in the example above, the fifth step would allow only a 'c'. arrkey .br The key that the phrases in the arr array are meant to be in. E.g. in the example above, the value of arrkey would most likely be 'c'. This is needed so that the arr array can be transposed to other keys. keyguide .br A phrase that will determine the key (or really, chords) in the final result. For example, if the value of keyguide was 'c,c,c,f', the notes picked during the first three beats would be based in C, and the final beat would be based in F. Essentially the phrases in the arr array are transposed based on these notes. noteguide .br A phrase whose notes will be used as "guide" points in picking the pitches in the final result. For example, if the guide phrase was 'co5,co4,co3', then the first note in the final result would be as close as possible to 'co5', and the note picked on the second beat would be as close as possible to 'co4'. If the notes of guide are very close together, then they will strongly influence the general shape of the final result. If instead the notes of guide are farther apart, then the final result will be allowed to meander more freely between the guide notes (but still subject to the contraints of the arr array described above). E.g. a guide phrase of 'co5d384,co4' would allow 4 beats of meandering before being pushed back toward 'co4'. stepsize .br This is the step size of the final result. E.g. a value of 1b/4 means the result would consist of sixteenth notes. lng .br The desired length of the final result.

canonic(note)
Returns the canonical pitch of a note, ie. a number between 0 and 11.

chadjust(melody,chords)
Adjusts the notes of the melody phrase so that they fall on the notes of the chords that are playing (at the same time) in the chords phrase.

changeprogchange(p,frompatchnum,topatchnum)
Return p, where every program change message matching the frompatchnum is changed to topatchnum. The program change numbers are 1-based.

chaninfo(p)
Return a string giving channel information about phrase p.

chfilter(melody,chord)
Return a copy of the melody phrase, leaving only those notes that match the chords that occur in the chord phrase at the same time.

chord(root,type,oct)
Return a chord, where root is the root note, oct is the octave number, and type is a string that identifies the type of chord - possible values are: "major", "minor", "maj7", "min7", "maj9", "min9", "sus", "dim", "aug", "Maj69", "MajB769", "HalfDim", "Dim9", "NModMaj1", "NModMaj2", "NModMaj3", "NModDom1", "NModDom2", "NModDom3", "NModDom4", "ArtDim", "AOVoic1", "AOVoic2", "AllMaj", "Res", "Vitr1", "Vitr2", "Fourths", "Pr1", "Pr2", "Pr3", "Pr4"

closest(note,scale [,direction] )
Returns a note from the specified scale that is closest in pitch to the specified note. If the optional direction argument is given, it specifies the direction (1==up, -1==down) that we want the chosen note to be in (relative to the original note). Specifying the direction also guarantees that a note different from the original is chosen (if possible).

closestmap(nt,map)
The map argument is a set of notes. This function takes the single note nt and changes its pitch to the closest note in the map set.

closestt(phrase,time,limit)
Return the single note in the specified phrase that is closest in time to the specified time. If the limit argument is given, the search is limited to notes within that amount of time (i.e. to notes between (time-limit) and (time+limit)).

completescale(key,scalename)
Return a phrase which is in the given key and scale, and extends from the lowest note (in the key/scale) to the highest note.

completescalephrase(p)
Return a phrase which has the notes in p duplicated across all octaves.

consloop()
This is intended to be the one-and-only task that reads from the Consinfifo, a special fifo that is automatically opened whenever KeyKit is booted, and to which KeyKit sends any characters typed on the console. consloop() forwards the characters to whatever task is supposed to be reading the console. If Consgrabfifo is set, it will send them there, otherwise it sends them to the main command interpreter, which is reading from interpfifo.

constant()
This function initializes various constants that are needed by other funcitons.

controller(ch,cn,val)
Return a controller message, where ch is the channel (1-based), cn is the controller number, and val is the value. Removes all bank-select controller messages (controller 0 followed by controller 32) from a phrase. Note that it leaves the program change message which usually follows.

dedup(ph)
Remove any duplicate notes (in time and pitch) from a phrase.

dedupdur(ph)
Remove any duplicate notes (including comparison of duration) from a phrase.

delay(ph,tm)
Return phrase ph, delayed by time tm. Removes all rests (sections where nothing is playing) from a phrase. Set up input/output ports. Look for a file keylocal.k first, and if that doesn't exist, use some defaults

dupsof(p)
Return a phrase containing one copy of any notes that are duplicated in phrase p

echo(ph,num,rtime,rfactor)
Return phrase ph echoed num times, with rtime delay between each echo, and with the volume of each echo decreased by rfactor. NEW BEHAVIOUR - 8/9/99 - the length of the result is now explicitly set. This is more "right", but some algorithms may have been depending (unknowingly) on the old semantic.

echomaster(ph,fnum,ftime,ffactor,bnum,btime,bfactor)
Return phrase ph with echoes, forward and back. fnum is the number of forward echos, ftime is the echo time, ffactor is the volume reduction factor. bnum/btime/bfactor is for the backward echos.

evalstring(s)
Takes a string and evals it. Useful when you want to put something in the background - you just "task evalstring(...)"

eventime(ph)
Return phrase ph with all of its notes evenly spaced in time.

filetopitches(filename)

findroot(ph)
Given a phrase, try to guess the root of what's being played. The algorithm was given to me by Christopher John Rolfe (rolfe@sfu.ca), who says it was culled from W.Russo, Jazz Composition and Orchestration, p.25, ex.7.

findtask(function_name)
This function looks for a running task that is executing the named function (which is specified as a string, not as a function value). If found, the task id is returned. If not found, the return value is -1.

flip(phrase [,about])
Flip the pitches of the specified phrase about some intermediate pitch (i.e. high notes become lower, and low notes become higher). Given a single argument, the flip is done about the average pitch of the original phrase. A second argument can specify a particular pitch about which to flip.

floor(f)
Returns the floor (maximum integer that is less than f).

fractal(ph,depth)
Returns phrase ph fractalized - each note becomes a miniature version of the entire phrase, transposed by the note's pitch. The depth determines how many times this process is repeated. Watch out, this will produce huge phrases.

gcd(n1,...)
Returns the greatest common divisor of all of its arguments

gcd2(n1,n2)
Returns the greatest common divisor of two integers

getsysexdump(sendmessage,tmout)
This function retrieves a sysex dump from an attached MIDI device. The 'sendmessage' argument is expected to be a sysex message that, when sent to the device, will cause it to send back a sysex dump (or any sysex message, really). For example, for a TX81Z, the value of 'xf0432004f7' will cause it to send back a sysex dump containing all patches. The 'tmout' parameter is a timeout value in milliseconds - if this time elapses without receiving any output from MIDI input, the function will abort and return an empty phrase.

gmresetall()
Returns a phrase containing controller messages that reset everything appropriately for the beginning of a General MIDI piece.

grabmouse()
This function arranges for all mouse messages to be intercepted and sent to a particular window, rather than being routed to the windows underneath the mouse. When you want to restore things to normal, call ungrabmouse().

grabmousefifo()
This function arranges for all mouse messages to be intercepted and sent to a new fifo, rather than being routed to the windows underneath the mouse. The fifo id of this new fifo is returned as the value of grabmousefifo(). When you want to restore things to normal, call ungrabmousefifo().

gridinit()
This is the code that initializes the graphics mode of KeyKit. It starts up things like the mouseloop() task, which handles mouse input, and sets up the screen with the initial tool set by calling toolrc().

highest(phrase)
Returns the highest-pitched note in the specified phrase.

highestnt(phrase)
Returns the highest-pitched note in the specified phrase.

inport(port)
Open a MIDI input port

interploop()
This is the main command interpreter that executes the statements that a user types interactively on the console. It reads from the interpfifo fifo, and characters are normally put on this fifo by consloop().

isinscale(note,scale)
Return true (non-zero) if the specified note exists in the specified scale. The scale phrase need only specify a give pitch once - it is assumed to be duplicated over all octaves.

isnearbeat(note ,beat_interval, tolerance )

isonbeat(note [,beat_interval] )
Returns true (non-zero) if the given note lands on the beat. The default beat interval is 1b; a second argument can specify an different interval (e.g. isonbeat(note,4b) would return true if the note fell on any 4-beat mark).

keyrc()
This is the very first function called by KeyKit, unless the -r option is specified when KeyKit is invoked. This function must initialize everything necessary for the proper running of KeyKit. This is normally done by calling normboot() to set up the command interpreter and start other primary tasks.

khslider(vmin,vmax,vinit,invokefunc,args)
Create a horizontal slider object and return its id. When slider is moved, the invokefunc will be called with 2 arguments - the first will be the current value of the slider, and the second will be the args value. The vmin, vmax, and vinit values are the minimum, maximum, and initial values for the slider.

kslider(vmin,vmax,vinit,invokefunc,args)
Create a slider object and return its id. When the slider is moved, the invokefunc will be called with 2 arguments - the first will be the current value of the slider, and the second will be the args value. The vmin, vmax, and vinit values are the minimum, maximum, and initial values for the slider.

kvalbutton(vals)

lastbunch(ph,spc,types)
Return the last "bunch" of notes in ph. The value of spc is the time that determines where the bunch ends - as soon as a blank space of that size is detected, the bunch has ended. This is useful for grabbing the last little bit of the Recorded phrase. If a third argument is given, it is a bitmask of note types to look for - all other types are ignored.

latest(phrase)
Return the ending time of the latest note in the given phrase.

legato(phrase)
Extends the duration of each note to abutt the start of the next note. Doesn't modify the duration of the last note.

limitval(v,minv,maxv)
Takes a number and limits it to the specified range.

listports()
A simple utility that lists the available MIDI ports to the console.

lowest(phrase)
Returns the lowest pitch in the specified phrase.

lowestnt(phrase)
Returns the lowest-pitched note in the specified phrase.

makenote(pitch [,duration [,volume [,chan]]] )
A simple utility for generating a single-note phrase. The pitch is the only required argument; additional arguments specify the duration, velocity, and channel.

makerootevery(melody,intrvl)
Figure out a root note (using findroot()) every intrvl beats, and return it.

maxvolume(phrase)
Returns the largest volume in the specified phrase.

midiloop()
This is intended to be the one-and-only task which reads messages from the Midiinfifo, a special fifo that is opened whenever KeyKit is rebooted, and to which KeyKit sends messages containing all MIDI input. Any task wanting to read MIDI input should add an entry to the Midiin array. The index of the Midiin array is normally the task id, and the value of the array element is the fifo id.

milliclicks(milli)
Returns the number of clicks equivalent to the specified number of milliseconds. Note that this is dependent upon the current tempo().

millisince(tm)
Returns the number of milliseconds since a given time

millisleep(milli)
Sleep (i.e. pause the task which calls this function) for the specified number of milliseconds.

minduration(phrase)
Returns the smallest duration in the specified phrase.

minvolume(phrase)
Returns the lowest volume in the specified phrase.

mono(phrase,type)
Returns a monophonic version of the specified phrase. If type==0, high notes are given priority (e.g. if two notes are playing simultaneously, the higher note will be chosen). If type==1, low notes are given priority. If type==2, the priority is randomized.

mouseloop()
This task is intended to be the one-and-only task that reads directly from the Mousefifo, a special fifo that is opened whenever KeyKit is rebooted, and to which KeyKit sends messages about changes in the mouse state. mouseloop() normally figures out which window is underneath the mouse, and sends the message to the Mousein fifo for that window. If someone wants to grab the mouse, they should set Mousegrabwind, and mouseloop() will instead send the mouse messages to that window. This procedure should be done with the grabmouse() and ungrabmouse() functions.

nanopatch(ch,bank,prog)
Return sysex that changes a parts bank/program. Assumes that the 16 parts are assigned to channels 1-16. ch is 1-based bank is 0-based prog is 0-based

nextquant(number,quantize)
This function quantizes the specified number using the specified quantize value, and returns the result. The result is guaranteed to be greater than the original number; if quantization would produce a smaller number, it is increased by the quantize value. This is typically used when you want to quantize a time value, and want to guarantee that the result will refer to some time in the future, not in the past.

nexttime(ph,st)
Return the time of the next note AFTER time 'st', in phrase 'ph' If there are no notes after it, returns -1;

nonnotes(ph)
Return all non-notes (i.e. controller, sysex, etc) of ph.

normboot()
This is intended to be the default function that gets called when KeyKit initially boots or reboots. KeyKit calls Rebootfunc() when it reboots, so in order for this function to be used, the statement "Rebootfunc=normboot" should be included in keyrc(). Any tasks that must always be active (for example, the loops that monitor mouse and console input) should be started here. To register a function that will be automatically restarted upon a reboot, you should add it to the Rebootfuncs array.

normexit()

normintr()
This function is intended to be the default value of Intrfunc, which KeyKit calls when an interrupt is received, typically when the user presses the interrupt character on the console. This function forces a reboot. If graphics mode is enabled, an attempt is made to save the current tool configuration in the file "keydump.lst", which will then be restored after the reboot. In this way, a fairly clean restart is performed.

normredraw()
This function is intended to be the default value of Redrawfunc, which KeyKit calls whenever the screen must be redrawn. It redraws the root window (i.e. erasing the screen), and then sends a redraw message to all children windows (i.e. all the active tools).

normresize()
This function is intended to be the default value of Resizefunc, which KeyKit calls whenever the screen is resized. Normally this function does nothing. By setting the variable Autoresize to 1 (e.g. in liblocal/prerc.k), you can cause this function to automatically resize all the active tools to fit within the new screen size.

nrpn(ch,mm,ll)
Return an NRPN message constructed from ch (channel, 1-based), mm (most-significant byte) and ll (least-significant byte).

nsimul(ph)
Return the maximum number of simultaneously-sounding notes in a phrase.

numquant(number,quantize)
This function quantizes the specified number using the specified quantize value, and returns the result. The result may be less than the original number. If you want to guarantee that the result is not less than the original (which is typical when you are quantizing a time value and want to guarantee that the result is some time in the future), use nextquant().

onlynotes(ph)
Return only the regular notes (non-controller, non-sysex, etc) of ph.

ornament(ph,orn,doscaleng)
Apply phrase orn to each note of phrase ph - i.e. each note of phrase ph will be turned into a copy of phrase orn. If doscaleng is non-zero, then the copy will be scaled to the duration of the notes in phrase orn. If doscaleng is zero, the copy will have the original timing.

outport(port)
Opena a MIDI output port

patchunmap_sc8850(p)
If p is a patch change message, return its entry in the patchmap Return 0 if it's not a patch message.

patchunmap_sd80(p)
If p is a patch change message, return its entry in the patchmap Return 0 if it's not a patch message.

pathescape(s)
Takes a file pathname, and returns a version of the string that can be safely printed to a file and re-read.

picknote(phrase, n)
Returns n random notes from the specified phrase. If n is omitted, a single random note is returned.

pickphr(phrase1,phrase2,phrase3...)
Randomly chooses and returns one of its argument phrases.

pitchbend(ch,val)
Construct a pitchbend message, where ch is the channel (1-based) and val is the pitchbend value, input range is -8192 to 8191.

pitchlimit(p,p1,p2)
Adjust the pitches of notes in phrase p so that they fall between p1 and p2, by shifting the notes in octave increments.

preecho(ph,num,rtime,factor)
Return phrase ph with each note preceeded by 'pre' echoes. num is the number of echoes, rtime is the time between them, and rfactor is the volume factor (between 0.0 and 1.0) If not provided, rtime and rfactor default to 1b and 0.9

prelocaldefaults()
This sets any default values before keylocal.k is called.

prevquant(number,quantize)
This function quantizes the specified number using the specified quantize value, and returns a result that is equal to or less than the original number.

progchange(patchnum,ch)
Return a program change message, where patchnum is the patch number (1-based), and ch is the channel (1-based).

quantize(phrase,quant [,limit] )
Quantize a phrase. Each note's starting time will be quantized by the specified quant value. If a limit is specified, notes that would need to be moved by an amount larger than this limit will not be adjusted at all.

quantizedur(ph,qnt)
Quantize the duration of all notes in ph.

quantizefirst(ph,qnt)
Quantize the first note of ph, and shift the rest of the phrase by the same amount.

randdur(phrase,range)
Returns the phrase with the duration of its notes randomly varied within the specified range. For example, if the range value is 2, the note durations will be adjusted by values ranging from +2 to -2.

randpitch(phrase,range)
Returns the phrase with the pitch of its notes randomly varied within the specified range. For example, if the range value is 2, the note pitches will be adjusted by values ranging from +2 to -2.

randvol(phrase,range)
Returns the phrase with the velocity of its notes randomly varied within the specified range. For example, if the range value is 2, the note velocities will be adjusted by values ranging from +2 to -2.

rcdefaults()
This sets any default values for which it is intended that they can be overridden by postrc(). Machine-dependent rcdefault things

readedit(fifo,prompt [,history] )
This function reads from a fifo, allowing line editing. When a complete line has been entered, it is returned. The optional third argument lets you access and maintain a history of previous lines (this feature is not yet implemented).

readedit2(fifo,prompt)
This is a variation of readedit that allows you to press ESC and get put into "notepad" on the history. To activate, set ConsoleReadedit=readedit2 in your liblocal/postrc.k When you're done writing your script in the text editor, save the file, close the editor (optional), then press ESC again. The whole KeyKit code you edited will be evaluated as a single line (so take care to end your lines with a ";") Another feature of readedit2 is the TAB key which recalls previous

readfile(filename)
This function reads an entire file (all lines of it) and returns it as a single string. NOTE: might or might not read the newlines at the end of lines Currently it gets rid of the newlines, but that's not good. I'm reluctant to change it without checking whether it breaks something.

readkey(filename)
This function reads a phrase from the specified file, which is is expected to contain a phrase in KeyKit format, i.e. the same as a phrase constant in the KeyKit language.

readmf(filename)
Reads the specified Standard MIDI File and returns its contents as a single phrase (with all tracks merged).

readraw(filename)

remotecons(port)
Starts a remote keykit console on the given port. KEYALLOW environment variable is hostname of machine allowed to connect.

repeat(phrase,num_times)
Repeat a phrase as many times as specified. The length attribute of the phrase determines the offset of the repetitions.

repfade(p,ntimes,inout)
Repeat the phrase the specified number of times, gradually fading it in or out (by including or excluding more notes on each repeat). If inout>0, it starts out including only a couple of notes, and ends by including the entire phrase - ie. a fade in. If inout is less than 0, it's a fade out.

repleng(phrase,length)
Repeat the specified phrase as many times as it takes to fill the specified length of time. The resultant phrase is truncated to the exact length, if it doesn't come out evenly.

resetall()
Returns a phrase containing controller messages that reset pitch bend, modulation, breath control, sustain, and channel pressure on all 16 channels to nominal values (i.e. 0, or in the case of pitch bend, 0x40).

reverse(ph)
Reverse the phrase in time, so the first notes come last, and the last notes come first.

revpitch(phrase)
Reverse the pitches of a phrase (e.g. the pitch of the first note will become the pitch of the last note). The timing is left intact.

round(f)
Returns the rounded integer value of f.

sc8850patch(channel,patchnum,variation)
Return the message that will set an sc8850/sc8820/scd-70 patch channel and patchnum are 1-based, variation is 0-based (to match

scadjust(melody,scale)
Adjust the notes in the melody phrase so that each note falls on the closest note in the scale phrase.

scadur(phrase,factor)
Scale the durations of a phrase by multiplying the duration of each note by a specified factor.

scafilt(melody,scale)
Return a copy of the melody phrase, leaving only those notes that fall on the scale specified by the scale phrase.

scaleng(phrase,length)
Scale the phrase to the specified length by expanding it length-wise, adjusting both the time and duration of the notes.

scatimes(phrase,factor)
Scale a phrase by multiplying the time and duration of each note by a specified factor.

scavol(phrase,factor)
Scale the volume of a phrase by multiplying the volume of each note by a specified factor.

sd80patch(channel,patchnum,variation)
Return the message that will set an sd80/sc8820/scd-70 patch channel is 1-based, patchnum is 0-based (because the sd80 patch list used 0-based), and variation is 0-based (to match the LCD display of the sd80. The soundset value is 80 (special 1) 81 (special 2) 96 (classical) 97 (contemporary) 98 (solo) 99 (enhanced) 87 (user)

seconds(secs)
Returns the number of clicks in a given number of seconds.

setdefaults()
This function sets various global default values.

shuffle(ph)
This function takes a phrase, splits in in 2 halves (along time) and shuffles the result (ie. first a note from the first half, then a note from the second half, etc.). The timing of the original phrase is applied to the result.

spread(ph,num,rtime,rfactor)
Return phrase ph "spread" num times, with rtime delay between each iteration, and with the volume of each iteration decreased by rfactor. A "spread" is like an echo, except that notes are repeated in BOTH directions, forward and back.

status([str])
When called with no arguments, this function prints a list of all currently-running tasks. If a string argument is given, the list will only contain those tasks whose stacktrace (the output of taskinfo(tid,"trace")) contains that string.

step(ph,stepdur)
Convert a phrase to be in step time, ie. all notes with the same spacing and duration. Overlapped notes (no matter how small the overlap) are played at the same time.

stringtest([milliseconds [,verbose]])
Runs an on-demand stress test of string construction, lookup, substrings, split fields, phrase attributes, and garbage collection.

strip(ph)
Strip off any leading and trailing rests from a phrase

sussect(time,channel)
Generate a phrase with controller messages that press the sustain pedal on the specified channel and let it up after the specified amount of time.

swapnote(ph)
Swap every two notes in the phrase ph.

syncphr(phrase)
This function returns a copy of the specified phrase, shifting the starting time so that it is as close as possible to 0 (but not less than 0). The amount by which the time is shifted must be a multiple of lng (which, if not specified, is the length of the Met. This is typically used when you want to play a phrase that has been taken from the middle of some other phrase. The goal is that the playback should still be synchronized to the current Met.

tonerow(p)
Better version of tonerow, works on all types of notes. Return a tone row of the notes in phrase p. Each note in the original phrase appears exactly once in the result, but in a random position. The original time/duration of the notes is retained.

tonerow_old(p)
Return a tone row of the notes in phrase p. Each note in the original phrase appears exactly once in the result, but in a random position. The original time/duration of the notes is retained.

transpose(phrase,amount)
Transposes the phrase by the specified amount.

trrackpatch(ch,bank,prog)
Return sysex that changes a parts bank/program. Assumes that the 16 parts are assigned to channels 1-16. ch is 1-based bank is 0-based prog is 0-based

ungrabmouse(w)
This is the complement to grabmouse(), releasing the mouse so that mouse events are distributed normally. The w (window) argument should be the same as that passed to grabmouse().

ungrabmousefifo(fifo)
This is the complement to grabmouse(), releasing the mouse so that mouse events are distributed normally. The fifo argument should be the fifo that was created and returned by grabmouse().

uniqnum()
This function returns a new unique number. Useful for inventing id numbers for menus, or for any other purpose.

virusbpatch(part,bank,prog)
Return sysex that changes a parts bank/program. Assumes that the 16 parts are assigned to channels 1-16. ch is 1-based bank is 1-based prog is 0-based

virusbunpatch(p)
If p is a patch change message, return its name. Return "" if it's not a patch message.

warrange(args)
This is used to let you interactively rearrange windows.

wconsole(window)
This tool is a console window, allowing interaction with the interactive command interpreter.

wdelete()
This utility lets you point to and delete an object.

wgroup()
Create a phrase group for multi-track editing.

wpack(args)
This is used to let you interactively pack windows.

wsmmgroup()
Create a phrase group for multi-track editing.

xystr(xyarray)
This function is used when you want to print(the value of an xyarray. It returns a string version of the specified xyarray. For example, xystr(xy(0,0,4,4)) would equal "0,0,4,4". It works for 2-element xyarrays (i.e. with subscripts "x" and "y") as well as 4-element xyarrays ("x0", "y0", "x1", "y1").