Scripting 6.2. Writing to the Info window

With the Info button and several commands in the Query menus, you write to the Info window (if your program is run from the command line, the text goes to the console window or to stdout instead; see \SS6.9).

The following commands allow you to write to the Info window from a script only:

echo text
clears the Info window and writes some text to it:
    echo Starting simulation...
clearinfo
clears the Info window.
print text
appends some text to the Info window, without clearing it and without going to a new line.
printtab
appends a tab character to the Info window. This allows you to create table files that can be read by some spreadsheet programs.
printline [text]
causes the following text in the Info window to begin at a new line. You can add text, just like with print.

The following script builds a table with statistics about a pitch contour:

clearinfo
printline Minimum Maximum
Create Sound from formula... sin Mono 0 0.1 44100 sin(2*pi*377*x)
To Pitch... 0.01 75 600
minimum = Get minimum... 0 0 Hertz Parabolic
print 'minimum'
printtab
maximum = Get maximum... Hertz
print 'maximum'
printline

You could combine the last four print statements into:

printline 'minimum''tab$''maximum'

or:

print 'minimum''tab$''maximum''newline$'

Links to this page


© ppgb, June 13, 2010