[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference mr1pst::music

Title:MUSIC V4
Notice:New Noters please read Note 1.*, Mod = someone else
Moderator:KDX200::COOPER
Created:Wed Oct 09 1991
Last Modified:Tue Mar 12 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:762
Total number of notes:18706

332.0. "TAPE.COM (Cassette Labeler)" by CUPMK::T_THEO (No applause, just throw money!) Wed Dec 02 1992 13:55

    
    I came across a neat little cassette tape labeling program.  It
    generates a printable postcript file from a series of "fill in the
    blank" type questions.
    
    EXTRACT TAPE.COM from the next reply and then type @TAPE.COM at the "$".
    
    Regards,
    
    Tim  / Moderator of MUSIC 
    
T.RTitleUserPersonal
Name
DateLines
332.1EXTRACT TAPE.COMCUPMK::T_THEONo applause, just throw money!Wed Dec 02 1992 13:57189
$ !	CASSETTE.COM
$ !	Version 1.3
$ !
$ !	Written By Paul Goodwin
$ !	
$ !	Report problems or enhancement suggestions to MEMORY::GOODWIN
$ !	
$ !
$ ! define these
$ blank_line := ""				!blank line
$ one_space := " "
$ a := "A:"
$ b := "B:"
$ !
$ dim_ax := "105.000000"
$ dim_bx := "251.000000"
$ max_ay = 25
$ max_by = 25
$ !
$ b_title := ""
$ a_title_flag = 0
$ b_title_flag = 0
$ double_album = 0
$ loop_count = 0
$ A_dnr := "None"
$ B_dnr := "None"
$ error_10 := "%TITLE-TOOLONG maximum lines per side is 17"
$ !
$ !	for side a get the:
$ !		artist
$ !		album title
$ !		noise reduction
$ !		bias/equlization
$ !		source
$ !		recording date
$ !
$ inquire/nopun a_artist "Side A artist? "		! side a artist
$ inquire/nopun a_title "Side A title? "		! side a title
$ !if a_title .eqs."" then goto a_artist_only		 null title
$ !a_title := " "
$ a_title_flag = 1
$ a_artist_only:
$ inquire/nopun a_bias "bias/equalization (<cr> = high)"
$ if a_bias .eqs. "" then a_bias := "high"
$ a_asknoise:
$ inquire/nopun a_noise "noise reduction (<cr> = yes) "	! noise reduction ?
$ if a_noise .eqs. "" then goto yes_A_noise		! if so what kind
$ goto a_asksource					! else leave as none
$ yes_A_noise:
$ A_dnr = "Dolby B"
$ inquire/nopun a_noise "reduction type (<cr> = Dolby B) " ! is it dolby B
$ if a_noise .eqs. "" then goto a_asksource		! if so branch
$ A_dnr = a_noise					! else set as typed
$ a_asksource:
$ inquire/nopun a_source "recording source (<cr> = CD) "
$ if a_source .eqs. "" then a_source := "CD"
$ a_date:
$ inquire/nopun a_date  "recording date (dd-mmm-yy) "	! recording date?
$ if a_date .eqs. "" then goto a_date
$ !
$ !	side b
$ !
$ inquire/nopun b_artist "Side B artist? "		! side b artist
$ if b_artist .eqs. "" then goto single_label		! if no title branch
$ inquire/nopun b_title "Side B title? "		! side b title
$ if b_title .eqs."" then goto b_artist_only		! null title
$ b_title_flag = 1
$ b_artist_only:
$ inquire/nopun b_bias "bias/equalization (<cr> = high) "
$ if b_bias .eqs. "" then b_bias := "high"
$ b_asknoise:
$ inquire/nopun b_noise "noise reduction (<cr> = yes) "	! else noise red ?
$ if b_noise .eqs. "" then goto yes_B_noise
$ goto b_asksource
$ yes_B_noise:
$ B_dnr = "Dolby B"
$ inquire/nopun b_noise "reduction type (<cr> = Dolby B) "
$ if b_noise .eqs. "" then goto b_asksource
$ B_dnr = b_noise
$ b_asksource:
$ inquire/nopun b_source "recording source (<cr> = CD) "
$ if b_source .eqs. "" then $ b_source := "CD"
$ b_date:
$ inquire/nopun b_date  "recording date (dd-mmm-yy) "
$ if b_date .eqs. "" then goto b_date
$ !
$ open/write output_file temp.ps
$ !
$ write output_file "newpath"
$ write output_file "612.000000 0 translate"
$ write output_file "90 rotate"
$ write output_file "1 setlinewidth"
$ !
$ !	create border
$ !
$ write output_file "100.000000 100.000000 moveto"
$ write output_file "100.000000 369.000000 lineto"
$ write output_file "390.000000 369.000000 lineto"
$ write output_file "390.000000 100.000000 lineto"
$ write output_file "100.000000 100.000000 lineto stroke"
$ write output_file "100.000000 286.000000 moveto"
$ write output_file "390.000000 286.000000 lineto stroke"
$ write output_file "100.000000 324.000000 moveto"
$ write output_file "390.000000 324.000000 lineto stroke"
$ !
$ !	font size for face
$ !
$ write output_file "/Times-Roman findfont 12 scalefont setfont"
$ write output_file "''dim_ax' 308.000000 moveto (A: ''a_artist' - ''a_title' ) show"
$ write output_file "''dim_ax' 292.000000 moveto (B: ''b_artist' - ''b_title') show"
$ !
$ !	font size for rest of text
$ !
$ write output_file "/Times-Roman findfont 8 scalefont setfont"
$ ! 
$ ! write A recording information
$ ! 
$ write output_file "''dim_ax' 359.000000 moveto (noise reduction) show"
$ write output_file "''dim_ax' 349.000000 moveto (bias/equalization) show"
$ write output_file "''dim_ax' 339.000000 moveto (recording source) show"
$ write output_file "''dim_ax' 329.000000 moveto (recording date) show"
$ !
$ write output_file "175.000000 359.000000 moveto (''A_dnr') show"
$ write output_file "175.000000 349.000000 moveto (''A_bias') show"
$ write output_file "175.000000 339.000000 moveto (''A_source') show"
$ write output_file "175.000000 329.000000 moveto (''A_date') show"
$ ! 
$ ! write B recording information
$ ! 
$ write output_file "''dim_bx' 359.000000 moveto (noise reduction) show"
$ write output_file "''dim_bx' 349.000000 moveto (bias/equalization) show"
$ write output_file "''dim_bx' 339.000000 moveto (recording source) show"
$ write output_file "''dim_bx' 329.000000 moveto (recording date) show"
$ ! 
$ write output_file "321.000000 359.000000 moveto (''b_dnr') show"
$ write output_file "321.000000 349.000000 moveto (''b_bias') show"
$ write output_file "321.000000 339.000000 moveto (''b_source') show"
$ write output_file "321.000000 329.000000 moveto (''b_date') show"
$ !
$ write output_file "''dim_ax' 271.000000 moveto (A: ''a_title') show"
$ write output_file "''dim_Bx' 271.000000 moveto (B: ''b_title') show"
$ titles_of_songs:
$ !
$ a_song_list:
$ !
$ write sys$output "enter ''a_title' song titles (cr to exit)"
$ song_count = 0
$ get_A_song:
$ offset_ay = max_ay - song_count
$ dim_ay := "''offset_ay'6.000000"
$ song_count = song_count + 1
$ inquire/nopun song_title "Side A, Song ''song_count'>"
$ if song_title .eqs. "" then goto A_over
$ write/symbol output_file "''dim_ax' ''dim_ay' moveto (''song_count'. ''song_title') show"
$ if song_count .eq. 15 then goto a_max_song
$ goto get_A_song
$ a_max_song:
$ write sys$output error_10
$ a_over:
$ a_end:
$ !
$ !	side b titles
$ !
$ !
$ b_song_list:
$ write sys$output " enter ",b_title," song titles (cr to exit)"
$ if double_album .eq. 1 then goto get_B_song
$ song_count = 0
$ get_B_song:
$ offset_by = max_by - song_count
$ dim_by := "''offset_by'6.000000"
$ song_count = song_count + 1
$ inquire/nopun song_title "Side B, Song ''song_count'>"
$ if song_title .eqs. "" then goto B_over
$ write/symbol output_file "''dim_bx' ''dim_by' moveto (''song_count'. ''song_title') show"
$ if song_count .eq. 15 then goto b_max_song
$ goto get_B_song
$ b_max_song:
$ write sys$output error_10
$ b_over:
$ b_end:
$ !
$ !
$ write output_file "showpage"
$ close output_file
$ !
$ exit
$ !
$ set noverify					!for testing
332.2Some problemsSHRCC::FOSTERGraduate of Beakman UniversityThu Dec 03 1992 09:117
    Bugs...  Can't put in any title/song that has an apostophe, I expect it's
    viewing it as a symbol inside the command string. Also, the goto label
    was missing, I put it before the  "$ open/write output_file temp.ps"
    line  ($single_label:). This goto is needed if you have only one artist
    for the whole tape.
    
    Droid
332.3CUPMK::T_THEONo applause, just throw money!Thu Dec 03 1992 12:038
    
    Try placing quotation marks (") before each input line. I've found 
    that without them the input string is not case sensitive and comes
    out in all upper case _without_ apostrophes or any characters that
    follow.   
    
    Tim
     
332.4YowsersSHRCC::FOSTERGraduate of Beakman UniversityThu Dec 03 1992 12:354
    Thanks, that worked!
    
    Droid
    
332.5Label Printing SoftwareGJO001::REITERBecause ideas have consequencesWed May 19 1993 15:3618
	I am looking for templates that exist in the Windows versions of:
	- Lotus AmiPro,
	- WordPerfect 5.1, or
 	- Microsoft Word
	     to make labels/inserts for audio CD and cassette boxes.

	I would also be interested in any other DOS or Windows software
	available for this purpose.

	Preferably these would NOT be PostScript output generators, since
	my dot-matrix printer at home is not Ps-capable, and Ps-capable
	lasers currently cost more than I want to spend.

	THANKS,
	\Gary
	[This note cross-posted in CD, AUDIO, MUSIC, IBMPC-93, and 
	 whatever other conferences that make sense... moderator 
	 please move if topic exists; yes I searched first, etc.]
332.6I know it's not really musical but....SEDOAS::DEMOPC::RupsInArTiCuLaTeThu May 20 1993 05:049
Gary,

I haven't actually done any myself but i do believe a mate of mine has done 
some inserts for cassettes using CorelDraw! 3.0. It is a good tool for 
devising these sorts of things and obviously your windows printer is 
automatically supported. I can ask him for a copy of the template if you want 
and I'll try and make it available. (Earliest Monday I'm afraid).

Rupert
332.7Make your ownPATE::KGOULDThu May 20 1993 10:347
    
    
    I just made a template by making the size of the page the same size as
    a cassette insert.  The title on the edge I set up as the foot note.  I
    used Ami-Pro 3.0.  I used modern font at 6 or 8b point size.
    
    Ken
332.9TAPE.COM (Cassette Labeler)SPESHR::WAIBLEMon Oct 18 1993 11:269
    Does anyone know about a utility to create lists that fit nicely into
    cassette cases. IT's a .exe file and takes simple text as input and
    produces a .ps file that formats the list and creates a nice little
    title as weell fits up on the narrow edge of the cassette. any pointers
    would be appreciated.	
    
    
    					thanks - Fred
    
332.8looking for a .exe that does thisSPESHR::WAIBLEMon Oct 18 1993 15:416
    I'm looking for an .exe that takes a data file as input. It's a littkle
    nicer than this come file in that i think it automnatically wraps the
    titles if they are too long. anyu word on that please let me know.
    
    
    					thanks - Fred
332.10CADVAX::LEMAIREFri Oct 22 1993 15:008
    I don't have an executable that takes a list file, but I do have
    a template that you can use in DECwrite and just type directly
    into it. It's the right size and shape, and has text areas defined
    for all the places where you would want to write something. Then you
    just process it into a PostScript file using DECwrite.
    
    I like it better than processing a list file blindly with a program
    because you can see what you are going to get.
332.11TAMRC::LAURENTHal Laurent @ COPFri Oct 22 1993 16:1912
re: .10

>    I don't have an executable that takes a list file, but I do have
>    a template that you can use in DECwrite and just type directly
>    into it. It's the right size and shape, and has text areas defined
>    for all the places where you would want to write something. Then you
>    just process it into a PostScript file using DECwrite.
>    
>    I like it better than processing a list file blindly with a program
>    because you can see what you are going to get.

Can you make it available?  I'd certainly like a copy.
332.12QRYCHE::STARRBeauty and SadnessFri Oct 22 1993 17:24727
Here's a command file that I stole from this conference a while ago (probably 
MUSIC_V2). Works great for me, I use it all the time...

alan



$
$!		LABEL.COM
$
$!	This program will read a data file of song titles, artist
$!	and record title and produce a Postscript file for cassette labels
$
$!	19-JAN-1989	Nigel Barker
$!	28-NOV-1989	NB
$
$
$INIT:
$
$ gosub symbols
$ on control_y then goto close_files
$ on error then goto close_files
$
$START:
$ say clear_screen
$ say program_title
$ say ""
$
$! If 'P1' is passed this is the name of an input file
$ if p1 .eqs. "" then goto read_filename
$ input_file	=	p1
$! if we pass p2 it defines if we want prompts as we go through the source file
$ notinteractive	=	p2
$ goto open
$
$READ_FILENAME:
$! Get the name of the input file we are going to use
$ read sys$command/end_of_file=exit/prompt=-
	"Input filename : <NO FILE EXISTS> " input_file
$! if a file name is given then skip to actually create output file
$ if input_file .nes. "" then goto open
$
$
$READ:
$! Read in details of album
$ read sys$command/prompt="Artist name : <EXIT> " artist
$ if artist .eqs. "" then goto close_source
$ read sys$command/prompt="Album title : " title
$ read sys$command/prompt="Set number : " set_number
$ read sys$command/prompt="Songlist heading : <''title'>" heading
$ if heading .eqs. "" then heading = title
$
$! define name of source file we are going to write to
$ source_file		:=	source.txt
$! open new source file for write
$ open/write		source	'source_file'
$
$ write source artist
$ write source title
$ write source heading
$ write source set_number
$
$! Loop around collecting songtitles & write them to output file
$SONG_LOOP:
$ read sys$command/prompt="Song title : <EXIT> " songtitle
$! exit out of loop if <RET> is hit
$ if songtitle .eqs. "" then goto song_loop_exit
$ write source songtitle
$ goto song_loop
$
$SONG_LOOP_EXIT:
$!Last songtitle should be % character
$ write source "%"
$
$! Go back and read some more titles
$ goto read
$
$CLOSE_SOURCE:
$! Close the file
$ close source
$! Rename it to a name made up from title
$ input_file	= f$extract(0,f$locate("'",title),title)
$ input_file	=input_file + f$extract(f$locate("'",title)+1,20,title)
$ input_file	=	f$edit(input_file,"collapse") + ".label"
$ rename/nolog	'source_file'	'input_file'
$
$ say ""
$ say "Details stored in file ''input_file'"
$ say ""
$
$! Check whether this newly created input file should be processed
$ prompt	=	"Do you want to make a label from this new file ? <Y> "
$ read sys$command/end_of_file=close_files/prompt="''prompt'" rep
$ if rep .eqs. "" then rep = "Y"
$ if .not. rep then goto exit
$
$OPEN:
$! if there is no . then append .label to filename
$ if f$locate(".",input_file) .eq. f$length(input_file) then -
	input_file = input_file + ".LABEL"
$! Open input file
$ open/read			infile	'input_file'
$! Open the output filename is 'input_file'.ps
$
$OPEN_OUTPUT_FILE:
$ output_file	=	f$element(0,".",input_file) + ".PS"
$ open/write	outfile		'output_file'
$
$! Actually start writing the output file
$WRITE_LABEL:
$! Write out the initial macro for postscript printers defining x,y origin
$ outrec	=	" /inch {72 mul} def 20 20 translate"
$ write		outfile		outrec
$
$! Start off doing side A
$ side		=	"A"
$! Counter for number of labels on one sheet
$ label_count	=	0
$
$! Read first 3 lines
$READ_TITLES:
$! Counter for number of songs. Zeroized if side A
$ if side .eqs. "A" then count = 0
$ read/end_of_file=close_files	infile	artist'side'
$ read/end_of_file=close_files	infile	title'side'
$ read/end_of_file=close_files	infile	heading'side'
$ read/end_of_file=close_files	infile	set_number'side'
$ read/end_of_file=close_files	infile	first_song'side'
$! Only accept set_number for side A  & only 3 characters
$ set_number = f$extract(0,3,set_numbera)
$
$! Display lines on screen
$ if side .eqs. "A" then say clear_screen
$ if side .nes. "A" then say ""
$ say "''bold'SIDE ''side'''off'"
$ say "''bold'Artist : ''off'" + artist'side'
$ say "''bold'Title : ''off'" + title'side'
$ say "''bold'Heading ''off'" + heading'side'
$ say "''bold'First song ''off'" + first_song'side'
$ if set_numbera .nes. "" .and. side .eqs. "A" -
		then say "''bold'Set number : ''off'" + set_number
$ say ""
$
$! If we are running non-interactively then skip the prompts
$ if notinteractive then goto read_songs
$
$! Check that this is the correct one to print
$ prompt	=	"Is this the correct artist & title etc ? <Y> "
$ read sys$command/end_of_file=close_files/prompt="''prompt'" rep
$ if rep .eqs. "" then rep = "Y"
$
$! If correct then go on to start collecting these titles into local symbols
$ if rep then goto read_songs
$
$! Not the correct one so keep reading through until next set of titles
$READ_TITLE_LOOP:
$ read infile test
$ if test .eqs. "%" then goto read_title_loop_end
$ goto read_title_loop
$
$! Found the next set so skip back to see if this is correct
$READ_TITLE_LOOP_END:
$ goto read_titles
$
$! Read input file & get songtitles into symbols - song1 -> song'n'
$READ_SONGS:
$ count =	count + 1
$ song'count'	=	first_song'side'
$READ_SONGS_LOOP:
$ count	=	count + 1
$ read/end_of_file=close_files	infile	test
$ song'count'	=	test
$! if we read in a % then that is end of songs for this side
$ if test .eqs. "%" then goto read_songs_loop_exit
$! loop around for next song title
$ goto read_songs_loop
$
$READ_SONGS_LOOP_EXIT:
$! Increment count of labels if this is side A
$ if side .eqs. "A" then label_count	=	label_count + 1
$
$!Change from side A to side B and vice versa
$ if side .eqs. "B" then goto move_origin
$ side	 	=	"B"
$ goto read_titles
$
$
$! If not first label then must reset the origin of label
$MOVE_ORIGIN:
$! display actual label
$ gosub display_label
$! display message on screen
$ say "''flash'Working...''off'   Writing label number ''label_count' to file"
$ if label_count .eq. 1 then goto song_title_box
$
$! postion label on page
$ position := "0.0 inch 3.7 inch"
$! if this is fourth label then we must set print position across page
$ if label_count .eq. 4 then position := "3.96 inch -7.31 inch"
$
$ outrec	=		" ''position' translate"
$ write		outfile		outrec
$
$! Draw a box for the song titles
$SONG_TITLE_BOX:
$ outrec	=	" 0.0 inch 0.0 inch moveto"
$ write		outfile		outrec
$ outrec	=	" 3.94 inch 0 rlineto"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch 2.47 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" -3.94 inch 0.0 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch -2.47 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" 1 setlinewidth"
$ write		outfile		outrec
$ outrec	=	" closepath"
$ write		outfile		outrec
$ outrec	=	" 1 setgray"
$ write		outfile		outrec
$ outrec	=	" fill"
$ write		outfile		outrec
$ outrec	=	" 0 setgray"
$ write		outfile		outrec
$ outrec	=	" newpath"
$ write		outfile		outrec
$ outrec	=	" 1.97 inch 0 inch moveto"
$ write		outfile		outrec
$ outrec	=	" 1.97 inch 2.47 inch lineto"
$ write		outfile		outrec
$ outrec	=	" 1 setlinewidth"
$ write		outfile		outrec
$ outrec	=	" closepath"
$ write		outfile		outrec
$ outrec	=	" stroke"
$ write		outfile		outrec
$ outrec	=	" newpath"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch 2.2 inch moveto"
$ write		outfile		outrec
$ outrec	=	" 3.94 inch 2.2 inch lineto"
$ write		outfile		outrec
$ outrec	=	" 1 setlinewidth"
$ write		outfile		outrec
$ outrec	=	" closepath"
$ write		outfile		outrec
$ outrec	=	" stroke"
$ write		outfile		outrec
$ outrec	=	" 0 setgray"
$ write		outfile		outrec
$ 
$! Draw a box above the songtitles for artist information/title etc.
$ outrec	=	" 0.0 inch 2.47 inch translate"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch 0.0 inch moveto"
$ write		outfile		outrec
$ outrec	=	" 3.94 inch 0 rlineto"
$ write		outfile		outrec
$ outrec	=	" 0 0.5 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" -3.94 inch 0 rlineto"
$ write		outfile		outrec
$ outrec	=	" 0 0.5 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" closepath"
$ write		outfile		outrec
$ outrec	=	" 1 setgray"
$ write		outfile		outrec
$ outrec	=	" fill"
$ write		outfile		outrec
$
$! Now draw the boxes on the spine
$SPINE_BOXES:
$ outrec	=	" 0.0 inch 0.0 inch moveto"
$ write		outfile		outrec
$ outrec	=	" 3.94 inch 0 rlineto"
$ write		outfile		outrec
$ outrec	=	" 0 0.5 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" -3.94 inch 0 rlineto"
$ write		outfile		outrec
$ outrec	=	" 0 0.5 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" closepath"
$ write		outfile		outrec
$ outrec	=	" 0 setgray"
$ write		outfile		outrec
$ outrec	=	" stroke"
$ write		outfile		outrec
$
$! Print first artist & title on spine
$SPINE_ARTISTA:
$ spine_font	:=	11
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
	f$edit(titleb,"collapse") .eqs. "" then spine_font := 15
$ if (f$len(artista)+f$len(titlea)) .ge. 45 then spine_font := 10
$ spine_pos	:=	3
$ if f$edit(artista,"collapse") .eqs. "" .and. -
	f$edit(titlea,"collapse") .eqs. "" then goto spine_artistb
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
	f$edit(titleb,"collapse") .eqs. "" then spine_pos := 17
$ outrec	= " /AvantGarde-Demi findfont ''spine_font' scalefont setfont"
$ write		outfile		outrec
$ outrec	=	" 0.1 inch 0.''spine_pos' inch moveto"
$ write		outfile		outrec
$ outrec	=	" (''artista') show"
$ write		outfile		outrec
$ outrec	=	" ( - ''titlea') show"
$ write		outfile		outrec
$
$
$! Print titles on spine
$SPINE_ARTISTB:
$ spine_font	:=	11
$ if f$edit(artista,"collapse") .eqs. "" .and. -
	f$edit(titlea,"collapse") .eqs. "" then spine_font := 15
$ if (f$len(artistb)+f$len(titleb)) .ge. 45 then spine_font := 10
$ spine_pos	:=	"07"
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
	f$edit(titleb,"collapse") .eqs. "" then goto set_number
$ if f$edit(artista,"collapse") .eqs. "" .and. -
	f$edit(titlea,"collapse") .eqs. "" then spine_pos := 17
$ outrec	= " /AvantGarde-Demi findfont ''spine_font' scalefont setfont"
$ write		outfile		outrec
$ outrec	=	" 0.1 inch 0.''spine_pos' inch moveto"
$ write		outfile		outrec
$ outrec	=	" (''artistb') show"
$ write		outfile		outrec
$ outrec	=	" ( - ''titleb') show"
$ write		outfile		outrec
$
$! Print tape number in set only from side a- skip if it is a null
$SET_NUMBER:
$ if set_number .eqs. "" then goto flap_box
$ outrec	=	" /Times-Bold findfont 30 scalefont setfont"
$ write		outfile		outrec
$! print position slightly different for set I or set II
$ set_pos	=	"3.7"
$ if f$length(set_number) .eq. 2 then set_pos = "3.6"
$ if f$length(set_number) .eq. 3 then set_pos = "3.5"
$ outrec	=	" ''set_pos' inch 0.1 inch moveto"
$ write		outfile		outrec
$ outrec	=	" (''set_number') show"
$ write		outfile		outrec
$
$! Now a box for small flap
$FLAP_BOX:
$ outrec	=	" 0.0 inch 0.5 inch translate"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch 0.0 inch moveto"
$ write		outfile		outrec
$ outrec	=	" 3.94 inch 0 rlineto"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch 0.62 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" -3.94 inch 0 rlineto"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch -0.62 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" closepath"
$ write		outfile		outrec
$ outrec	=	" 0.9 setgray"
$ write		outfile		outrec
$ outrec	=	" fill"
$ write		outfile		outrec
$ outrec	=	" 0 setgray"
$ write		outfile		outrec
$
$! Print artist and title on small flap
$
$SMALL_ARTISTA:
$ small_font	:=	11
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
	f$edit(titleb,"collapse") .eqs. "" then small_font := 15
$ if (f$len(artista)+f$len(titlea)) .ge. 45 then small_font := 10
$ small_pos	:=	4
$ if f$edit(artista,"collapse") .eqs. "" .and. -
	f$edit(titlea,"collapse") .eqs. "" then goto small_artistb
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
	f$edit(titleb,"collapse") .eqs. "" then small_pos := 25
$ outrec	= " /AvantGarde-Book findfont ''small_font' scalefont setfont"
$ write		outfile		outrec
$ outrec	=	" 0.1 inch 0.''small_pos' inch moveto"
$ write		outfile		outrec
$ outrec	=	" (''artista') show"
$ write		outfile		outrec
$ outrec	=	" ( - ''titlea') show"
$ write		outfile		outrec
$
$! Do it again for other artist and title
$
$SMALL_ARTISTB:
$ small_font	:=	11
$ if f$edit(artista,"collapse") .eqs. "" .and. -
	f$edit(titlea,"collapse") .eqs. "" then small_font := 15
$ if (f$len(artistb)+f$len(titleb)) .ge. 45 then small_font := 10
$ small_pos	:=	1
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
	f$edit(titleb,"collapse") .eqs. "" then goto small_box
$ if f$edit(artista,"collapse") .eqs. "" .and. -
	f$edit(titlea,"collapse") .eqs. "" then small_pos := 25
$ outrec	= " /AvantGarde-Book findfont ''small_font' scalefont setfont"
$ write		outfile		outrec
$ outrec	=	" 0.1 inch 0.''small_pos' inch moveto"
$ write		outfile		outrec
$ outrec	=	" (''artistb') show"
$ write		outfile		outrec
$ outrec	=	" ( - ''titleb') show"
$ write		outfile		outrec
$
$! Now a box around the whole thing
$SMALL_BOX:
$ outrec	=	" 0.0 inch -3.00 inch translate"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch 0.0 inch moveto"
$ write		outfile		outrec
$ outrec	=	" 3.94 inch 0 rlineto"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch 3.63 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" -3.94 inch 0 rlineto"
$ write		outfile		outrec
$ outrec	=	" 0.0 inch -3.63 inch rlineto"
$ write		outfile		outrec
$ outrec	=	" 3.94 setlinewidth"
$ write		outfile		outrec
$ outrec	=	" 0 setgray"
$ write		outfile		outrec
$ outrec	=	" closepath"
$ write		outfile		outrec
$ outrec	=	" stroke"
$ write		outfile		outrec
$
$! Label side A and side B with heading
$WRITE_HEADINGA:
$ heading_font	:=	9
$ if f$len(headinga) .ge. 30 then heading_font := 8
$ outrec = " /AvantGarde-DemiOblique findfont ''heading_font' scalefont setfont"
$ write		outfile		outrec
$ outrec	=	" 0.1 inch 2.3 inch moveto"
$ write		outfile		outrec
$ outrec	=	" (''headinga') show"
$ write		outfile		outrec
$WRITE_HEADINGB:
$ heading_font	:=	9
$ if f$len(headinga) .ge. 30 then heading_font := 8
$ outrec = " /AvantGarde-DemiOblique findfont ''heading_font' scalefont setfont"
$ write		outfile		outrec
$ outrec	=	" 2.05 inch 2.3 inch moveto"
$ write		outfile		outrec
$ outrec	=	" (''headingb') show"
$ write		outfile		outrec
$
$! Set x & y coordinates for songtitles
$! Fiddled as DCL is integer only arithmetic
$ x		=		"0.1"
$ y		=		215
$
$! Now print out the songtitles
$! Loop around picking up titles previously read into symbols songtitle'side''n'
$ song_count	=	0
$READ_SONGTITLE:
$ partb		=	""
$ song_count	=	song_count + 1
$ if song_count .eq. count then goto end_of_label
$ songtitle	=	song'song_count'
$
$! Check if end of side A
$ if songtitle .eqs. "%" then goto side_b
$
$! Set font for songtitles
$! If the first character is not a bullet i.e. not a songtitle then switch
$! to an italic font. If the next character (1st or 2nd) is a ~ then use a
$! smaller font.
$ if f$extract(0,1,songtitle) .eqs. "�" then gosub song_italic_font
$ if f$extract(0,1,songtitle) .nes. "�" then gosub song_normal_font
$
$! call subroutine to split up songtitle if more than 30 characters
$ gosub split
$
$! decrement y coordinate
$ gosub y_dec
$
$! Actually print songtitle
$WRITE_SONGTITLE:
$ outrec	=		" ''x' inch ''z' inch moveto"
$ write		outfile		outrec
$ outrec	=		" (" + songtitle + ") show"
$ write		outfile		outrec
$
$! if songtitle > 30 characters then it will have been split so print 2nd part
$ if partb .eqs. "" then goto read_songtitle
$
$! decrement y coordinate
$ gosub y_dec
$
$ outrec	=		" ''x' inch ''z' inch moveto"
$ write		outfile		outrec
$ outrec	=		" (" + "  " + partb + ") show"
$ write		outfile		outrec
$
$! loop around for next songtitle
$ goto read_songtitle
$
$! Change x coordinate and loop back to print titles on side B
$SIDE_B:
$ x		=		"2.05"
$ y		=		215
$ goto read_songtitle
$
$END_OF_LABEL:
$
$! Print six labels on one page
$! First check whether we have already printed 6 labels
$ if label_count .eq. 6 then goto output_page
$
$! Go back to beginning for next label
$NEXT_LABEL:
$! reset to side A
$ side		=	"A"
$ goto read_titles
$
$! Tell printer to output the page
$OUTPUT_PAGE:
$ outrec	=		" showpage"
$ write		outfile		outrec
$
$! Write out the initial macro
$ outrec	=	" /inch {72 mul} def 20 20 translate"
$ write		outfile		outrec
$
$! Reset counter for number of labels on one sheet
$ label_count	=	0
$
$! reset to side A
$ side		=	"A"
$! Go around again to see if there are more labels to process
$ goto read_titles
$
$! Close files but make sure we output page to printer
$CLOSE_FILES:
$ if input_file .nes. "" then close infile
$ if output_file .eqs. "" then goto exit
$ outrec	=		" showpage"
$ write		outfile		outrec
$ close outfile
$ say ""
$ say "Labels written to output file ''bold'''output_file'''off'"
$
$EXIT:
$ exit
$
$! SUBROUTINES
$
$SYMBOLS:
$! Define some symbols for use in the procedure
$ say		:=	write sys$output
$ esc[0,7]	=	27
$ bell[0,7]	=	7
$! Some escape sequences for ANSI-fancy output; names are self explanatory
$ bold		:= "''esc'[1m"
$ inv		:= "''esc'[7m"
$ under		:= "''esc'[4m"
$ flash		:= "''esc'[5m"
$ double	:= "''esc'#6"
$ single	:= "''esc'#5"
$ off		:= "''esc'[m"
$
$ clear_screen	:= "''esc'[H''esc'[2J"
$ program_title := "''double'''inv'''space10'TAPE LABEL PROGRAM''space10'''off'"
$ line		:= "''esc'(0qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq''esc'(B"
$ line_t	:= "''esc'(0qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq''esc'(B"
$ line_b	:= "''esc'(0qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq''esc'(B"
$ spaces	:= "                                        "
$
$ output_file	= ""
$ input_file	= ""
$ notinteractive	=	"N"
$ song_font	= 7
$
$ return
$
$SPLIT:
$! Split songtitle up if longer than 30 characters for 7 point font
$ split_count	=	30
$ if song_font .eq. 6 then split_count =40
$ if f$length(songtitle) .le. split_count then goto write_bullet
$ parta		=	f$extract(0,split_count,songtitle)
$ partb		=	f$extract(split_count,255,songtitle)
$SPLIT_LOOP:
$ if f$extract(split_count,1,parta) .eqs. " " then goto split_loop_exit
$ partb		=	f$extract(split_count,1,parta) + partb
$ parta		=	f$extract(0,split_count,parta)
$ split_count	=	split_count - 1
$ goto split_loop
$
$SPLIT_LOOP_EXIT:
$ partb		=	f$extract(split_count,1,parta) + partb
$ parta		=	f$extract(0,split_count,parta)
$ songtitle	=	parta
$
$WRITE_BULLET:
$! Put a bullet before each songtitle NB This is a bullet� not a full stop.
$! If there is already a bullet there then we remove it
$! if f$extract(0,1,songtitle) .eqs. "�" then bullet = ""
$ bullet = ""
$ if (f$extract(0,1,songtitle) .nes. "�") .and. -
	(f$edit(songtitle,"collapse") .nes. "") then bullet = "� "
$ if f$extract(0,1,songtitle) .eqs. "�" then -
		songtitle = f$extract(1,255,songtitle)
$ songtitle = bullet + songtitle
$
$ return
$
$DISPLAY_LABEL:
$! Display an approximation of the label on the screen
$ line_cnt	=	1
$! clear the screen
$ say clear_screen
$
$ line_a	=	f$extract(0,40,"''artista' - ''titlea'''spaces'")
$ line_b	=	f$extract(0,40,"''artistb' - ''titleb'''spaces'")
$ if f$edit(artista,"collapse") .eqs. "" .and. -
	(f$edit(titlea,"collapse") .eqs. "") then -
		line_a = f$extract(0,40,"''spaces'")
$ say "''double'''inv'''line_a'''off'"
$ line_cnt	=	line_cnt + 1
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
	(f$edit(titleb,"collapse") .eqs. "") then -
		line_b = f$extract(0,40,"''spaces'")
$ say "''double'''inv'''line_b'''off'"
$ line_cnt	=	line_cnt + 1
$ say "''single'''line'"
$ line_cnt	=	line_cnt + 1
$ say "''double'''bold'''line_a'''off'"
$ line_cnt	=	line_cnt + 1
$ say "''double'''bold'''line_b'''off'"
$ line_cnt	=	line_cnt + 1
$ say "''esc'[''line_cnt';38;H''set_number'"
$ line_cnt	=	line_cnt + 1
$ say "''single'''line'"
$ line_cnt	=	line_cnt + 1
$ say "''esc'[''line_cnt';H  ''headinga'''esc'[''line_cnt';42H''headingb'"
$ line_cnt	=	line_cnt + 1
$ say "''single'''line_t'"
$ line_cnt	=	line_cnt + 1
$ song_line	=	line_cnt
$ display_count	=	0
$ column	=	0
$ vert		=	"''esc'(0x''esc'(B"
$DISPLAY_SONG_LOOP:
$ display_count	=	display_count + 1
$ songtitle	=	song'display_count'
$ if songtitle .eqs. "%" then goto display_song_end_side
$ partb		=	""
$ gosub split
$ say "''esc'[''line_cnt';''column'H''songtitle'''esc'[''line_cnt';40H''vert'"
$ line_cnt	=	line_cnt + 1
$ if partb .eqs. "" then goto display_song_loop
$ say "''esc'[''line_cnt';''column'H  ''partb'''esc'[''line_cnt';40H''vert'"
$ line_cnt	=	line_cnt + 1
$ 
$ goto display_song_loop
$
$DISPLAY_SONG_END_SIDE:
$! have finished sidea so change column etc for sideb
$ if column .eq. 42 then goto display_song_loop_exit
$ column = 42
$ line_cnt	=	song_line
$ goto display_song_loop
$
$DISPLAY_SONG_LOOP_EXIT:
$ say "''esc'[23;80H"
$
$SET NOVER
$! reset terminal setting
$ set terminal/wrap
$return
$
$SONG_NORMAL_FONT:
$! Set the font for the song titles
$ song_font	=	7
$! set to a smaller font if specified in source file by a ~ as 3rd character
$ if f$locate("~",songtitle) .eqs. 0 then song_font = 6
$ outrec	=	" /Helvetica findfont ''song_font' scalefont setfont"
$ write		outfile		outrec
$ if f$locate("~",songtitle) .eqs. 0 then -
	songtitle = f$extract(1,255,songtitle)
$ return
$
$SONG_ITALIC_FONT:
$! Set the font for the song titles
$ song_font	=	7
$! set to a smaller font if specified in source file by a ~ as 1st character
$ if f$locate("~",songtitle) .eqs. 1 then song_font = 6
$ outrec	= " /Helvetica-Oblique findfont ''song_font' scalefont setfont"
$ write		outfile		outrec
$ if f$locate("~",songtitle) .eqs. 1 then -
	songtitle = f$extract(0,1,songtitle) + f$extract(2,255,songtitle)
$ return
$
$Y_DEC:
$! decrement y coordinate depending on what size font was used
$ y_dec		=	12
$ if song_font .eq. 6 then y_dec = 10
$ y		=		y - y_dec
$
$! Convert y to a decimal in string form
$
$ z		=	"0''y'"
$ z		=	f$extract(f$len(z)-3,1,z)+"."+f$extract(f$len(z)-2,2,z)
$
$! check if songtitle is off bottom of label
$ if y .le. 10 then gosub too_many_songs
$
$ return
$
$! Too many songs to fit on label
$TOO_MANY_SONGS:
$ say "''bell'"
$ say "''esc'[10;20H''inv' Too many songtitles to fit on label ''off'"
$ read sys$command/end_of_file=close_files/prompt=-
	"''esc'[23;25H''inv' Press <RETURN> to continue''off'" rep
$ say ""
$
$ return
332.13CSC32::K_TOKaren To, CSC, Colorado SpringsMon Oct 25 1993 11:143
re: .10

I'd also like a copy of the DECwrite template!
332.14BUFFER::BIRCSAKWhat&#039;s all this, then?Mon Oct 25 1993 11:203
    How about an example input file for the TAPE.COM program for us DCL
    illiterate?
    
332.15example of the input fileQRYCHE::STARRBeauty and SadnessMon Oct 25 1993 13:4731
See No Evil
Songs To Learn
Songs To Learn

Faithfully - Journey
The Other Side - Aerosmith
My Old School - Steely Dan
Rosalita - B. Springsteen
Feelin' Alright - J. Cocker
Magueritaville - J. Buffett
Addicted To Love - R. Palmer
Amanda - Boston
I Can't Tell You Why - Eagles
%
See No Evil
Songs To Learn
Songs To Learn

Only Good Die Young - B. Joel
Dancing In Dark - Springsteen
Got To Get You - Beatles
Lucy In The Sky - Beatles
Alabama Getaway - The Dead
I'm Still Standing - Elton
Go Your Own Way - FleetwoodMac
Bad - U2
Turn The Page - Bob Seger
Bad Time - Grand Funk
Moving In Stereo - The Cars
All Mixed Up - The Cars
%
332.16...whoopsCADVAX::LEMAIREMon Nov 01 1993 12:489
    Re: DECwrite tape template
    
    I forgot to mention - drop me a line in E-mail if
    you'd like to copy my .doc file.
    
    DPE1::lemaire
    
    Louise