[Question]
  [
## Challenge:
Given a string only containing upper- and/or lowercase letters (whichever you prefer), put `tape` horizontally to fix it. We do this by checking the difference of two adjacent letters in the alphabet (ignoring wrap-around and only going forward), and filling the space with as much `TAPE`/`tape` as we would need.
---
### Example:
Input: `abcmnnnopstzra`  
Output: `abcTAPETAPETmnnnopTAstTAPETzra`
***Why?***
* Between `c` and `m` should be `defghijkl` (length 9), so we fill this with `TAPETAPET`;
* Between `p` and `s` should be `qr` (length 2), so we fill this with `TA`;
* Between `t` and `z` should be `uvwxy` (length 5), so we fill this with `TAPET`.
## Challenge rules:
* The difference only applies forward, so no tape between `zra`.
* It is possible to have multiple of the same adjacent letters like `nnn`.
* You are allowed to take the input in any reasonable format. Can be a single string, string-array/list, character-array/list, etc. Output has the same flexibility.
* You are allowed to use lowercase and/or uppercase any way you'd like. This applies both to the input, output, and `TAPE`.
* It is possible no `TAPE` is necessary, in which case the input remains unchanged.
## General rules:
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest answer in bytes wins.  
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
* [Standard rules apply](https://codegolf.meta.stackexchange.com/questions/2419/default-for-code-golf-program-function-or-snippet/2422#2422) for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
* [Default Loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
* If possible, please add a link to a test for your code.
* Also, please add an explanation if necessary.
---
## Test cases:
```
Input:  "abcmnnnopstzra"
Output: "abcTAPETAPETmnnnopTAstTAPETzra"
Input:  "aza"
Output: "aTAPETAPETAPETAPETAPETAPEza"
Input:  "ghijk"
Output: "ghijk"
Input:  "aabbddeeffiiacek"
Output: "aabbTddeeffTAiiaTcTeTAPETk"
Input:  "zyxxccba"
Output: "zyxxccba"
Input:  "abccxxyz"
Output: "abccTAPETAPETAPETAPETAPExxyz"
Input:  "abtapegh"
Output: "abTAPETAPETAPETAPETtaTAPETAPETAPETApeTgh"
Input:  "tape"
Output: "taTAPETAPETAPETApe"
```
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 13 bytes
```
OI’“¡ʂƁ»ṁ$€ż@
```
[Try it online!](https://tio.run/##ATQAy/9qZWxsef//T0nigJnigJzCocqCxoHCu@G5gSTigqzFvED///8iYWJjbW5ubm9wc3R6cmEi "Jelly – Try It Online")
### Explanation
```
OI’“¡ʂƁ»ṁ$€ż@ – Full program. Take a string as a command line argument.
O             – Ordinal. Get the ASCII values of each character.
 I’           – Get the increments (deltas), and subtract 1 from each.
          €   – For each difference I...
   “¡ʂƁ»ṁ$    – Mold the compressed string "tape" according to these values.
                Basically extends / shortens "tape" to the necessary length.
           ż@ – Interleave with the input.
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~14~~ 12 bytes
```
'¡ÉIÇ¥<∍‚ζJJ
```
[Try it online!](https://tio.run/##MzBNTDJM/f9f/dDCw52eh9sPLbV51NH7qGHWuW1eXv//R6snqusoQIgkOJECJ1LhRBqcyIQTYG3JcCXZ6rEA "05AB1E – Try It Online")
**Explanation**
```
'¡É            # push the string "tape"
   I           # push input
    Ç          # convert to a list of character codes
     ¥         # calculate deltas
      <        # decrement
       ∍       # extend the string "tape" to each of these sizes
               # results in an empty string for sizes smaller than zero
        ‚ζ     # zip with input (results in a list of pairs)
          JJ   # join to a list of strings and then to a string
```
[Answer]
# [Haskell](https://www.haskell.org/), 58 bytes
```
f(x:y:r)=x:take(length[x..y]-2)(cycle"TAPE")++f(y:r)
f s=s
```
[Try it online!](https://tio.run/##JYqxCsIwFAB3v@KRKaHawbHQwcFNQdCtdHh5TWxsGksTIcnPR6zTcceN6CdlbSmaxyY1q2hjE3BS3Cr3DGMX6zr1h6PglMgq9jjdzkxUlea/d6fBt77MaBy0MONyBb58wj2sFwc1aAEdQ0mzc@69@JBXZHtgmDc8R/OaNkcph0EprY1BUlvLKUYi@f8lUYwps758AQ "Haskell – Try It Online") The function `f` recurses over the string and looks at consecutive characters `x` and `y`. `cycle"TAPE"` yields the infinite string `"TAPETAPETAPE..."`. `[x..y]` gets the range of characters from `x` to `y` inclusive, so we need to subtract two from the length. In case `x` occurs later in the alphabet then `y` or both are the same character, we get a negative number after subtracting, but luckily `take` accepts those as well and just takes nothing.
[Answer]
# [Perl 5](https://www.perl.org/), `-F` 46 bytes
```
#/usr/bin/perl -F
use 5.10.0;
say map{((P,E,T,A)x7)[2..-$^H+($^H=ord)],$_}@F
```
[Try it online!](https://tio.run/##K0gtyjH9X1qcqmCqZ2igZ2D9vzixUiE3saBaQyNAx1UnRMdRs8JcM9pIT09XJc5DWwNI2OYXpWjG6qjE1zq4/f@fmJScm5eXl19QXFJVlPgvv6AkMz@v@L@uGwA "Perl 5 – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~96~~ ~~87~~ 80 bytes
```
lambda s:''.join(c+(C>c)*('TAPE'*6)[:ord(C)+~ord(c)]for c,C in zip(s,s[1:]+' '))
```
[Try it online!](https://tio.run/##VcyxCsIwFIXh3acIXZJri6CDQ0FBiruDW@2Q3DY21SYh6ZBm8NUjTpLp8PPBsesyGn1I8vRIbz6LnhNfU7qbjNIMS9acEbaM3i@3K90eoa2N61kD5ee3CJ00jmDVEKVJVJb5yrf7uispoQDJOqUXIlnBBc5aa2P9Eh0vYPOXmOVzVNMrcy5E3w@DlEpxHDKLawiIIv8TiCGssYD0BQ "Python 2 – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), 64 bytes
```
t="TAPE"++t
e=fromEnum
f(x:y:z)=x:take(e y-e x-1)t++f(y:z)
f x=x
```
Handles strings of either uppercase *or* lowercase letters, but not both.
[Try it online!](https://tio.run/##bVDNasQgED6vTzH1lCXsodeAhy1sLy20UB9gjRkbm0QXY6iRffc0P5DdphUG9PubGUvRVljXw@AZ5cf3E01TT5ApZ5uT6RqikpD1WdyzkHlRYYLQHxDC4XHv01QlE0UUBBaGAOe2tF1dPOEZeoArBGBsvDG4dP7Du1cD9O3lgZLd7grWl@i@dYsjjc5ZB/RZ6JoS0ghtRrCwBMajgIpcNsYYe2l9dILet5m4aeq5FhE/tn5@Tto1Im59q2tT8Wb6LPVX9du2QGuqyPOiQFRKayFxo51YvtD8OAq45Dh3uQXEPgQp881sK3r3ATKEPv5ZXf63wawcfgA "Haskell – Try It Online")
[Answer]
# C, 84 bytes
```
i,l;f(char*s){for(;*s;)for(putchar(l=*s++),l=s[i=0]+~l;i<l;)putchar("TAPE"[i++%4]);}
```
[Try it online!](https://tio.run/##bY09D4IwFEV3fgVpYtJSTBzcKoODu4MbYWgfFJ6WQigmfAT/eoVBJ@50c3JuLhxLAO8xNkJTqGQXOTbrpqMicoJtpX33G6cmiRznLDaJSzE5ZfxjBF6MYD@BPK73G0mR88M5Y2LxaPuwlmgpC@YgXKMpkQpqa23Tun7qJGFiXTtK1vI3pl1cVvh87fpSqTwvCq0RJRS7zjQOA4Da/1MAwzBOG1r8Fw)
# C (run on Windows Command Prompt), 81 bytes
```
i,l;f(char*s){for(;putchar(l=*s++);)for(l=s[i=0]+~l;i<l;)putchar("TAPE"[i++%4]);}
```
**Output:**
[![](https://i.stack.imgur.com/c09h7.png)](https://i.stack.imgur.com/c09h7.png)
[Answer]
# [Python 3](https://docs.python.org/3/), 98 bytes
```
lambda a:"".join(sum(zip(a,[("TAPE"*9)[:y>x and~ord(x)+ord(y)]for x,y in zip(a,a[1:])]),()))+a[-1]
```
[Try it online!](https://tio.run/##bY89T8MwEIbn5ldYnmwakCoWailIGRiYYPAWMjiOQ1waO0ocYXvgr4d8oNStGE6nu/d97qN1ptbqcaySj/HMmqJkgBEIH05aKtQPDfKyRSzOEKTp@wu8O@KMuGcLmCp/dFcii/dzcjivdAds7IBUYGVYdiA5znGMMMZ7lt0f8vG7lmcBaDcIEu0kSCZ3OxiEsycyydFOB63j2mo7qQyqkMQgSYDGE7caxtc5EwBZwRullG574zsGo7fBbMJ89RKrg6a9WcrFGG0T/BW2QTfhQ@azlqevgPqrLzNZUZSlEFUlJeMitM4SXTWaTirlVCw7Qt47azkvwsMurSj4nVvr/PXX/L/rF9sv "Python 3 – Try It Online")
-1 byte thanks to Asone Tuhid
[Answer]
# [Scala](http://www.scala-lang.org/), 66 bytes
```
(s:String)=>s./:("z"){(o,c)=>o+("TAPE"*6).take(c-o.last-1)+c}.tail
```
[Try it online!](https://tio.run/##TY/BagIxEIbveYqQU1J1i5cehBU89NaCYF9gMptoNCbLzlDiis@@xh7Kzm2@H76ZnxAiTNmeHbL8hpCkK@xSR3LX9@IupPyFKL1sJ02bAw8hHU27peZ9o9WozF3nJVaQF1r97Paf6u3DNAwXp3GVmwjEq7VZ4KOyEKeXih0xyVZ@BWJd9a9RYPGaUso98TiAWv7zcbYcT@F8mWVgbdc5530IgG6WjLdSEO3cYxFLudWHxd/9xufBAZ40tdu@duKYtNdkjBHiMT0B "Scala – Try It Online")
# Explanation
```
/: foldLeft over the string
("z") starting with a non-empty string to we don't have to handle the first iteration in a special way
"TAPE"*6 generate a long enough string of TAPETAPETA...
.take(c-o.last-1) take the difference between this character and the previous (now the last char in the output so far) characters from the TAPETAPETA... string. o.last will always be safe because we start with a non-empty string.
o+...+c append it to the output so far ... and add this character to the end
.tail get rid of the leading z we added
```
[Answer]
# [PHP](https://php.net), 85 bytes
```
$s=str_split($argv[1]);foreach($s as$l)echo str_pad($l,ord(next($s))-ord($l),'TAPE');
```
[Try it online!](https://tio.run/##K8go@G9jXwAkVYpti0uK4osLcjJLNFQSi9LLog1jNa3T8otSE5MzNFSKFRKLVXI0U5Mz8hVACgsSUzRUcnTyi1I08lIrgFqKNTV1QTygIh31EMcAV3VN6////ycmJefm5eXlFxSXVBUlAgA)
### Explanation
```
$s = str_split($argv[1]);   // convert the parameter string to an array
foreach($s as $l)           // loop the array
echo str_pad(               // print
  $l,                       // the letter
  ord(next($s)) - ord($l),  // calculate the distance to the next letter using ASCII values
  'TAPE'                    // padding string
);                          // profit!
```
[Answer]
#  Javascript, ~~131~~ 127 Bytes
4 Bytes saved thanks to  [Rick Hitchcock.](https://codegolf.stackexchange.com/users/42260/rick-hitchcock) 
```
z=(a=>[...a].reduce((x,y)=>x+[...Array((f=y[c='charCodeAt']()-x.slice(-1)[c]())>1?f-1:0)].reduce((e,r,t)=>e+"TAPE"[t%4],"")+y))
```
##  Unrolled
```
z=a=>[...a].reduce(
  (x,y)=>
    x + [...Array(
      (f = y.charCodeAt()-(x.slice(-1).charCodeAt()) ) > 1 ? (f-1) : 0
    )].reduce(
      (e,r,t)=> 
        e + "TAPE"[t%4],"") + y
);
```
My Problem here is that Javascript had no clean way to get the distance between character a and b.
```
<script>
  z=(a=>[...a].reduce((x,y)=>x+[...Array((f=y[c='charCodeAt']()-x.slice(-1)[c]())>1?f-1:0)].reduce((e,r,t)=>e+"TAPE"[t%4],"")+y))
</script>
<main>
  <input id="input-box" type="text">
  <pre id=output>output</pre>
</main>
<script>
  inputBox = document.getElementById("input-box");
  inputBox.addEventListener("keyup", function(e){
    output.innerText = z(inputBox.value);
  });
</script>
```
[Answer]
# [Python 2 / 3](https://docs.python.org/3/), ~~70~~ 69 bytes
```
f=lambda s,*t:t and s+('TAPE'*6)[:max(ord(t[0])+~ord(s),0)]+f(*t)or s
```
[Try it online!](https://tio.run/##XYyxDsIgFEV3v4J0KbQdmpg4NHFwcHdwazo8oFhUoIE3UAZ/Hetm2O495@auGy7OHnNW5zcYLoGErsEBCVhJQkvr@@V2rZsTGwcDkTovKY79xNrPLwbW9WxqFW2QOU9CXr22SPdeARfGWuvWgMlDxdjhz6UCPBb9fBUb4FzKeVZKaxBzYdMWoxC8/OVCxLilneYv "Python 3 – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 20 bytes
```
⭆θ⁺…TAPE∧κ⊖⁻℅ι℅§θ⊖κι
```
[Try it online!](https://tio.run/##TYxBCsIwFESvErr6hXgCV6F14aIY0At8k48NTX/SNIp6@TQigrOYeYuZMSMmE9CXopPjDOdc4zZghEUK7e8rdC/jqRtDhOai9KGRQrGFSYqeTKKZOJOFwXGtnpJ1jB5cK8WPVT6ypefn7n8wtV9J4arvS8GrmZk5xDW/E5bdw28 "Charcoal – Try It Online") Explanation:
```
 θ              θ       Input string
⭆                       Map over characters
                  κ     Current index
                 ⊖      Decremented
               §        Index into string
             ι          Current character
            ℅ ℅         Ordinal
           ⁻            Subtract
          ⊖             Decremented
         κ              Current index
        ∧               Logical and
    TAPE                Literal string
   …                    Mold to length
                   ι    Current character
  ⁺                     Concatenate
                        Implicitly print
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 29 bytes
```
O@a{"TAPE"@<MX[0v-$-Ag]}.BMPa
```
Takes input as a command-line argument (lower- or uppercase, doesn't matter).
 [Try it online!](https://tio.run/##K8gs@P/f3yGxWinEMcBVycHGNyLaoExXRdcxPbZWz8k3IPH///@JScm5eXl5@QXFJVVFiQA "Pip – Try It Online")
### Explanation
```
O@a{"TAPE"@<MX[0v-$-Ag]}.BMPa
                               a is 1st cmdline arg; v is -1 (implicit)
O                              Output without newline
 @a                            the first character of a
                          MPa  Map this function to pairs of successive characters of a:
                    Ag          Get the ASCII codes of the two characters
                  $-            Fold on subtraction (i.e. asc(first)-asc(second))
                v-              -1 minus the above (i.e. asc(second)-asc(first)-1)
              [0      ]         A list containing 0 and the above
            MX                  Max of the list
          @<                    The first ^ characters (with cyclic indexing)
    "TAPE"                      of this string
   {                   }.B      Concatenate the second character
```
[Answer]
# JavaScript (ES6), ~~80~~ 78 bytes
```
f=([s,...S],t=S[0])=>t?s.padEnd((t>s)*(parseInt(s+t,36)-370)%37,'TAPE')+f(S):s
```
The distance between two characters can be determined by converting their concatenation to base 36, subtracting 370, modulus 37.
For example, `(parseInt('cy',36)-370)%37 == 22`.
We can then use `padEnd` to fill in the gaps, and recursion to handle the loop.
**Test Cases:**
```
f=([s,...S],t=S[0])=>t?s.padEnd((t>s)*(parseInt(s+t,36)-370)%37,'TAPE')+f(S):s
console.log(f('abcmnnnopstzra'));
console.log(f('aza'));
console.log(f('ghijk'));
console.log(f('aabbddeeffiiacek'));
console.log(f('zyxxccba'));
console.log(f('abccxxyz'));
console.log(f('abtapegh'));
console.log(f('tape'));
```
[Answer]
# [K4](http://kx.com/download/), 48 bytes
**Solution:**
```
{,/_[w;x],',[1_d w:&0<d:-1+-':"j"$x;0]#\:"TAPE"}
```
**Examples:**
```
q)k){,/_[w;x],',[1_d w:&0<d:-1+-':"j"$x;0]#\:"TAPE"}"abcmnnnopstzra"
"abcTAPETAPETmnnnopTAstTAPETzra"
q)k){,/_[w;x],',[1_d w:&0<d:-1+-':"j"$x;0]#\:"TAPE"}"aza"
"aTAPETAPETAPETAPETAPETAPEza"
q)k){,/_[w;x],',[1_d w:&0<d:-1+-':"j"$x;0]#\:"TAPE"}"zyxxccba"
"zyxxccba"
q)k){,/_[w;x],',[1_d w:&0<d:-1+-':"j"$x;0]#\:"TAPE"}"aabbddeeffiiacek"
"aabbTddeeffTAiiaTcTeTAPETk"
```
**Explanation:**
Fairly simple solution, but a high byte count... Find the deltas, take from the string `"TAPE"`, join to the original string cut where the deltas are > 1.
```
{,/_[w;x],',[1_d w:&0<d:-1+-':"j"$x;0]#\:"TAPE"} / the solution
{                                              } / lambda
                                         "TAPE"  / the string TAPE
                                      #\:        / take each-left
           ,[                      ; ]           / join (,)
                                   0             / zero (ie append zero)           
                              "j"$x              / cast input to int
                           -':                   / deltas
                        -1+                      / subtract 1
                      d:                         / assign to d
                    0<                           / delta greater than 0?
                   &                             / indices where true
                 w:                              / assign to w
               d                                 / index into deltas at w
             1_                                  / drop first
         ,'                                      / join each-both
   _[w;x]                                        / cut input x at indices w
 ,/                                              / flatten
```
[Answer]
# Excel VBA, 106 bytes
An anonymous VBE immediate window function that takes input as an uppercase string via cell `A1` and outputs to the VBE immediate window.
```
a=90:For i=1To[Len(A1)]:c=Mid([A1],i,1):b=Asc(c):For j=2To b-a:?Mid("peta",j Mod 4+1,1);:Next:?c;:a=b:Next
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~59~~ 53 bytes
```
->s{s.reduce{|x,y|x+y.rjust(y.ord-x[-1].ord,"TAPE")}}
```
[Try it online!](https://tio.run/##bY@xbsMgEIb3PEXE1Ko2ah7AlTx0z8CGGOCMY6eqYwGWANvP7ubAypB0OOn4/@@/O8ykwtZWW/llZ0uNbibQ8@KLsPiPQM11su4t0JtpSs/Lk8CuIKw@f5P3dd34gROp4HcYhttoXTSSFEdUkEiVLVZbl55IiAJTMaMP8Knizl26/vqDZG5yVirVNFq3bd9L0MlGjWWR1XeZAdNp1p6JwXsAlZY@@jxNAXgf4n45/HdN8nfayVFfuky/sO7pQ6NmdzYlMYepV4SIg6BaQjcvbhmPLXf8U1DopLGiqhw/iXX7Aw "Ruby – Try It Online")
This is actually pretty straightforward - we take input as ~~split our string into~~ an array of chars (thanks to Asone Tuhid for pointing this out) and apply reduce operation, where we justify each char to the required length using "TAPE" as filler string.
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), 33 bytes
```
{,/((0|-1+0,1_-':x)#\:"TAPE"),'x}
```
[Try it online!](https://tio.run/##bY8/D4IwEMV3P4U5TYQIEdd2YnB36IZES20VUSDQodQ/Xx1paRzU4dL23e/dvRZhVfS9QPdg5XnRI1wvo2C9DxdI@bMdAhJvN@AHC/XsJbofIjRPuleDxFThAKoCsAeC5lfACne48VP8nMgEaMZuZVlWdSt1QwEbwUyyNXZI3Er7NEBqTdqSH@6rtMNO5/wy7HXn6KRZdjxyLkSeU8ZN10hk1Eg8qIQRbic5i@6UYiwzGz/X1EVnSnV6DM3@JbFtB0ta89PZwj@o/PpLzcmAWqOxDaZfAlLcvwE "K (oK) – Try It Online")
`{ }` anonymous function with argument `x`
`-':x` subtract each prior (use an imaginary 0 before the first item)
`1_` drop first item
`0,` prepend a 0
`-1+` add -1
`0|` max(0, ...)
`(`...`)#\:"TAPE"` reshape the string `"TAPE"` to each item from the list on the left
`(`...`),'x` append the corresponding character from `x` to each reshaped string
`,/` concatenate all
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), 30 bytes
```
{∊⍵,¨⍨⍴∘'TAPE'¨0,0⌈-1+2-/⎕a⍳⍵}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob2pm/qO2CQb/04Bk9aOOrke9W3UOrXjUC0RbHnXMUA9xDHBVP7TCQMfgUU@HrqG2ka4@UFPio97NQJW1//@XgPX1bn3UuagIyEx71LvL6lHvKvW0xMwcdSAHKFX0qLtFPT9bvZZL3dHJ2dfPz88/IDgkKshRvQQkALIBjCEyIY7BIWAuSAFQRxRYGVwRGo4CqXH38PTyBqqC0EA9jk5OLi6urm5unp6Ozq4gKZBQCEQsxBEoGuIcAjEDpD4qMiLC2dkJZBGcCXarc0REZBTElc7YbAdLg1SCOO4eYJUY6kIwHQ9UygUJ2RJ1TGl1AA "APL (Dyalog Classic) – Try It Online")
`{ }` anonymous function with argument `⍵`
`⎕a⍳⍵` find indices of its chars in the alphabet
`2-/` pairwise differences (prev minus next)
`1+` add 1
`-` negate
`0⌈` max(0, ...)
`0,` prepend a 0
`⍴∘'TAPE'¨` reshape cyclically the string `'TAPE'` to each
`⍵,¨⍨` append each char from the argument to the corresponding reshaped string
`∊` flatten
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~78 77 64~~ 62 bytes
-1 byte thanks to Kevin Cruijssen
```
f=->s,*t{t[0]?s+('TAPE'*6)[0,[0,t[0].ord+~s.ord].max]+f[*t]:s}
```
[Try it online!](https://tio.run/##bZBNb4QgEIbv/gqyF1u1Zk89mLSNh9574GY4wIArbRaMYIJ2279uBXa1aUqYMLzvM8PHMLJpWdqnh2dTZPbTNkfyYvK7FNdvr2n2eN8ci3V6udQDz7@NX0h5po7kbZNZUpmvpUkQag6UwVkppXtj54EeCuQV3ydEtHBtbNh6ghSxbo7whv6JeSNPnXz/8GxMbvWUMc6FaFspKYgAeA1HEderjAGL0G@rmifnAFg4estvHRmAc9N8fQP8d6vgk4SUgkKHuEYXWejLWt4PUlmUStWPtkLrSL04WoPk7p509H6562/KEjo6GLJzwvUCrODVzulrkgjFlx8 "Ruby – Try It Online")
[Answer]
# [Java (JDK)](http://jdk.java.net/), 91 bytes
```
s->{var p='z';for(var c:s)System.out.print("ETAP".repeat(9).substring(1,c>p?c-p:1)+(p=c));}
```
[Try it online!](https://tio.run/##bZBBa4NAEIXv@RWDl6xtIuTYpKaE0GOhkN5CDuO6Jmt0d9kdgxr87VatBGl7WJZ5b5j55qV4w2UaX1uZG20J0q4OCpJZ8LSZ/dGSQnGSWv1rOrIC897iGToHHygV3GcApogyycERUvfdtIwh7zx2ICvV@XgCtGfnD60Ae61ckQv7yi9oj6ctJBC2brm939CCCef1fJNoy/qKr51/qByJPNAFBaabRsx7/9p9eoEVRiCxFz9wReSGRWy14FvzxpdmvfKfmQm572@adjOsfbCQcOQgHGkAPIx4rpTSxlFt0Vs89HpSnC8yvU48jKI4FiJJpEQuJk5dlSXn0XROxHlZVrU3CM0PTncijPkMROsfLv@BlQTIuTDEej0gve/S2lmLFeuOGnt@Z5MpNnrNrH9N@w0 "Java (JDK) – Try It Online")
## Explanation
```
s->{                       // char[]-accepting lambda consumer, printing a String
 var p='z';                //  store the previous character
 for(var c:s){             //  for each character of the string
  System.out.print(        //   print...
   "ETAP".repeat(9)        //    "ETAP" repeated 9 times (to go above 26 chars)
    .substring(1,          //     of which, we substring c-p -1 characters
     c>p?c-p:1             //
    )                      //
   +(p=c)                  //    and append c, while also storing the previous character
  );
```
## Credits
* -2 bytes thanks to [R.M](https://codegolf.stackexchange.com/users/74635/r-m)
* -4 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat), by upgrading to Java 10+ and switching types to `var`
* -3 bytes thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen), by printing the result of my (previously) alternate version instead of returning it
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), ~~122~~ 111 bytes
Saved 11 bytes thanks to [@KevinCruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)
```
s=>{var r=""+s[0];for(int i=1,e,d;i<s.Length;r+=s[i++])for(e=d=s[i]-s[i-1];d-->1;)r+="ETAP"[(e-d)%4];return r;}
```
[Try it online!](https://tio.run/##lY9Na4NAEIbv/opFKCh@UKG3jUIp7SmFQAs9iId1d9RpkzXsbIIf@NttTKCXXsx7mGHgeYYZSZFsDcxyL4jYzhkddglZYVGyc4uKvQvUHlmDus4LJkxN/pUZnWtb8tGThUP8dtJycyNDdusZq1g6U5qNZ2GYSV03oPyx4FVrPNSWYZqEECqOG4q3oGvbcBOklGMQFP4CQaqWsYguJUoKrqIoS7h/gdzXz@edm3sQKf/hqeAG7MloZvg083@nvbSa2j3EXwYtbFGDV3muKOVBa90eyQ5GuL7P12nDerZu8Ptn/WZRlkoBVBWikLBeHPquk7K844dSyq7rhzsEK45QN6uFBf@DJ2eafwE "C# (.NET Core) – Try It Online")
**Explanation:**
```
s => 
{
    var r = "" + s[0];                  //Declare string for the result and initialize with the first character from the input.
    for (                               //Loop over the input,
        int i = 1, e, d;                //starting with the second character, also declare helper variables.
        i < s.Length;                   //Loop until the end of the input is reached.
        r += s[i++])                    //Add the current character to the result and increase the counter.
        for (                           //Loop for adding the TAPE.
            e = d = s[i] - s[i - 1];    //Calculate the differnce between the current and the previous character.
            d-- > 1;)                   //Loop until the difference is 1.
            r += "ETAP"[(e - d) % 4];   //Add a character from the TAPE to the result.
    return r;                           //Return the result.
}
```
[Answer]
# [Yabasic](http://www.yabasic.de), 119 bytes
An anonymous function that takes input as an uppercase string and outputs to STDOUT. 
```
Input""s$
a=90
For i=1To Len(s$)
c$=Mid$(s$,i,1)
b=Asc(c$)
For j=2To b-a
?Mid$("peta",Mod(j,4)+1,1);
Next
?c$;
a=b
Next
```
[Try it online!](https://tio.run/##q0xMSizOTP7/3zOvoLRESalYhSvR1tKAyy2/SCHT1jAkX8EnNU@jWEWTK1nF1jczRQXI1snUMdTkSrJ1LE7WSAbKgNRm2RoB1SbpJnLZg1UpFaSWJCrp@OanaGTpmGhqGwK1WHP5pVaUcNknq1gDLUkC8/7/d3Ry9vXz8/MPCA6JCnIEAA "Yabasic – Try It Online")
[Answer]
# Python 3, 90 bytes
```
p,o=' ',''
for t in input():y=(ord(t)-ord(p)-1)*(p!=' ');o+=('TAPE'*y)[0:y]+t;p=t
print(o)
```
[Try it Online](https://repl.it/repls/SkeletalWrithingCell)
[Answer]
# Clojure, 139 119 bytes
```
#(reduce-kv(fn[r x c](let[a(cycle "TAPE")i int d(-(i(nth(cycle %)(inc x)))(i c))](str r(if(> d 1)(apply str c(take(dec d)a))c))))""(vec %))
```
Anonymous function which take the string and returns the taped one. As always, Clojure doesn't seem to perform all too well. What I couldn't really work out is fetching the next char in a short way. On the last char I would get an `OutOfBoundsException`, reason obvious. So I put a `cycle` around it. Maybe there is a more elegant solution.
## Ungolfed
```
#(reduce-kv
  (fn [r x c]
    (let [a (cycle "TAPE")
          i int
          d (-
             (i (nth (cycle %) (inc x)))
             (i c))]
      (str r
           (if (> d 1)
             (apply str c (take (dec d) a))
             c))))
  ""
  (vec %))
```
# Update
Managed to shafe off a few bytes. Got rid of the pesky `if` statement by decrementing the difference. `take` produces an empty list if the number is 0 or less which in turn results in an empty string.
```
#(reduce-kv(fn[r x c](let[d(-(int(nth(cycle %)(inc x)))(int c)1)](str r c(apply str(take d(cycle "TAPE"))))))""(vec %))
```
## Ungolfed
```
#(reduce-kv
  (fn [r x c]
    (let [d (-
             (int (nth (cycle %) (inc x)))
             (int c)
             1)]
      (str
       r
       c
       (apply
        str
        (take
         d
         (cycle "TAPE"))))))
  ""
  (vec %))
```
[Answer]
# [CJam](https://sourceforge.net/p/cjam), ~~27~~ 25 bytes
```
q_:i2ew.{:-~0e>_"TAPE"*<}
```
[Try it online!](https://tio.run/##S85KzP3/vzDeKtMotVyv2kq3ziDVLl4pxDHAVUnLpvb//8Sk5Ny8vLz8guKSqqJEAA "CJam – Try It Online")
Far, far from the other golfing languages, but I'm proud of this golf anyway.
### Explanation
```
q                            Read the input
     ew                      And take windows of size
    2                          2
   i                           from the code points
  :                            of each of its characters.
        {               }    For each of these windows:
         :                     Reduce with
          -                      subtraction.
                                 Since there are only 2 elements, this just subtracts them.
             e>                Take the maximum
           ~                     of this difference's bitwise negation
            0                    and zero.
                                 This returns -n-1 if n is negative, and 0 otherwise.
                                 Call this new value m.
                      *        Repeat
                "TAPE"           the string "TAPE" m times.
               _       <       And then take the first m elements.
                             The result of this will be an array of strings which consist of
                             the string "TAPE" repeated the proper amount of times.
       .                     Zip this array with the original input.
                             Since the original input is one element longer than this array,
                             the nothing is pushed after the final character.
                             Implicitly print everything.
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~26~~ 25 bytes
```
ΣSoż+C1(moo↑¢¨tȦ9¨>0←Ẋ-mc
```
[Try it online!](https://tio.run/##AT4Awf9odXNr///Oo1NvxbwrQzEobW9v4oaRwqLCqHTIpjnCqD4w4oaQ4bqKLW1j////ImFiY21ubm5vcHN0enJhIg "Husk – Try It Online")
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 72 bytes
```
-join($args|% t*y|%{for(;$p*(++$p-lt$_)){'TAPE'[$i++%4]}$i=0;$p=+$_;$_})
```
[Try it online!](https://tio.run/##bZFPb4MgGIfvfgpiXlepNtlhpzVN1sPuO3BbFqP0tdo5ZcIy/9TP7gA3a9qREODH8wBvENU31jLDohghJTvSj5tTlZc@xPVRnj2i1u3Z69Oq9rcg1n4QgNgUCiJK@xXbvzyvXiEPAu/hbYB8d6@ZXQDRFqKBjoPjPPkO0S303TjhH2VZVkKqro7d0ATGt33aYXup7NIAdBY7S8/sVe8W6DHLT@8ansbLCXGSHA6IaZrnMUdDmIhNGdvrlHGG9sSF1rVNw3libp@ndFEOb5q2mwrh/73Mbi8EFQs8Zla4wdVVfQKZRmfZqFq8pTRCyZl4pLcoyBCwEcgVHvRfQjSlNcqvQungTn8xSBu64P/mG/ycJfr4R7vOMP4A "PowerShell – Try It Online")
[Answer]
# **Java , 213 166 153 bytes**
```
i->{String o="";for(int a=0,l=i.length;++a<=l;){char u=i[a-1],n;o+=u;if(a<l){n=i[a];o+="TAPETAPETAPETAPETAPETAPET".substring(0,n-u>0?n+~u:0);}}return o;}
```
[try it online](https://tio.run/##bZDBbsIwDIbvPIXVUztKxK4LZZqm7TZpErshDm5IISwkVeIgCupenaUFsR4WyUr82XL@3zs84MTW0uzW3xe1r60j2EXGAinNHvhIaPQePlAZOI8APCEpMWipghGkrGHvt8dMbNEtVzksyCmzmUMFBVzUZH6@ArBFkvDKulQZAiymuS4U09JsaMvHY5wVmmfnbgiEQi1x8rjKDbfjInBVpTjT2dl0fNWx5Ovl8@3fSJgPpe9/TKe5mYT59NmMf8LTNONt6yQFZ8Dy9sJH0VYdSh1t3dwdrFrDPlpOr5KXK0C38Vm/Abgzkp58NNfTeBIsxd4YY2tPJ4dJfuenQbLZqt33oIZluV5LWVVKoZCDyqk5HoUoh3NKIY7H5vRHCGuZ9EnL@yvuFW6qe31PV5XZXeSi8ST3zAZidewibdKKYV3rJu06GdnXuPoX57BJsyy7Tm1HXbSXXw)
```
    String o = "";
    for (int a = 0, l = i.length; ++a <= l; ) {              // for each character
        char u = i[a - 1];                                    //  current character
        o += u;                                               //  add current character to output string 
        if (a < l) {                                          //  if it's not the last one
            char n = i[a];                                    //  next character
            o += "TAPETAPETAPETAPETAPETAPET".substring(0, n - u > 0 ? n +~ u : 0); // fill with enough tape but only forward
        }
    }
    return o;
```
Please help me make it better.
Thanks to @cairdcoinheringaahing for the tip on whitespaces.
Thanks to @R.M for the tip on tape string.
Thanks to @KevinCruijssen for the lambda and expressions tips.
]