I went off of this:
grey1beard wrote: ...it would be nice to be able to indicate the value of X for the particular note more compactly in the form of a single parameter.
and based on later information that it's to play music, I think it wants something like the following.
(main program)
(define a table of XY pairs for all the notes to be played, odd numbers are the Xposn, evens the Yposn)
( to necessary to play each note)
(88*2 ought to be enough for all the notes of a piano, ymmv)
(I put the table out here in main so it would be loaded once and not EACH time the sub is called)
#1= ; Xposn to play lowest note
#2= ; Yposn to play lowest note
#3= ; Xposn to play 2nd-lowest note
...
#175= ; Xposn to play highest note
#176= ; Yposn to play highest note
(define a set of "memorable" params to "point to" the top of each note pair)
( you will call sub with ONLY these, odd, numbers)
#<_C_OCTAVE0>=1 ; or whatever lowest note and octave are ; global so sub can read them
#<_Cs_OCTAVE0>

...
#<_F_OCTAVEn>=175 ; or whatever highest note and octave are
#<_MIDDLEC>=2500 ; every note has an EVEN number (something tells me 88 ought to be enough...)
O<mysub> call [#<_C_OCTAVE0>]
O<mysub> sub
(check that #1 is an odd number, else complain and stop)
(the parameter passed-in is the ADDRESS-OF a parameter pair containing)
( the Xposn, Yposn to play a note)
G0 X[##1] Y[#[#1+1]] ; go to (contents of #1 and #2 in main)
G91 G0 Z#<hammerdepth> F#<hammerspeed>
(dwell)
G91 G0 Z#<hammerdepth> F#<rapid>
O<mysub> endsub
...or something like it.