text:
Answer-Chaining - Positive divisors of a number
This answer-chaining challenge is officially over, resulting in the win of Wheat Wizard, with a total of 7 answers. Any other answer is welcome, but it won't influence the accepted answer for this challenge, nor the winner.

Task:
Print all the positive divisors of a number x taken as input.
Input:
A single number x which is the number (in base 10) whose positive divisors should be computed.
Output:
All the positive divisors of x. Any format is allowed, including \n,,,; and whitespace as separators, as long as it's understandable. The output can be an array of Integers or Strings, too (e.g: [1, 2, 3, 5, 30]). You may output the divisors to stdout, console or the equivalent in your language or they can be returned from a function.

Rules

A user may not answer twice in a row
Your answer may remove, add or replace at most 15 characters from the previous answer (whitespace does not count), besides for Answer 2 which can "transform" up to 20 characters to get things started
You are not allowed to post an answer in a programming language that already has an answer, the exception being a completely different version of that language (e.g: If I post an answer in Python 2.7, you can submit one in Python 3, but not in Python 2.6)
Standard loopholes are not allowed
You are not allowed to use built-ins for getting divisors, for the sake of this challenge
You must include the answer's number and the language name in the question's title and the number of characters changed from the previous answer

Scoring
The user with the most submissions once the things settle out wins. In case of a tie, the user with the highest score on one of their answer wins. If there is a tie at the score as well, then the user with the oldest submission(oldest highest-scored answer) will be declared the winner.
Note: "settle out" <=> 7 3 days have passed since the last answer was submitted

Examples:
Input, Output:

14 => [1, 2, 7, 14]
25 => [1, 5, 25]
65 => [1, 5, 13, 65]
114 => [1, 2, 3, 6, 19, 38, 57, 114]

Or any other equivalent output satisfying the mentioned conditions.

Final Note: This question is better if you sort the answers by the oldest. I'll post the first answer in Python 2.7, so you should post the second answer depending on that one. Good luck and have fun!

Leaderboard:
This list may be outdated, fell free to edit it:

1) Wheat Wizard [Current Leader ]: 7 answers - Python 1.6,
   05AB1E, Actually, Del|m|t, WSF, Brain-Flak, Lenguage
2) Riley: 3 answers - Seriously, CJam, 2sable
3) Jonathan Allan: 2 answers - Python 3, Jelly
3) ETHproductions: 2 answers - Japt, Pyth
3) Mistah Figgins: 2 answers - Befunge-98, Brain-Flak Classic
6) Riker: 1 answer - MATL
6) dzaima: 1 answer - SOGL 0.8.2
6) LegionMammal978: 1 answer - Whitespace
6) Nick Clifford: 1 answer - Ohm
6) Lynn: 1 answer - GolfScript
6) MickyT: 1 answer - Cubix

Distance calculator
You can use this snippet to calculate the distance between two entries:

function L(s,t){if(s===t)return 0;var S=s.length,T=t.length;if(S*T===0)return S+T;for(var i=0,v0=[],v1=[];i<=T;i++)v0[i]=i;for(i=0;i<S;i++){v1[0]=i+1;for(var j=0;j<T;j++)v1[j+1]=Math.min(v1[j]+1,v0[j+1]+1,v0[j]+(s[i]!=t[j]));for(j=0;j<=T;j++)v0[j]=v1[j]}return v1[T]}
<textarea id=A rows=10></textarea><textarea id=B rows=10></textarea>

Distance: 0 <button onclick="O.innerHTML=L(A.value.replace(/\s/g,''),B.value.replace(/\s/g,''))">Run</button>

15 will work, 10 is standard though. I'd say keep it at 15 though, because this is harder than most.

I hope you don't mind, but I added a distance calculator snippet to the bottom of the post :-)

How can I possibly mind for improving the post? Thanks @ETHproductions

Would a function that finds most of the devisors but not all of them be considered a built in?

@WheatWizard No, you are not allowed to use any kind of divisor built-in, it simplyfies your job but makes it very hard for others in programming languages that do not have useful built-ins

That collaborative work to go toward brainfuck is beautiful :)

IMPORTANT: Please edit the leaderboard when you make a submission, so it's easier to maintain..

It is awesome to see people bring the answers from Python to Brain-Flak, with a great collaborative work, from a widely spread language to one of the most obscure programming language ever created. Thanks to all who made it happen! Now I'm really interested to see what happens with this challenge, since DjMcMayhem has put a bounty on it.

BTW, there has to be bounties for helpers too. Probably 50 or 100?

Does the challenge being over mean that you still update the scoreboard, or that you can answer twice in a row?

I don't update the leaderboard. It is officially closed. However, you can upload 2 answers in a row now, but they won't count to the leaderboard

Answer 20, Brain-Flak, 11
I would like to just take the time to thank everyone that has helped contribute to this goal:

Riley, 20 bytes
LegionMammal, 15 bytes
ETHproductions, 11 bytes
Lynn, 1 byte

The following users were not able to contribute bytes directly but did help in other ways:

Mistah Figgins
DJMcMayhem
feersum

Thanks everyone for making this possible!
"qd:A(),(;{A\%!},pe#&f!0pv'%QTS|Q@░┼_¥f::+!vUGw
)((({})<>)){((({}[()]<n=int(input({})(<>))><>)<{i=1div=wvhile(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{ifn%i==g00div.append(<{}<>{}<>>i)i=i+1}{}printdiv)}
#R
{}T:.eX╜R;j`;╜0%Y*`M∩\"ILD¹s%_Ï,

Try it online!

Finally, Brain Flak! Thanks to all who helped achieving this goal! Congratulations to Wheat Wizard for being the user with the most answers so far and for the great work and time spent around this challenge!

Answer 3: MATL, Distance 15
:tGw\~)
%n=int(input())
%i=1
%div=[]
%while (i<=n):
%    if n % i == 0:
%        div.append(i)
%    i+=1
%print(div)

MATL's % make it really hard to continue. Good luck to others and I really hope that this challenge won't "die" here!

Isn't this using a built in?

@JonathanAllan No, definitely not. The builtin for divisors is Z\. The relevant code here is the :tGw\~) (which I wrote in chat, not a builtin)

Indeed, there is no built-in

@DJMcMayhem sure I can see the code, just saw \ in a table in MATL doc as "divisors" and thought the rest was getting input or something.

@JonathanAllan The table can be a little confusing. Z\, not \, is "divisors". The heading in the last three columns indicates the prefix (X, Y, or Z). \ by itself is the first column, i.e. "mod"

Answer 7, Japt, 15
ò f!vU"Gw\((()<>))
n=int(input())
i=1
div=[]
while (i<=n):
    if n % i == 0:
        div.append(i)
    i=i+1
print(div)#Rḍ⁸T”

Try it online!
Changed #b∫I:b;\?t to ò f!vU (10 points) and added some more Brain-Flak code by changing ~(() to ((()<>)) (5 points). I believe the code we're working toward is
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

Explanation
ò           Generate the range [0...input].
  f         Filter to only items Z where
   !vU        U.v(Z) returns truthily. (`fvU` would be Z.v(U))
              This returns true if U is divisible by Z, false otherwise.
      "...  The rest of the program is enclosed in this string, which is passed as an extra
            argument to `f`. Fortunately, `f` ignores it.
            Implicit: output result of last expression

Answer 8, 05AB1E, 14
"'ò f!vUGw\((()<>)){((({'
n=int(input())
i=1
div=[]
while (i<=n):
    if n % i == 0:
        div.append(i)
    i=i+1
print(div)
'#Rḍ⁸T”'".e

Try it online!
Explanation
Luckily 05AB1E has a builtin Python interpreter (of sorts).  In order to make this run we push
'ò f!vUGw\((()<>)){((({'
n=int(input())
i=1
div=[]
while (i<=n):
    if n % i == 0:
        div.append(i)
    i=i+1
print(div)
'#Rḍ⁸T”'

as a string to the top of the stack.  We have to use string literals instead of comments here because 05AB1E really doesn't like comments in its Python code.   We also have to get rid of the " in the original code because it causes the string to end prematurely.
Once the string has been pushed we use .e to execute it as python code.
Work towards Brain-Flak
I was able to add 5 extra characters towards the goal of making a Brain-Flak answer.  I would have been able to add 6 but alas I forgot whitespace doesn't count towards the point score.
So far we have:
((({})<>)){((({}     ((  )   )       (              <              )           (          )   )
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

Answer 13, Pyth, 15
f!%QTS|Q"@░┼_¥
f!vUGw((({})<>)){((({}[()]n=int(input({})(<>))i=1div=while((<>)){ifn%i==0div.append(i)i=i+1}printdiv)}#R{}T.eX
╜R;`;╜%Y*`M∩

Try it online!
Explanation
So I don't know much Pyth, but what I do know is that the source code is in the form of a tree, each command taking a specific number of arguments to its right. The tree of the divisor program I wrote looks like this:
     f
    / \
   !   S
   |   |
   %   Q
  / \
 Q   T

Q is the input. f takes two arguments, F and A, and returns the items T in A where F(T) returns a truthy value. In this case, F is a function which returns the logical NOT of Q%T, and A is SQ, which creates the range [1...Q]. This has the effect of filtering to only the integers T in [1...Q] where Q%T == 0.
In order to avoid parsing the rest of the code, the entire thing is wrapped in a string, then |Q"... returns the logical OR of Q and the string. Since Q is always positive, it's always truthy, and thus always gets returned from the logical OR.

Work toward Brain-Flak
((({})<>)){((({}[()] (({})(<>))      ((             <>                 )   )  {(          )  })}{}
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

Really curious to see who will submit the Brain-Flak answer, if it ever happens..

We're getting closer. We should be there by answer 20 (if not earlier)

Well, we've got 54 chars to go...

Well, we're about halfway there, and this stated around answer 8, so we should finish around 18.

Answer 16, GolfScript, 15
~:
),(;{
\%!},p#&f!0pv'%QTS|Q"@░┼_¥f::+!vUGw((({})<>)){((({}[()]<n=int(input({})(<>))><>)<{i=1div=wvhile(({})){({}<>)){ifn%i==g00div.append(i)i=i+1{}printdiv)}#R{}T:.eX╜R;j`;╜0%Y*`M∩\

Try it online!
I added ~:␤),(;{␤\%!},p#, using newline as a variable name to fit the size constraint, and squished the entire program back onto one line to comment it out. This was distance 14. Then, I added { before }printdiv for Brain-Flak.
~:␤                    Read input, store as NL
   ),(;                Range [1, 2... NL]
       {␤\%!},         Filter elements that divide NL
              p#       Print and comment everything else out

Work towards Brain-Flak
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}     <>                 )   )  {(          ) {})}{}
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

Answer 17, CJam, 15
qd:A
),(;
{A\%!},p
e#&f!0pv'%QTS|Q"@░┼_¥f::+!vUGw((({})<>)){((({}[()]<n=int(input({})(<>))><>)<{i=1div=wvhile(({})){({}[()])<>}{}}{)){ifn%i==g00div.append(i)i=i+1{}printdiv)}#R{}T:.eX╜R;j`;╜0%Y*`M∩\

Try it online!
qd:A     # Get input as decimal and store it in A
),(;     # range [0..A]
{    },  # Filter where
 A\%!    # A mod this value == 0
       p # print
e#...    # comment

Work towards Brain-Flak (30 to go)
)({}((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{            )   )  {(          ) {})}{}
 (  (( {})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

We are actually only 30 away. instead of omitting the extra 4 characters you can transform )({}((( to ()({})(( at the cost of only two, this is not the exact program we had in mind but () and ({}) are both no-ops in this context.

@WheatWizard Nice! I didn't look at the actual code, just ran it through the distance checker in the question.

Answer 21, Cubix, 15
Finally managed to fit this in :) Thankfully it is after the Brain-Flak answer got done, because I think I would have hindered.  Needed the full 15 to implement.
"qd:A(),(;{A\%!},pe#&f!0pv'%QTS|Q@░┼_¥f::+!vUGw
)(Is{})%?;ONou{((({}[()]<n=int(inpu;<@!-;<>))><>)<{i=1div=wvhile(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{ifn%i==g00div.append(<{}<>{}<>>i)i=i+1}{}printdiv)}
#R
{}T:.eX╜R;j`;╜0%Y*`M∩\"ILD¹s%_Ï,

This maps to the following cube
              " q d : A ( )
              , ( ; { A \ %
              ! } , p e # &
              f ! 0 p v ' %
              Q T S | Q @ ░
              ┼ _ ¥ f : : +
              ! v U G w ) (
I s { } ) % ? ; O N o u { ( ( ( { } [ ( ) ] < n = i n t
( i n p u ; < @ ! - ; < > ) ) > < > ) < { i = 1 d i v =
w v h i l e ( ( { } ) ) { ( { } [ ( ) ] ) < > } { } } {
} < > ( [ { } ( ) ] { } ) > < > ) < > { i f n % i = = g
0 0 d i v . a p p e n d ( < { } < > { } < > > i ) i = i
+ 1 } { } p r i n t d i v ) } # R { } T : . e X ╜ R ; j
` ; ╜ 0 % Y * ` M ∩ \ " I L D ¹ s % _ Ï , . . . . . . .
              . . . . . . .
              . . . . . . .
              . . . . . . .
              . . . . . . .
              . . . . . . .
              . . . . . . .
              . . . . . . .

You can try it here, but you will need to paste it in.  I suspect some of the specials are causing problems for the permalink.
The code is essentially over 2 lines.  The important parts are:
I s     ) % ? ; O N o u
        u ; < @ ! - ;

I s ) This gets the input, swaps the top of the stack (0 would have worked as well) and increments
% ? Get the mod and test.  If 0 carry on forward or drop down to the redirect
; O N o Drop the mod results and output the number followed by a newline
u U turn onto the line below
Following is in order executed
; - ! @ Remove the 10 from stack, subtract number from input, test and terminate if zero
< ; u Redirect target for first test.  Remove top of stack (either mod or subtract result) and u-turn back up to increment

Answer 4 - Jelly, 4
:tGw\~)
%n=int(input())
%i=1
%div=[]
%while (i<=n):
%    if n % i == 0:
%        div.append(i)
%    i+=1
%print(div)Rḍ⁸T

Try it online!
Relevant code:
Rḍ⁸T

The ) acts as a break between links as far as the parser is concerned (I believe).
The built-in would be ÆD, instead this creates a range from 1 to the input with R, checks for divisibility by the input with ḍ⁸, then returns a list of the truthy one-based indexes with T.

Answer 9, Whitespace, 15
f!vUGw((({})<>)){((({}n=int(input())i=1div=while(i<=n):ifn%i==0:div.append(i)i=i+1printdiv)}#R{}T”.e<SPACES>

Where <SPACES> is replaced by the following string, where T is 0x09, L is 0x0A, and S is 0x20:
SSSLSLSTLTTTTTSSSLLSSSLSTSSTLSTSSTLTSSTLTSSSLSSSTLTSSSSTSSTLSTSSTLTSTTLTSTLLSLSL
LSSTLSLSTLSTSSSTSTSLTLSSLSLSLLSSSSLLLL

Literal newline added for clarity. Noticed that the rules only specify non-whitespace characters. Nope, couldn't help myself.
Work towards Brain-Flak
I have no idea what was going on earlier, so we now have:
((({})<>)){((({}     ((  )   )       (              <              )           (          )   )}{}
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

Answer 18, WSF, 15
q

    d:A(),(;{A\%!},pe#&f!0pv'%QTS|Q"@░┼_¥f::+!vUGw)(({})<>)){((({}[()]<n=int(input({})(<>))><>)<{i=1div=wvhile(({})){({}[()])<>}{}}{}<>([{}()]{})><>){ifn%i==g00div.append(i)i=i+1{}printdiv)}#R{}T:.eX╜R;j`;╜0%Y*`M∩\

(This takes input and output via character code)
Explanation
WSF is essentially brainfuck except it uses whitespace instead of brainfuck's usual set of operators.  Here is the code decompiled into brainfuck:
,
[->+>>>>+<<<<<]>

[
[-<+>>>>+<<<]<[->+<]
>>>>>[-<<+>>]<[->+<]<
[>+>->+<[>]>[<+>-]<<[<]>-]
>>[-]+>[<->[-]]
<
[<<<<.>>>>-]<[->+<]<<<
-
]

Progress towards Brain-Flak
Since WSF is only whitespace I was able to add 15 more characters onto the Brain-Flak code.  This puts us at 15 away from the answer, so feel free to post it.
()({})(({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})>  )  {(          ) {})}{}
()({})(({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

Since I am not going to get to post the Brain-flak answer myself, I thought I would just take the time to thank everyone that has helped contribute to this goal:

Riley, 16 bytes
LegionMammal, 15 bytes
ETHproductions, 11 bytes
Lynn, 1 byte

The following users were not able to contribute bytes directly but did help in other ways:

Mistah Figgins

Thanks everyone for making this possible!

Answer 19, 2sable, 15
"qd:A(),(;{A\%!},pe#&f!0pv'%QTS|Q@░┼_¥f::+!vUGw)(({})<>)){((({}[()]<n=int(input({})(<>))><>)<{i=1div=wvhile(({})){({}[()])<>}{}}{}<>([{}()]{})><>){ifn%i==g00div.append(>>i)i=i+1}{}printdiv)}#R{}T:.eX╜R;j`;╜0%Y*`M∩\"
ILD¹s%_Ï,

Try it online!
I removed the extra whitespace, wrapped everything that existed before into a string, then:
IL        # Push [1 .. input]
  D       # Duplicate
   ¹s%    # For each element: input % element
      _   # Logical not
       Ï  # Keep the values from [1 .. input] where this is 1
        , # print

Answer 6, Python 1.6, 15
#b∫I:b;\?t"Gw\~(()
n=int(input())
i=1
div=[]
while (i<=n):
    if n % i == 0:
        div.append(i)
    i=i+1
print(div)#Rḍ⁸T”

I removed the % symbols and commented out the first line and a bit of the last line.  This alone cost me 10 of my 15 points.  However I was not yet done; since Python 1 doesn't have += I had to replace i+=1 with i=i+1 costing me an extra 3 points.  Since I had 2 left over I also added (( to the beginning.  I am planning to make a submission in Brain-Flak later and I need parens.

+1 even after OP said that Python was done with, apparently not....

Answer 10, Ohm, distance 5
@░┼_¥
f!vUGw((({})<>)){((({}n=int(input())i=1div=while(i<=n):ifn%i==0:div.append(i)i=i+1printdiv)}#R{}T”.e<SPACES>

...where <SPACES> is replaced by that monstrous string from the Whitespace answer.
A bit of a cheeky answer, since everything else is just a wire that lays unexecuted.

Any work towards Brain-Flak here?

@CalculatorFeline Afraid not.

Too bad. 10 chars towards Brainflak! If only.

Answer 12, Seriously, 15
╩"@░┼_¥
f!vUGw((({})<>)){((({}[()]n=int(input())i=1div=while((<>)){ifn%i==0div.append(i)i=i+1}printdiv)}#R{}T.e"X
╜R;`;╜%Y*`M∩

Try it online!
The only difference from the Actually answer is that Seriously uses backticks to mark a function where Actually uses ⌠ and ⌡ and we just make the extra characters into a string then pop and discard it.

Work Towards Brain-Flak
((({})<>)){((({}[()] ((  )   )       ((             <>                 )   )  {(          )  })}{}
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

+1 bringing the contest one step closer to Brain-Flak. Just 1 question: Do you know any programming language very similar to Seriously?

Other than actually.

@Mr.Xcoder I haven't used any. I only knew Seriously was this similar because Actually is just Seriously version 2.0

Answer 14, Del|m|t, 15
                                                f!%QTS|Q"@░┼_¥f!vUGw((({})<>)){((({}[()]<n=int(input({})(<>))><>)<{i=1div=while(({})){({}<>)){ifn%i==0div.append(i)i=i+1}printdiv)}#R{}T.eX╜R;`;╜%Y*`M∩

Try it online!
Explanation
I am really starting to abuse the fact that whitespace is not counted towards the difference here.  Del|m|t doesn't really care all that much what characters you you so the vast majority of the code is a sequence of spaces and carriage returns at the beginning of the program. The actual visible parts of the code are not executed at all.
Here is the code transcribed into a more "reasonable" fashion:
O R ^ V O @ A K T A J O @ A K U N R O @ B K U @ A K T Q ^ X @ B K T R ^ P O @ A K T K R ^ _ @ ^ @

Try it online!
How it works at the low level
To start we have O R ^ V  this serves to take input on the first loop and works as a no-op all other times.
We then use O to make a copy of the input for later.
@ A K T recalls the variable stored in memory position -1 (at the beginning of the program this is 0) and A J increments it.  O @ A K U Stores the now incremented value back in memory position -1 for our next loop around.
N calculates the mod of the copy of the input we made a while back and the value just recalled from memory and R negates it.
Together N R create a boolean that indicates whether or not the our input is divisible by the TOS.
We store a copy of this boolean to memory space -2 using O @ B K U and recall the value from memory space -2 using @ A K T.
We swap the top two elements with Q to ensure that the boolean is on top and output the value if the boolean is true using ^ X.
If the boolean was false we have an extra value that needs to be eradicated so we recall the boolean we stored in space -2 with @ B K T and pop a value if it is false R ^ P.
We duplicate the input value with O and subtract the value at memory -1 with @ A K T K.  If this is zero we exit R ^ _.
Lastly we have @ ^ this skips whatever the next value is.  We need this because there is a bunch of junk (actually only a @ symbol) generated by the visible portion of the code.
Once it reaches the end it loops back to the beginnning.
How it works at the high level
The basic idea is that we have a value primarily stored at memory location -1 that is incremented each time we loop.  If that value divides our input we output it and when the two are equal we end execution.
Progress Towards Brain-Flak
Because whitespace does not count towards the difference I was able to change the code without spending any of my 15 points and thus all of them were invested into the Brain-Flak code.
Here is our current standing.
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}     <>                 )   )  {(          )  })}{}
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

Please update the leaderboard everytime you submit an answer.

Only 39 characters left for the Brain-Flak answer! :) That means we still need at least 3 answers...

Answer 15, Befunge-98, 15
&f!0pv
'         %QTS|Q" @ ░┼_¥f
:
:
+
!         vUGw(((   {})<>)){((({}[()
]    <    n=int(i   nput({})(<>))><>)
<      {i=1di     v
  =
w    v
       hile(({      })){({}<>)){ifn%i==
g
0
0    div.app   en   d(i)i=i+1}printdiv)}#R{}T
:
.    eX╜R;
j
`      ;╜
0
%  Y*`M∩
\

Try it Online!
(There is probably a lot of unnecessary whitespace, but I can't be bother to golf it out right now)
I used all 15 for the Befunge program, so no changes to the Brain-flak this time.
My main strategy for this was to send the IP going vertically, and using whitespace to execute certain characters from the preexisting code.
Explanation:
The code that matters to the Befunge program is this:
&f!0pv
'                 @
:
:
+
!
]    <
<                 v
w    v
g
0
0    d
:
.    e
j
`
0
%    `
\

Which is equivalent to:
&f!0pv   Gets input, and stores it at (0, 0) (where the & is)
         The v goes down, hits the < and ], which turns the IP up along the first line

!+::'&   There is a 0 at the bottom of the stack, so ! changes it to a 1 and + increments
         :: duplicates twice, and '& gets the input value

\%       swaps the input and iterator mods them
  0`j.   Checks if input mod iterator is 0 - if it is, print iterator

:00gw    gets the input again, and compares it to the iterator.
         If they are different, the IP travels right to the v
         Otherwise, it continues straight, and hits arrows leading to the end (@)

de`      pushes 0, to be used in the increment line

Answer 1 - Python 2.7
n=input()
i=1
div=[]
while (i<=n):
    if n % i == 0:
        div.append(i)
    i+=1
print(div)

Distance: NA - First answer
Try it online!

Answer 2 - Python 3, 5
n=int(input())
i=1
div=[]
while (i<=n):
    if n % i == 0:
        div.append(i)
    i+=1
print(div)

Try it online!

Now you have closed the answer list in Python. Good!

@Mr.Xcoder What if someone uses Python 3.5 and uses the async or await built-ins? Would that count as a completely different language?

Answer 5 - SOGL 0.8.2, 9
b∫I:b;\?t"Gw\~)
%n=int(input())
%i=1
%div=[]
%while (i<=n):
%    if n % i == 0:
%        div.append(i)
%    i+=1
%print(div)Rḍ⁸T”

Explanation:
b∫              repeat input times                [0]
  I             increment (the loop is 0-based)   [1]
   :b           duplicate                         [1, 1]
     ;          put the input one under the stack [1, 114, 1]
      \?        if divides                        [1, 1]
        t        output                           [1, 1]
         "...”   push that long string            [1, 1, "Gw\~...Rḍ⁸T"]

Note: the interpreter currently needs the \ns be replaced with ¶ in order to not count it as input, but the parser itself considers both interchangable.

Answer 11, Actually, 15
╩@░┼_¥
f!vUGw((({})<>)){((({}]n=int(input())i=1div=while(i<=n):ifn%i==0:div.append(i)i=i+1printdiv)}#R{}T”.e
╜R;⌠;╜%Y*⌡M∩

Try it online!
Explanation
Actually has a nice builtin ÷ for finding the factors of a number, however we are not allowed to use such builtins.
I begin by storing the input to the registers so that it will be unharmed by what is to come.  I do this using ╩ but I could have just as easily used one of the other commands available.
Then I paste the code we already had (I removed all the whitespace because it was annoying to work with, I can do this because "whitespace does not count").  Luckily this does a whole lot of nothing when the stack is empty.
Then we have the rest of the program
╜   Pull our input from the register
R   Create the range of n
;   Duplicate the range
⌠   Declare a function
 ;  Duplicate n
 ╜  Pull from register
 %  Mod
 Y  Logical not
 *  Multiply by n
⌡   End Function
M   Map the function across the range
∩   Remove the zeros with a Intersection

Work Towards Brain-Flak
All that work and I was only able to get one extra paren in.
((({})<>)){((({}   ] ((  )   )       (              <              )           (          )   )}{}
((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>([{}()]{})><>)<>{(<{}<>{}<>>)}{})}{}

You know, if we enclose the Brain-Flak code in [] we can have Brainfcuk code after it. Might open up possibilities.

@CalculatorFeline I don't think we do.  Brain-Flak on its own does next to nothing in brainfuck.  Making a submission in brainfuck would be very hard but I don't think Brain-Flak is going to harm it any.

Well, Brainfuck planning would be a good idea at this stage. Bytes that can't go towards Flak can be placed in other planning (like BF, Syms, or conventional languages).

@CalculatorFeline The thing is there is pretty much no such thing as bytes that can't go towards Brain-Flak.  Unless a language has some pretty weird rules about parens (in which case it is probably already unusable) we can use extra bytes to insert parens.

Why does your code output an extra 0 before the array??

@Mr.Xcoder Its an implicit zero at the bottom of the stack.

Uh, ok...I am not familiarised with Actually, sorry. My bad

@Mr.Xcoder No problem. I am not familiar myself.  This is my first post in Actually.

23, Brain-Flak Classic, 13
"qd:A(),(;{A\%!},pe#&f!0pv'%QTS|Q@░┼_¥f::+!vUGw)(Is(({})<>))%?;ONou{((({}[]<n=int(inpu;({})(@!-;<>))><>)<{i=1div=wvhile(({})){({}[])<>}{}}{}<>({<({}[])>[]}[]{}{})><>)<>{ifn%i==g00div.append(<{}<>{}<>>i)i=i+1}{}printdiv)}#R{}T:.eX╜R;j`;╜0%Y*`M∩\"ILD¹s%_Ï,

Originally, @Wheat Wizard had posted the brain-flak-classic code as it was on answer 22:
()({})((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>({<({}[]{})           ><>)<>{(<{}<>{}<>>)}{})}{}
()({})((({})<>)){((({}[  ]<(({})(<>))><>)<{(({})){({}[  ])<>}{}}{}<>({<({}[]  )>[]}[]{}{})><>)<>{(<{}<>{}<>>)}{})}{}

This is 17 characters off. However, I was able to compress this by simply moving the {}) further right in the proposed code to get
()({})((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>({<({}[]         {})><>)<>{(<{}<>{}<>>)}{})}{}
()({})((({})<>)){((({}[  ]<(({})(<>))><>)<{(({})){({}[  ])<>}{}}{}<>({<({}[])>[]}[]{}{})><>)<>{(<{}<>{}<>>)}{})}{}

Which is only 13 characters off! So all I did was add/remove brackets to get the proposed code.

The original code I posted had a typo, it's fixed now. (Thanks @WheatWizard!)

22, Lenguage, 15
Lenguage is a esolang that cares only about how long the program is not about its content.  So we can create any lenguage program we want by padding the last program with the proper amount of whitespace.  Lenguage is compiled into brainfuck so we will reuse the brainfuck program I wrote a while ago
,[->+>>>>+<<<<<]>[[-<+>>>>+<<<]<[->+<]>>>>>[-<<+>>]<[->+<]<[>+>->+<[>]>[<+>-]<<[<]>-]>>[-]+>[<->[-]]<[<<<<.>>>>-]<[->+<]<<<-]

I made a few changes to the main program to facilitate later answers, but the end result looks like:
<SPACES>"qd:A(),(;{A\%!},pe#&f!0pv'%QTS|Q@░┼_¥f::+!vUGw)(Is(({})<>))%?;ONou{((({}[()]<n=int(inpu;({})(@!-;<>))><>)<{i=1div=wvhile(({})){({}[()])<>}{}}{}<>({<[{}[]{})><>)<>{ifn%i==g00div.append(<{}<>{}<>>i)i=i+1}{}printdiv)}#R{}T:.eX╜R;j`;╜0%Y*`M∩\"ILD¹s%_Ï,

where <SPACES> represents 55501429195173976989402130752788553046280971902194531020486729504671367937656404963353269263683332162717880399306 space characters.
Am I abusing the whitespace doesn't count rule? Perhaps.
Work towards Brain-Flak Classic
We had all of those parens already there so I thought I would start us along the way towards Brain-Flak Classic.
()({})((({})<>)){((({}[()]<(({})(<>))><>)<{(({})){({}[()])<>}{}}{}<>({<({}[]         {})><>)<>{(<{}<>{}<>>)}{})}{}
()({})((({})<>)){((({}[  ]<(({})(<>))><>)<{(({})){({}[  ])<>}{}}{}<>({<({}[])>[]}[]{}{})><>)<>{(<{}<>{}<>>)}{})}{}

Another target... That's madness. I like it!

So the top row of Brain-flak Classic is what we have, and the bottom is what we need?

@MistahFiggins yes

Tada! Brain-Flak Classic is closer because I moved some parens around


text:
Back-To-Front Permutation Index
The Challenge
Given the number of items, n, in a non-empty, sorted list output the index, i(n), at which its
"Back-To-Front Permutation"
would reside in a list of all permutations if said permutations were sorted lexicographically.
Results may be 0 or 1-based, just say which (that is i, not n).
The Back-To-Front Permutation
...is the result of building a list of items by repeatedly taking the back (right) then front (left) of a forward sorted (left-to-right) list until all items have been moved to the new list, like so:
Input being consumed     Output being built
----------------------+----------------------
[1,2,3,4,5,6,7]       |   []
[1,2,3,4,5,6]         |   [7]
  [2,3,4,5,6]         |   [7,1]
  [2,3,4,5]           |   [7,1,6]
    [3,4,5]           |   [7,1,6,2]
    [3,4]             |   [7,1,6,2,5]
      [4]             |   [7,1,6,2,5,3]
       []             |   [7,1,6,2,5,3,4]
----------------------+----------------------
                Result:   [7,1,6,2,5,3,4]

The Permutation Index
If n is 7 (as the above Back-To-Front example) there are 7! = 5040 possible permutations of the (distinct) items.
The first (or zeroth if you prefer) item in the lexicographically sorted list of all those permutations would be [1,2,3,4,5,6,7] itself.
The second item would be [1,2,3,4,5,7,6].
The penultimate item would be [7,6,5,4,3,1,2].
The final item would be [7,6,5,4,3,2,1].
Somewhere in the list is [7,1,6,2,5,3,4] - the Back-To-Front permutation.
In fact it resides at index 4421 (or 4420, 0-based).
The first 100 terms of the (1-based) series of i(n) stating with n=1 are:
[1, 2, 5, 20, 101, 620, 4421, 35900, 326981, 3301820, 36614981, 442386620, 5784634181, 81393657020, 1226280710981, 19696509177020, 335990918918981, 6066382786809020, 115578717622022981, 2317323290554617020, 48773618881154822981, 1075227108896452857020, 24776789629988523782981, 595671612103250915577020, 14915538431227735068422981, 388375922695377900515577020, 10500493527722974260252422981, 294387851083990886241251577020, 8547374142655711068302364422981, 256705485669535347568006115577020, 7966133168508387470157556764422981, 255164703765185142697060455395577020, 8428152915046701352821133945884422981, 286804646124557439494797475697635577020, 10046343320261587490171853861825564422981, 361946983469639629977827594289009635577020, 13401806107756705416338151987291892764422981, 509620811358844406343669072112782398435577020, 19888261269838598952296612667790114958364422981, 796027021978059135393314656928325779313635577020, 32656499591185747972776747396512425885838364422981, 1372349618161694150570365858847999144050545635577020, 59042913445212141486784766209665998363213966364422981, 2599228661343236626556841044804949891956424561635577020, 117022992204136957935406320450852765172427309198364422981, 5385599167607951991914899108349402127789224443761635577020, 253237642343560228651049456045262577841408407945358364422981, 12160677950192512442211239591328112460680077946732401635577020, 596121186084075048430040923729967264426872753432477838364422981, 29817972015629302995182567242334801579950768815528034161635577020, 1521300781271752977229060449226968409483308951201458077838364422981, 79136874389672125594431576407176798565806196489681819746161635577020, 4195746409670353438703582176982222851124537591877131904925838364422981, 226647950929571027033389160506045358232154026979930809227362161635577020, 12469755402728704898931711687060471601348167024469505953048477838364422981, 698528832402134746955113935776664478135149811856698952734398562161635577020, 39828390672475082008725487969655657656845234984369903192450082717838364422981, 2310732940610403489820749422545419026172017083196773021228249831522161635577020, 136372385605079432248118270297843987319730859689490659519593045108637838364422981, 8184614727136310712028222912925520393434441746671755292929684651300962161635577020, 499395599150088488088828589263699706832570087241364247806476254829684637838364422981, 30970577661237849037564293765687064381179710710016867944356691992991422562161635577020, 1951637737743202215078582414596211073163593979517251760161922907619738331037838364422981, 124935294448140961888354806920565269729701922195027940438639971467594965899362161635577020, 8122715297634329704834815499864930982456556629150409552483483162921360809076637838364422981, 536222223779808734298894424747977821661836507759648464980376643706749720339339362161635577020, 35934888694408876553950964671857486605505798806289876128721251856561212716604532637838364422981, 2444100653742421723047039453897314094441893402549077796242989486161660232995578763362161635577020, 168678351774398889649421299427375524997828651490971291597405051437095619521145068660637838364422981, 11809893318195492906423362422261723211461109491055454565957957813190913963268700251019362161635577020, 838668695249666824614744281817664287077123498629740781320472805575397766414810317446260637838364422981, 60395789681636420036909326103457008453700968286067588202502542158402987220806878956757899362161635577020, 4409719671831047920854347812021594101623099731996837427616577550212019116846376438060145780637838364422981, 326378824480107593305098680409232188044060152088938133742995349285199216584125189021190726539362161635577020, 24482761986915290498641378436184801472882183734481184704052899163370643460988742220422624697460637838364422981, 1861011939679134964489290882424961756757512351644848150968435083798473400034549180897307347526539362161635577020, 143322080088606734669581493203883323226982866872563510695813139604263517949121870899167900513721460637838364422981, 11180959098117691096787939665528162905504766712615688479353149686064571807285078895345918312663622539362161635577020, 883437253980179837588356231874303489164303450066956218734514913541773418886216781638015892528346553460637838364422981, 70686019792283622457223177491312228676420353892298796358374930144685265836593932061030928974752467526539362161635577020, 5726440000955084363422511054086796876735936890839327162387490119571704913857298124195153605274993472953460637838364422981, 469637893700329090478715695935318149767077357177154001454773443957172289821041850488811978203204173646406539362161635577020, 38985601803506257421418755484185292421669426050466292273769584084412579273175587484390779961900566697260473460637838364422981, 3275254532761847009577968823645945995578996860191583194845076448298646552018541276645494943006816186458917446539362161635577020, 278435156905293180685369975402415213484477637470382623210256836304261379607777392174394791509334107831816205753460637838364422981, 23948660226767439201080153228038844501800392914958999127628507660415900870134672884615069843391985357739844389446539362161635577020, 2083808638152760278012520365471350750727983345146397213195344003554238214857458501196068353393022808146994627392953460637838364422981, 183398833619245678836784325280074933629492985604252949471226236983335323969170740817904072891411479020269638889458246539362161635577020, 16324556327289215402380134937173544376210173250892288905442294470849835710409338998582008497896189183708810744110298553460637838364422981, 1469391408154472281907142598683652193509359788033796478036774569234135557383656537547410122872987870461908423725867813446539362161635577020, 133730761359685823973259426160811489954077506688872881313704960027919535214176338228137873831877461557289259913042140378553460637838364422981, 12304683293281621431502064899712741587623914209186541475526534622910218175769343180214908250005163885795818227069614613285446539362161635577020, 1144467823788359953327703097406527694627129315367226993710615746590336588945697972034988381266839681418043178062317463477466553460637838364422981, 107592147841885948074037582159380073309559674264815645313786758687454863280472229658194120833316575777142822473140067877053221446539362161635577020, 10222386340397173314525664517235347022088186665852557223898463812546839124314230895213571254552107892786139414391086539473362138553460637838364422981, 981455548530552515895045737024658454136095461985415238220477591025945383684777269092475904782448641089288955324574667766166512421446539362161635577020, 95211304133951567337433380212539040258207718457187560919883999728307800228797098229713403270806624010171995234355103499880901319898553460637838364422981, 9331679144749296178288752362844703433551486045621764102574354777566399269794426700653262755936922495813433855354253356929531746247461446539362161635577020, 923930475294692230638703636199822301473608196598194450583355284174609600662504729388761377005628260366723545352917984225582320362921178553460637838364422981, 92402284968649460451060535220066878189242360067783427018009608611042990392567410879552702599150890025886974375474305774025602890553942821446539362161635577020

(i(0)=i(1)=1, but the challenge itself only deals with non-empty lists)
At the time of posting this sequence did not appear in the OEIS.
Output must only need to work in theory (don't worry about overflowing integers, or running out of resources for example).
This is code-golf, so the shortest answer in bytes wins.
However, don't let code-golf languages dissuade you - good solutions should get upvotes too!

Hope all is OK with this - it was in the sandbox for over a month with no feedback.

Related -- Permutation numbering

These are alternating factorials with every other entry increased by 1.

@xnor yes they are - the front-to-back permutation has the previous index to the back-to-front one.

Haskell, 32 bytes
f 1=1
f n=product[1..n]+1-f(n-1)

Try it online!
Uses the relationship f(n-1) + f(n) = n! + 1. Adjacent members of the sequences add to factorials plus one:
1,   2,   5,   20,   101,   620,   4421, ...
  3     7    25    121    721   5041  ...
 2!+1  3!+1  4!+1  5!+1   6!+1  7!+1

Jelly, 6 bytes
R!ḅ-_Ḃ

0-based. Try it online!
Heavily inspired by @Neil's ES6 answer.
Explanation
R!ḅ-_Ḃ
R       Create the range [1..N].
 !      Take the factorial of each.
  ḅ-    Convert from base -1; that is, sum, but alternate between adding and subtracting.
    _Ḃ  Subtract N%2.

But how?
I explain in my ES6 answer a related technique for calculating each number. The formula is this:
(n-1)(n-1)! + (n-3)(n-3)! + (n-5)(n-5)! + ...

A realization struck me while reading @Neil's ES6 answer. This formula can be simplified like so:
(n-1)(n-1)!        + (n-3)(n-3)!            + (n-5)(n-5)!            + ...
(n(n-1!) - (n-1)!) + ((n-2)(n-3!) - (n-3)!) + ((n-4)(n-5)! - (n-5)!) + ...
(n!      - (n-1)!) + ((n-2)!      - (n-3)!) + ((n-4)!      - (n-5)!) + ...
n! - (n-1)! + (n-2)! - (n-3)! + (n-4)! - (n-5)! + ...

The Jelly code R!ḅ- calculates this formula. However, each odd value of n will have an extra + 0! at the end, which we take care of by subtracting n%2.

Congratulations you found my solution! (do note that it is 0-based).

Figures that you'd use ḅ- sooner or later... :P Nice work!

@JonathanAllan I knew as soon as I saw that you had posted the challenge that there would be a sneaky Jelly answer. It took quite a while for anyone to find it though. Great challenge :-)

JavaScript (ES6), 38 bytes
f=(n,x=n%2,y=1)=>n-x&&f(n,++x,y*=-x)+y

0-indexed. (No explanation because I don't actually know why it works, sorry.)

Oh, that's genius. My answer takes (n-1)*(n-1)! + (n-3)*(n-3)! + (n-5)*(n-5)! + ..., which is equivalent to (n! - (n-1)!) + ((n+2)! - (n-3)!) + ((n-4)! - (n-5)!) + ... which is what your answer does.

JavaScript (ES6), 44 bytes
f=(x,n=0,g=1)=>x-n&&(x-n&1)*g*n+f(x,++n,g*n)

0-based. This takes advantage of the fact that the numbers can be represented as sums of factorials in the following pattern:
       1   2   6  24 120 720
   0:
   1:  1
   4:      2
  19:  1       3
 100:      2       4
 619:  1       3       5
4420:      2       4       6

Why? The permutations can be represented nicely in the factorial base: taking the nth item out of the remaining list corresponds to a digit of n at that position. We're alternating between taking the last item (highest digit) and the first item (zero); therefore, in the factorial base, these numbers can be represented as:
0
10
200
3010
40200
503010
6040200

and so on.

MATL, 17 bytes
:t"&0)P]vG:Y@!=Af

Output is 1-indexed.
Try it online!
Explanation
The code appplies the definition: builds the back-to-front permutation, generates all permutations, compares the former with all of the latter, and outputs the index of the matching.
:        % Input n implicitly. Push [1 2 ... n]
t        % Duplicate
"        % For each: do the following n times
  &0)    %   Push the last element and then the rest of the array
  P      %   Reverse
]        % End
v        % Concatenate the whole stack vertically. This produces into a column vector
         % with the back-to-front permutation
G:       % Push [1 2 ... n] again
Y@!      % Permutations of [1 2 ... n]. Gives a matrix. Each column is a permutation
=        % Test for equality, element-wise with broadcast
A        % All: true for columns that have all entries equal to true. Gives a row vector
f        % Find: index of non-zero value. Implicitly display

Jelly, 10 8 bytes
RṚżRFQŒ¿

Thanks to @ais523 for golfing off 2 bytes and a tremendous speed-up!
Try it online!
How it works
RṚżRFQŒ¿  Main link. Argument: n

R         Range; yield [1, ..., n].
 Ṛ        Reverse; yield [n, ..., 1].
   R      Range; yield [1, ..., n] again.
  ż       Zip; yield [[n, 1], ..., [1, n]].
    F     Flatten.
     Q    Unique; deduplicate the results.
      Œ¿  Compute the permutation index of [n, 1, n-1, 2, ...].

Looks like you missed the Œ¿ builtin. Your method for constructing the list is a byte shorter than mine, so if you can replace i@Œ! with that, then you should be able to get this down to 8 bytes, beating my answer.

Completely forgot that was a thing. Thanks!

Jelly, 9 bytes
RU;¥/ỤUŒ¿

Try it online!
Huh, I was trying to FGITW this. Turns out @Dennis posted first, but this is shorter.
Explanation
RU;¥/ỤUŒ¿
R           List of numbers from 1 to {the input}
   ¥/       Left-fold the list by
 U;         prepending the reverse of the list to the next element
     Ụ      Invert permutation
      U     Reverse the list
       Œ¿   Find index of permutation

Having Œ¿ as a built-in is fairly handy here letting us convert a permutation to its index, so the other 7 bytes are responsible for constructing the back-to-front permutation.
The way we do this is first to construct a different permutation, via the following pattern:
1
1 2
2 1 3
3 1 2 4
4 2 1 3 5
5 3 1 2 4 6
6 4 2 1 3 5 7

Each time, we're reversing the list we have so far, then appending the next integer. That doesn't produce the back-to-front permutation, but it's clearly related.
The permutation we're trying to get is 7 1 6 2 5 3 4. How is this related? Well, the element in the 7th position of the permutation we have is a 7; the element in the 1st position is a 6; the element in the 6th position is a 5; the element in the 2nd position is a 4, and so on. In other words, it's the inverse of the permutation we have (with the elements in reverse order). As such, after the reduce, we can invert the permutation with Ụ and reverse the result with U to get the back-to-front permutation we want.
It's possible that there are savings here, because it was written in a hurry and feels like it has at least some potential to rearrange things. I'm not sure it's possible to save a whole byte, though.

PHP, 86 bytes
for($i=$argv[1];$i>0;$i--)$o+=gmp_strval(gmp_fact($i))*($i%2==$argv[1]%2?1:-1);echo$o;

Uses the GNU Multiple Precision extension.
This function takes advantage of the fact that i(n) is equal to n! - (n-1)! + (n-2)! - (n-3)! etc
Breakdown
for($i=$argv[1];$i>0;$i--) {        // Simple decreasing for loop (added { for readability)
    $o+=                            //  increment output with
        gmp_strval(gmp_fact($i))    //      $i!
    * ($i%2 == $argv[1]%2 ? 1 : -1) //      multiplied by -1 if ($i is odd when the input is even) or (if $i is even when the input is odd), else by 1
    ;
}
echo $o;                            // echoes output

Batch, 79 bytes
@set/ax=%1%%2-1,y=z=1
@for /l %%i in (-%1,1,%x%)do @set/az+=y*=x-=1
@echo %z%

0-indexed.

Pyth, 12 bytes
x.pQ<Q.i_UQU

0-indexed.
Explanation
x.pQ<Q.i_UQU
      .i       Interleave
        _UQUQ  Reversed range and range
    <Q         Take first n
x              Find the index
 .pQ           In the list of permutations

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
How much do I have to write?
Writing out numbers is among the Hello worlds of programming, often the numbers 1-10.
I want to write out many numbers! Many, Many numbers. But how many numbers do I have to write?
Task
Given an integer input, give a number as output that would give me the number of digits that would be in a string containing all integer numbers in the range from 0 to the input, inclusive. The negation identifier ("-") counts as a single character.
Example I/Os
Input: 8
Written out: 0,1,2,3,4,5,6,7,8
Output: 9
Input: 101
written out: 0,1,2,3....,99,100,101
Output: 196
Input: 102
written out: 0,1,2,3....,100,101,102
output: 199
Input -10
Written out: 0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10
output: 22
This is a code-golf. The lowest number of bytes wins!

05AB1E, 3 bytes
Code:
ÝJg

Uses the CP-1252 encoding. Try it online!
Explanation:
Ý     # Range [0 .. input]
 J    # Join into one string
  g   # Get the length of the string

Python 2, 55 46 bytes
lambda n:len(`range(abs(n)+1)`)+2*~n+3*n*(n<0)

Try it online!
Getting better.

Röda, 23 bytes
f x{[#([seq(0,x)]&"")]}

Try it online!
Explained:
f x{[#([seq(0,x)]&"")]}
f x{                  } /* Defines function f with parameter x. */
        seq(0,x)        /* Creates a stream of numbers from 0 to x. */
       [        ]       /* Creates an array. */
                 &""    /* Joins with "". */
     #(             )   /* Calculates the length of the resulting string. */
    [                ]  /* Returns the value. */

Python 2, 41 bytes
f=lambda n:len(`n`)+(n and f(n+cmp(0,n)))

Try it online!

+1: You really cannot beat this intelligently made recursive solution with Python

Bash + OS X (BSD) utilities, 24 22 bytes
Thanks to @seshoumara for saving 2 bytes.
seq 0 $1|fold -1|wc -l

Test runs on Mac OS X:
$ for n in 8 101 102 -10 -1 0 1; do printf %6d $n; ./digitcount $n; done
     8       9
   101     196
   102     199
   -10      22
    -1       3
     0       1
     1       2

Here's a GNU version:
Bash + coreutils, 40 38 bytes
Again, 2 bytes saved thanks to @seshoumara.
(seq $1 0;seq 0 $1)|uniq|fold -1|wc -l

Try it online!

@tuskiomi I wrote coreutils when I meant BSD utilities -- I tested it in Mac OS X, where it does work on negative inputs too (seq there isn't the same as GNU seq).

@DigitalTrauma Nice GNU solution. Go ahead and post it yourself if you'd like to; I think it's too different to count as a variant of mine.

Ok, here you are :)

How about using fold -1|wc -l to do the counting? It is shorter.

Python 2,  83 ,78 64 bytes
shortest version:
lambda x:sum(map(len,map(str,(range(0,x+cmp(x,.5),cmp(x,.5))))))

this version saved 5 bytes, thanks to @numbermaniac :
x=input()
print len(''.join(map(str,(range(x+1)if x>0 else range(0,x-1,-1)))))

Try it online!
this one I came up with on my own after that (same amount of bytes):
x=input()
print sum(map(len,map(str,(range(x+1)if x>0 else range(0,x-1,-1)))))

Try it online!

You can use map on the second line for 78 bytes: print len(''.join(map(str,(range(x+1)if x>0 else range(0,x-1,-1))))). You might save even more by making it a lambda.

@numbermaniac can I do something similar this way?

@numbermaniac here is an equivalent: print sum(map(len,map(str,(range(x+1)if x>0 else range(0,x-1,-1)))))

lambda x:sum(map(len,map(str,(range(x+1)if x>0 else range(0,x-1,-1))))) for 71 bytes

Java 7, 74 bytes (recursive - including second default parameter)
int c(int r,int n){r+=(n+"").length();return n>0?c(r,n-1):n<0?c(r,n+1):r;}

Explanation (1):
int c(int r, int n){     // Recursive method with two integer parameters and integer return-type
                         // Parameter `r` is the previous result of this recursive method (starting at 0)
  r += (n+"").length();  //  Append the result with the current number's width
  return n > 0 ?         //  If the input is positive
     c(r, n-1)           //   Continue recursive method with n-1
    : n < 0 ?            //  Else if the input is negative
     c(r, n+1)           //   Continue recursive method with n+1
    ?                    //  Else (input is zero)
     r;                  //   Return the result
}                        // End of method

Java 7, 81 79 bytes (loop - single parameter)
If having a default second parameter as 0 for this recursive approach isn't allowed for some reason, a for-loop like this could be used instead:
int d(int n){String r="x";for(int i=n;i!=0;i+=n<0?1:-1)r+=i;return r.length();}

Explanation (2)
int d(int n){                 // Method with integer parameter and integer return-type
  String r = "x";             //  Initial String (with length 1 so we won't have to +1 in the end)
  for(int i=n; i != 0;        //  Loop as long as the current number isn't 0
      i += n < 0 ? 1 : 1)     //   After every iteration of the loop: go to next number
    r += i;                   //   Append String with current number
                              //  End of loop (implicit / single-line body)
  return r.length();          //  Return the length of the String
}                             // End of method

Test code:
Try it here.
class M{
  static int c(int r,int n){r+=(n+"").length();return n>0?c(r,n-1):n<0?c(r,n+1):r;}

  static int d(int n){String r="x";for(int i=n;i!=0;i+=n<0?1:-1)r+=i;return r.length();}

  public static void main(String[] a){
    System.out.println(c(0, 8) + "\t" + d(8));
    System.out.println(c(0, 101) + "\t" + d(101));
    System.out.println(c(0, 102) + "\t" + d(102));
    System.out.println(c(0, -10) + "\t" + d(-10));
  }
}

Output:
9   9
196 196
199 199
22  22

I like this solution, :)

Mathematica, 48 47 46 bytes
-1 byte thanks to Martin Ender!
StringLength[""<>ToString/@Range[0,#,Sign@#]]&

Anonymous function, taking the number as an argument.
Shorter solution by Greg Martin, 39 bytes
1-#~Min~0+Tr@IntegerLength@Range@Abs@#&

You can use Sign@# for #/Abs@#.

You can save a few bytes with a slightly different approach: 1-#~Min~0+Tr@IntegerLength@Range@Abs@#&. The initial 1 accounts for the digit of 0, while -#~Min~0 accounts for all the negative signs if the input is negative.

Ruby, 20 26  29 bytes
->x{[*x..-1,0,*1..x]*''=~/$/}

Try it online!

Why the increase?

The first version did not work for negative numbers, the second version had a problem with zero as input.

RProgN 2, 5 bytes
n0R.L

Explination
n0R   # A Stack of all numbers between 0 and the input converted to a number.
   .L # The length of the stringification of this.

Simple solution, works like a charm.
Try it online!

PHP, 59 60 bytes
Outgolfed by Roberto06 - https://codegolf.stackexchange.com/a/112536/38505
Thanks to roberto06 for noticing the previous version didn't work for negative numbers.
Simply builds an array of the numbers, puts it to a string, then counts the digits (and minus sign)
<?=preg_match_all("/\-|\d/",implode(",",range(0,$argv[1])));

Run example: php -f 112504.php 8

8 test case
101 test case
102 test case
-10 test case

This doesn't work for a negative input, see here

You could save 3 bytes using join instead of implode because it is an alias.

there is no need to escape the minus -1 Byte. On the other hand you can change your regex to [--9]

Haskell, 39 38 bytes
f 0=1
f n=length$show=<<[0..n]++[n..0]

Try it online! Edit: saved 1 byte thanks to @xnor!
Explanation:
In Haskell for numbers a and b [a..b] is the range from a to b in 1-increments or 1-decrements, depending on whether b is larger a. So for a positive n the first list in [0..n]++[n..0] is [0,1,2,...,n] and the second one is empty. For negative n the second range yields [0,-1,-2,...,n] and the first one is empty. However if n=0 both ranges yield the list [0], so the concatenation [0,0] would lead to a false result of 2. That's why 0 is handled as a special case.
The =<<-operator on a list is the same as concatMap, so each number is converted into a string by show and all those strings are concatenated in one long string of which the length is finally returned.

Before xnor's tip I used [0,signum n..n] instead of [0..n]++[n..0].
 signum n is -1 for negative numbers, 0 for zero and 1 for positive numbers and a range of the form [a,b..c] builds the list of numbers from a to c with increment b. Thereby [0,signum n..n] builds the range [0,1,2,...,n] for positive n and [0,-1,-2,...,n] for negative n. For n=0 it would build the infinite list [0,0,0,...] so we need to handle 0 as a special case, too.

I think [0..n]++[n..0] should do for [0,signum n..n].

Brachylog, 5 bytes
⟦ṡᵐcl

Try it online!
Builds the range [0,input], converts each number to string, concatenates into a single string and returns the length of the result

I noticed TIO has an argument Z; what's up with that? Should it be in the count?

@steenbergh: Leo's submission is a function, not a full program. Giving the argument Z to the Brachylog interpreter tells it to add an appropriate wrapper to make the function testable. (If you ran it as a full program, it wouldn't produce any output.) We allow either program or function submissions here, so that shouldn't count against the byte count, as it's not actually part of the submission.

PHP, 41 35 bytes
Saved 6 bytes thanks to user59178
Since ʰᵈ's answer was wrong for a negative input, I took it upon myself to build a new solution :
<?=strlen(join(range(0,$argv[1])));

This function :

Builds an array from 0 to $argv[1] (aka the input)
Implodes it with an empty character (i.e. transforms it to a string)
Echoes the length of the string

Try it here!

This is a nicer solution to mine, idk why I thought I had to do that preg_match() :(

Well, I wouldn't have thought of range() if it wasn't for your solution, I guess we're even ;)

you can save 3 bytes by using join() instead of implode(). it's an alias for the same thing. http://php.net/manual/en/function.join.php

And 3 more by omitting the 'glue' parameter.

I knew there was an alias for implode, but I didn't know I could omit the gue parameter. Thanks !

R, 26 20 bytes
sum(nchar(0:scan()))
Very basic approach:

Make a vector 0:x
Count the characters in each value (will be coerced to a string automatically)
Sum

Not sure if there are any tricks to cut down the function definition?
6 bytes saved thanks to Giuseppe, by taking input from stdin instead.

you could do sum(nchar(0:scan())) instead and read n from stdin instead.

Lua, 52 bytes
t=0;for i=0,io.read()do t=t+#tostring(i)end;print(t)

Iterates through a for loop from 0 - input, converts the integer i to a string and adds the length of the string to t before printing t

QBIC, 25 bytes
:[0,a,sgn(a)|A=A+!b$]?_lA

Explanation:
:[0,a     Read 'a' from the cmd line, start a FOR loop from 0 to 'a'
,sgn(a)|  with incrementer set to -1 for negative ranges and 1 for positive ones
A=A+!b$   Add a string cast of each iteration (var 'b') to A$
]         NEXT
?_lA      Print the length of A$

MATL, 11 bytes
0hSZ}&:VXzn

Try it online!
0h           % Implicitly input n. Append a 0: gives array [n 0]
  S          % Sort
   Z}        % Split array: pushes 0, n or n, 0 according to the previous sorting
     &:      % Binary range: from 0 to n or from n to 0
       V     % Convert to string. Inserts spaces between numbers
        Xz   % Remove spaces
          n  % Length of string. Implicit display

Batch, 110 bytes
@set/a"n=%1,t=n>>31,n*=t|1,t=1-t*n,i=0
@for /l %%i in (0,1,9)do @set/a"t+=(i-n)*(i-n>>31),i=i*10+9
@echo %t%

Computes sum(min(0,abs(n)+1-10^k),k=0..9)+(n<0?1-n:1). (I only have to go up to 9 because of the limitations of Batch's integer arithmetic.)

Python 2, 68 bytes
def f(i,j=1):
 if i==0:print j
 else:j+=len(`i`);f((i-1,i+1)[i<0],j)

Try it online!
Longer than but different from other Python solutions. Defines a recursive function called as e.g. f(10)

PowerShell, 23 bytes
-join(0.."$args")|% Le*

Try it online! (will barf on TIO for very large (absolute) inputs)
Uses the .. range operator to construct a range from 0 to the input $args (cast as a string to convert from the input array). That's -joined together into a string (e.g., 01234) and then the Length is taken thereof. That is left on the pipeline and output is implicit.

The exact solution I had in my head when I read this question

Perl 6, 18 bytes
{chars [~] 0...$_}

Try it
Expanded:
{  # bare block lambda with implicit parameter ｢$_｣

  chars        # how many characters (digits + '-')
    [~]        # reduce using string concatenation operator &infix:<~>
      0 ... $_ # deductive sequence from 0 to the input
}

JavaScript, 50 bytes
Collaborated with @ETHproductions
n=>{for(t="";n;n<0?n++:n--)t+=n;alert(++t.length)}

Bash + GNU coreutils, 28
eval printf %s {0..$1}|wc -c

Try it online.

Retina, 28 bytes
\d+
$*
1
$`1¶
1+
$.&
^-?
0
.

Try it online!
Explanation
\d+
$*

Convert the number to unary, keeping the sign untouched.
1
$`1¶

Each 1 is replaced by everything up to itself plus a newline. With this we get a range from 1 to n if n was positive, from -1 to n with an additional - at the start if it was negative. All numbers are in unary and separed by newlines.
1+
$.&

Convert each sequence of ones to the corresponding decimal number.
^-?
0

Put a 0 at the start, replacing the extra - if it's there.
.

Count the number of (non-newline) characters.

Emacs, 20 bytes
C-x ( C-x C-k TAB C-x ) M-{input} C-x e C-x h M-=

The command itself is 20 keystrokes, but I need clarification on how this should be counted as bytes. I reasoned that counting each keystroke as 1 byte would be the most fair. The command above is written conventionally for easier reading.
Explanation
C-x (

Begin defining a keyboard macro.
C-x C-k TAB

Create a new macro counter. Writes 0 to the buffer; the counter's value is now 1.
C-x )

End keyboard macro definition.
M-{input} C-x e

After hitting META, type in your input number. The C-x e then executes the macro that many times.
C-x h

Set mark to beginning of buffer (which selects all of the text thus generated).
M-=

Run character count on the selected region. The number of characters will be printed in the minibuffer.
Example
Apologies for the terrible highlighting color. This is an example of using this command with the input 100. The output is in the minibuffer at the bottom of the screen.

Yep, I'm pretty sure one keystroke is one byte.

@NoOneIsHere There are two thoughts I had about that: 1) Can Ctrl+character be represented as a single byte? And 2) I see a lot of answers here counting Unicode chars as one byte, but they are not, so I thought maybe CodeGolf maybe has its own definition of "byte"? Thanks.

I really don't know. But you can ask on Meta.

@cheryllium Some languages use a SBCS that fits a different set of 256 characters in 1 byte than ASCII. You can only count it as 1 byte if there are less than 256 characters to choose from in that language.

Perl 5, 32 bytes
31 bytes of code + -p flag.
$\+=y///c for$_>0?0..$_:$_..0}{

Try it online!

C#, 77 73 bytes
-4 bytes thanks to @Kevin Cruijssen
Lambda function:
(r)=>{var l="";for(int i=0,s=r<0?-1:1;i!=r+s;i+=s)l+=i;return l.Length;};

Ungolfed and with test cases:
class P
{
    delegate int numbers(int e);
    static void Main()
    {
        numbers n = (r) =>
        {
            var l = "";
            for (int i = 0, s = r < 0 ? -1 : 1; i != r + s; i += s)
                l += i;
            return l.Length;
        };
        System.Console.WriteLine(n(8));
        System.Console.WriteLine(n(101));
        System.Console.WriteLine(n(102));
        System.Console.WriteLine(n(-10));
        System.Console.ReadKey();
    }
}

You can change the while to for to save a couple of bytes: (r)=>{var l="";for(int i=0,s=r<0?-1:1;i!=r+s;i+=s)l+=i;return l.Length;}; (73 bytes)

@Kevin Cruijssen You are right, thanks.

You can probably use an int counter and add the length inside the loop to save some bytes. If you compile to a Func<int, int> you can call the functions like r=>... to save 2 bytes (can probably do this anyway).

JavaScript, 44 bytes

f=(n,i=1)=>n<0?f(-n)-n:n<i?1:n+1-i+f(n,i*10)
<input type=number oninput=o.textContent=f(+this.value)><pre id=o>

REXX, 56 bytes
arg n
l=0
do i=0 to n by sign(n)
  l=l+length(i)
  end
say l

Jelly, 6 bytes
r0Ṿ€FL

Try it online!
Jelly's surprisingly bad at this, mostly because it doesn't have a dedicated builtin for stringifying integers; it does have a builtin for stringifying anything, but that means we can't have it autovectorize over lists.
Explanation
r0Ṿ€FL
r0      All numbers from {the input} to 0, inclusive
   €    For each of those numbers numbers:
  Ṿ       Find its string representation
    F   Concatenate the resulting strings
     L  Take the length of the resulting string

The Length builtin doesn't work directly on integers? Preposterous!

Wait, can you use D instead of Ṿ€?

@ETHproductions: No, it doesn't deal with negative numbers correctly.

Ah, got it. And I guess there's no 0-byte way to add 1 to every number if the input is negative :P

JavaScript (Node.js), 37 bytes
f=n=>n?(n+"").length+f(n>0?n-1:n+1):1

Port of my Python answer.
Try it online!

It's not only Node.js though, it should work on any platform that supports ES6.

Yeah, I just used the auto-generated TIO answer.

Oh cool, I didn't notice there was an option to do that :-)

Yep, either with the mouse or by pressing Esc, S, G.

Japt, 4 bytes
ò ¬l

Try it online!
Explanation:
ò ¬l
ò     // Creates a range from [0...Input]
  ¬   // Joins the array into a string
   l  // Returns the length

SQL (PostgreSQL), 76 bytes
SELECT sum(length(a::text))FROM generate_series(least(0,$1),greatest(0,$1))a

This is an SQL function.

SQL! That's a rare one

Java, 211 bytes
interface n{static void main(String[]a){int n=Integer.parseInt(a[0]),k=1,i;a[0]="";if(n<0)k=-1;for(i=0;i!=n+k;i+=k){a[0]+=i;if(i!=n)a[0]+=',';}System.out.print(a[0]);System.exit(a[0].replace(",","").length());}}

Takes number as first command line argument. Returns output as an error code:
Input: -10

0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10
Process finished with exit code 22

Ungolfed version with comments:
interface n {
    static void main(String[]a) {
        int n = Integer.parseInt(a[0]),                 // Input number
        k = 1,                                          // For loop increment
        i;                                              // For loop counter
        a[0] = "";                                      // Empty string
        if(n < 0) k = -1;                               // If input number is negative loop increment is negative
        for(i=0; i != n + k; i += k) {                  // For loop
            a[0] += i;                                  // Append number to string
            if (i != n)                                 // If not the last number
                a[0] += ',';                            // Append comma
        }
        System.out.print(a[0]);                         // Output string
        System.exit(a[0].replace(",","").length());     // Return length of string without commas as error code
    }
}

K, 29 Bytes
I have a feeling there is a better way...
f:{#,/$((+;-)x<0).(0;!1+abs x)}

(+;-)x<0     ---> Call this A. If x is less that 0, return - otherwise return +
(0;!1+abs x) ---> Call this B. A list; (0;the numbers from 1 to the absolute value of x)
A.B          ---> Apply A to B, e.g1. (-).(0;0 1 2) ==> 0 -1 -2 e.g2 (+).(0;0 1 2) ==> 0 1 2
,/$x         ---> $tring x (x is numbers asc or desc) and flatten the list ,/
#x           ---> Finally count the flattened list

Some tests...
  f 8
9
  f 10
12
  f 101
196
  f 102
199
  f -10
22
  f -100
293

{$[x<0;a;0]+#,/$!1+a:abs x} for 27 bytes. Sums up string of 0..abs[input], if input was negative then add the abs[input] as this is the number of - you'd need to print the string.

Clojure, 48 bytes
(count(apply str(range(min 0 %)(max 1(inc %)))))

(defn how-much-to-write? [n]
  ; Count the characters in the resulting string
  (count
    ; Basically "joins" the list with ""
    (apply str
      ; Creates an ascending/descending range, depending on the value of n
      (range (min 0 n) (max 1 (inc n))))))

Scala 75 Bytes
(x:Int)=>{
  val? =Math.abs _
  (0 to?(x))./:("")((a,c)=>a+","+c* ?(x)/x).size-1
}

I'm not sure how I can improve it any further. The Math.abs is really really annoying. I think there is probably a better way to go about doing the negative stuff.

Stacked, 25 bytes
:sign\0\abs|>*''join size

Try it online!
Explanation
:sign\0\abs|>*''join size    stack: (n)
:                            stack: (n n)
 sign                        stack: (n sign[n])
     \                       stack: (sign[n] n)
      0                      stack: (sign[n] n 0)
       \                     stack: (sign[n] 0 n)
        abs                  stack: (sign[n] 0 abs[n])
           |>                stack: (sign[n] range[0, abs[n]])
             *               negates the range if negative
              ''join         said range as a single string
                     size    the desired length

Vyxal, 4 bytes
0ṡṅL

Try it online!
Explanation:
0ṡ    # Range from 0 to n
  ṅ   # Join by nothing
   L  # Get the length of that

APL (Dyalog Extended),  9  6 bytes
⍴∊⍕¨…⎕

Try it online!
-3 thanks to @Adám
Explanation
⍴∊⍕¨…⎕
    …⎕  ⍝ Get the range from 0 to the input
  ⍕¨    ⍝ Convert each to string
 ∊      ⍝ Flatten the list into a single string
⍴       ⍝ And get the length of the string

Old 9-byter:
{⍴∊⍕¨0…⍵}
{       }  ⍝ Create a function:
     0…⍵   ⍝  Get the range from 0 to its argument
   ⍕¨      ⍝  Convert each to string
  ∊        ⍝  Flatten the list into a single string
 ⍴         ⍝  And get the length of the string

6

@Adám nice! Can you just check my explanation?

Yes, that is correct, although I'd describe ∊ and ⍕¨ as two different steps. ⍕¨ converts each number into a string and ∊ flattens.

Thanks, updated.

Is this your first APL answer?

@Adám yes it is

Pyt, 17 15 bytes
Đ±⁺0⇹?ŕ⇹:ŕ;ŘǰąŁ

Try it online!
Đ                   implicit input; Đuplicate
 ±                  get sign
  ⁺                 increment
   0                push 0
    ⇹               swap top two items
     ?              if top of stack is truthy:
      ŕ⇹            ŕemove top of stack; swap top two items
        :ŕ          otherwise: ŕemove top of stack
          ;         either way:
           Ř        Řangify
            ǰ       ǰoin with no delimiters
             ą      convert to ąrray of characters
              Ł     get Łength; implicit print

Javascript, 65 bytes
T=n=>{m=n>0?1:-1,o="";for(i=0;i!=n+m;i=i+m){o+=i}return o.length}

You can save a few bytes like this. https://tio.run/nexus/javascript-node#LcVBCoAgEADAr0QnpQy3UyRrn/AHYSXoLlidor5uEM1lXIWF0F4JyeoJRgUtY12bhbMISE0yQWEy3GCQJvvjzKQe7qKn9djuMjPtHH0XeRVODLKtnAAN//23Ai1leQE

Swift, 72 bytes
let f={i in(min(i,0)...max(0,i)).reduce(0){$0+"\($1)".characters.count}}

The "characters.count" really kills the score.

Retina, 42 41 bytes
-(.+)
$*-¶$1
.+$
$*
\d|$
$%`
(1*)
$.1
.

Try it online!
Explanation
-(.+)
$*-¶$1

If the number is a negative, let's say -n (i.e. there is a - in the input), then replace the input with n -s, and n on the next line. In the end we just want to count the characters, and for -n as input, there will be exactly n - signs in the range.
.+$
$*

Convert the number at the end of string into unary.
\d|$
$%`

Replace any digit character or the end of the string with all the text before it on the same line, plus a space. For a sequence of 1s, this results in  1 11 111 ... up until the original sequence. This builds the range from 0 to n, in unary.
(1*)
$.1

Conversion back to decimal. Any series of 1s followed by a space is replaced with the number of 1s.
.

Count the matches of . and output it. . matches any single character except linefeed.

Pip, 13 12 bytes
#J:^0\,a|a,1

Takes input from command-line argument. Verify all test cases at Try it online!
Explanation
Some weird tricks in this one:
0\,a is the inclusive range from 0 to a.
If a is negative, we want to take the inclusive range from a to 0 instead. A naive approach would be a ternary expression with a<0, but we can do better. The problem is that something like (0,-11) is a perfectly valid Range object and is truthy, even though the range it represents contains no numbers1. We want to convert it to an empty list (falsey).
To achieve this, we apply unary ^ to split the Range into characters. This operator works itemwise, so for example giving it 0\,10 would result in the list [[0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [1 0]]. Splitting into characters won't make a difference to the result, since we're going to join everything together anyway. But crucially, it forces the conversion of the Range into a List. So an input of -10 now results in the empty list [].
Now since [] is falsey, we can take the logical Or of the above with a,1 (i.e. range(a,1), not including the upper bound) and get the elements we want.
Next, we need to join them together. Unfortunately, Join has a higher precedence than Or, so we would need parentheses. But another approach is to modify Join with the compute-and-assign meta-operator : (which is like the = in += in C-like languages, but more flexible). This lowers the precedence of the operator such that parentheses aren't needed. Assigning to an rvalue is a warning, but not an error.
Finally, we take the length (#) of the resulting string, which is then autoprinted.
1 Such "backwards" ranges are used in string slicing, where the negative number means "the index 11 characters from the end."

C++ 102 Bytes
int f(int n){int o=0;std::string s;for(n=n<0?o=-n:n;n>=0;)s+=std::to_string(n--);return s.length()+o;}

Ungolfed
int f(int n)
{
    int o=0;
    std::string s;
    for(n=n<0?o=-n:n;n>=0;)
        s+=std::to_string(n--);
    return s.length()+o;
}

Will add explanations.

Suggest int o=n<0?(n=-n):0;std::string s;for(;n>=0;) instead of int o=0;std::string s;for(n=n<0?o=-n:n;n>=0;)

Pyth, 6 5 bytes
ljk}0Uses ais523's Jelly algorithm, except that the range starts from 0.
Thanks to RK. for -1.

You could get rid of the M by just doing ljk}0

@RK. And I knew there is a shorter way than s\M`!

that's the feeling, right?

CJam, 15 bytes
ri_g\z),f*:`:+,

Try it online!
Explanation:
ri_g\z),f*:`:+, e# Accepts an integer from STDIN.
ri              e# Get integer from STDIN.
  _g\           e# Store the integer's sign behind it.
     z)         e# Take the absolute value and increment it, to make an
                e# implicit range.
       ,        e# Create range [0..N].
        f*      e# Multiply every integer in the range with the sign we
                e# stored earlier, so as to include the - signs.
          :`    e# Map repr.
            :+  e# Concatenate.
              , e# Length.

J, 20 bytes
(#":i.1+|p)-(p+|p)%2

Welcome to PPCG! By default, all answers to code golf challenges must be full programs or functions. Taking input from predefined varibales is not allowed.

Sorry, I was unaware, I'll correct it as soon as I figure out a compact valid method.

PHP, 38 35 bytes
<?=strlen(join(range(0,$argv[1]))); // 35 bytes
<?=strlen(join("",range(0,$argv[1]))); // 38 bytes

Useage: php file.php 8
The join is a little used alias of implode(), and php can easily join numbers together as a string. Titus commented that the glue isn't needed in join() if you want a empty string.

Save three bytes: The glue parameter for join is optional (see codegolf.stackexchange.com/a/86340/55735 and http://php.net/implode).

Java 8, 80 bytes
Golfed:
n->{String r="";for(int i=0;i<=(n<0?-n:n);++i)r+=i;return r.length()-(n<0?n:0);}

Ungolfed:
public class HowMuchDoIHaveToWrite {

  public static void main(String[] args) {
    for (final int[] test : new int[][] { { 8, 9 }, { 101, 196 }, { 102, 199 }, { -10, 22 } }) {
      final int input = test[0];
      final int expected = test[1];
      final int actual = q(n -> {
        String r = "";
        for (int i = 0; i <= (n < 0 ? -n : n); ++i) {
          r += i;
        }
        return r.length() - (n < 0 ? n : 0);
      } , input);
      System.out.println("Input:    " + input);
      System.out.println("Expected: " + expected);
      System.out.println("Actual:   " + actual);
      System.out.println();
    }
  }

  private static int q(java.util.function.IntFunction<Integer> f, final int input) {
    return f.apply(input);
  }
}

Pascal, 146 Bytes
This is a complete program requiring a processor supporting Extended Pascal, ISO standard 10206, features.
The number 20 may need to be adjusted but is sufficient for maxInt = 263 − 1.
program p(input,output);var s:string(20);i,n:integer;begin n:=0;read(i);for i in[i..0,0..i]do begin writeStr(s,i:1);n:=n+length(s)end;write(n)end.

Ungolfed:
program howMuchDoIHaveToWrite(input, output);
var
    temporaryPrint: string(20);
    i, totalLength: integer;
begin
    totalLength := 0;
    read(i);

    { The `[i..0, 0..i]` denotes a `set` constructor literal.
      This eliminates the issue of taking account `0` twice.
      The ranges `i..0` and `0..i` are (inside a set constructor)
      shorthand for all integral values within the intervals. }
    for i in [i..0, 0..i] do
    begin
        { The `:1` specifies the _minimum_ width.
          If omitted, a processor-defined default
          will be assumed. This could be, e. g. 20. }
        writeStr(temporaryPrint, i:1);
        totalLength := totalLength + length(temporaryPrint)
    end;

    write(totalLength)
end.

135 Bytes:
Since n, the totalLength variable, is an integer, it is limited to values in the range −maxInt..maxInt, thus n := n + length(s) will never (without an error) exceed maxInt.
We can deduplicate this information by using string(maxInt) as the temporaryPrint variable data type.
program p(input,output);var s:string(maxInt);i:integer;begin s:='';read(i);for i in[i..0,0..i]do writeStr(s,s,i:1);write(length(s))end.

Excel, 40 bytes
=SUM(LEN(SEQUENCE(ABS(A1))*-1^(A1<0)))+1

Input in cell A1.

C#, 59 76 bytes
n=>string.Concat(System.Linq.Enumerable.Range(n>0?0:n,(n<0?-n:n)+1)).Length;

Longer than I wanted it to be because of the minus and Range takes a start and a count not start and end.

Python, 63 bytes
lambda n:sum(map(len,map(str,range(*[[0,n-1,-1],[n+1]][n>0]))))

GolfScript, 33 bytes
~.abs),\.{.abs/}0if:S;{S*`,}%{+}*

Try it online!
Explanation:
~.abs),\.{.abs/}0if:S;{S*`,}%{+}* # Evals STDIN.
~                                 # Eval.
 .abs),\                          # Store an absolute value inclusive range behind the original integer.
        .{.abs/}0if:S;            # Store the integer's sign in S.
                      {S*`,}%     # After applying the input's sign, get the length of the string representation of every integer in the range.
                             {+}* # Sum.

Bean, 44 bytes
xxd-style hexdump:
00000000: 2653 4da0 6280 40a0 7852 a043 ccd0 80cc  &SM b.@ xR CÌÐ.Ì
00000010: a043 8b23 0020 8001 8b53 a062 4da0 4382   C.#. ...S bM C.
00000020: 53d0 80a0 1f20 8048 2043 253a            SÐ. . .H C%:

Equivalent JavaScript (adapted from @Dennis) (45 bytes):
(f=_=>A?(A+"").length+f(A-=Math.sign(A)):1)()

Explanation
Declares a recursive IIFE (immediately invoked function expression) f, using pre-initialized variable A with numeric input to count down and incrementally calculate the amount of characters in the range of numbers.
Try the demo here

Thunno 2 JL, 1 byte
Ė

Attempt This Online!
Thunno 2, 3 bytes
ĖJl

Attempt This Online!
Explanation
     # Implicit input
Ė    # Push [0..input]
 J   # Join into string
  l  # Push length
     # Implicit output

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Making Music Boxes
Your task is to take a sequence of characters (the music) as input (in a function or program), and print (or return) the music as it would look like in a music box.
You will only receive the characters ABCDEFG.() as input, and the input will never be empty. You may also receive the letters in lowercase, if you wish for it.
This is an empty music box, of length 3:
.......
.......
.......

As you can see, the lines are 7 characters long, and since the length of the music box is 3, we have 3 lines. There are only .s here, since the music box is empty. Let's put some music in it!
First, we create the music box. In this example, the input will be CDAG.DAG.
The length of CDAG.DAG is 8, so we need a music box of length 8:
.......
.......
.......
.......
.......
.......
.......
.......

Then, we read the input, one character at a time, and place an O at its respective position.
The first character is C, and the location of each note is equivalent to this (I added spaces for clarity):
 A B C D E F G
 . . . . . . .
 . . . . . . .
 (and so on)

If the input character is a ., then we just print an empty line .......
So, the C would be the 3rd character along. Let's put it in our music box at the top:
..O....
.......
.......
.......
.......
.......
.......
.......

We will repeat this process for all the other characters (the text in brackets is just to show you the note, you shouldn't output that):
..O.... (C)
...O... (D)
O...... (A)
......O (G)
....... (.)
...O... (D)
O...... (A)
......O (G)

Because of how music boxes work, if we use a character other than O, . and <insert newline here>, such as a space, in our output, then it won't play the correct music!
This is a chord:
(ACE)

This chord is instructing us to play the notes A, C and E at the same time. There will never be a pause (ie a .) in a chord.
This is how it would be written:
O.O.O...

And this is how it might appear in music: B(ACE)D
You will never receive a chord in a chord, ie this won't be valid: (AB(CD)EF) or this: A(B()), and chord will not be empty, ie this won't be valid: A()B
You will never receive an invalid input.
Examples:
B(ACE)D

.O.....
O.O.O..
...O...

B

.O.....

GGABC

......O
......O
O......
.O.....
..O....

...

.......
.......
.......

A..F.C(DA).

O......
.......
.......
.....O.
.......
..O....
O..O...
.......

.(ABCDEF)

.......
OOOOOO.

Trailing/leading whitespace on the output is permitted.
As this is code-golf, the shortest code wins!

can a music string contain () twice (e.g: AB(CD)E(FG)) ??

@Mr.Xcoder Yes, it can.

Can the output be a list/array of characters?

@Rod sure, as per PPCG standards

Are we guaranteed to not get two of the same note in the same chord?

@BasicSunset Yes.

In a language where a list of characters counts as a string, can we take input as a nested list, such as {B, {A, C, E}, D} for your first example?

@GregMartin No, I don't that would be vaid.

Can input be (B) instead of B?

@l4m2 No, it cannot.

Wintergatan should use this for the Marble Machine X

Pip, 29 bytes
28 bytes of code, +1 for -l flag.
'.X7RA_'OMz@?a@`\(\w+.|.`@XL

Takes input in lowercase as a command-line argument. Try it online!
Explanation
                              a is 1st cmdline arg; XL is `[a-z]`; z is lowercase alphabet
             a@`\(\w+.|.`     List of all matches in a of this regex:
                               Either a ( followed by letters followed by another
                               character (i.e. the closing paren), or any one character
                         @XL  For each of those matches, a list of all matches of this
                               regex (effectively, split the match into a list of
                               characters and keep only the lowercase letters)
          z@?                 Find index of each letter in the lowercase alphabet
         M                    To that list of lists of indices, map this function:
'.X7                           Take a string of 7 periods
    RA_                        and replace the characters at all indices in the argument
       'O                      with O
                              Finally, autoprint the resulting list, with each item on
                              its own line (-l flag)

Here's a sample of how an input is transformed:
"b.(ceg)"
["b" "." "(ceg)"]
[["b"] [] ["c" "e" "g"]]
[[1] [] [2 4 6]]
[".O....." "......." "..O.O.O"]

Python 2, 95 94 bytes
-1 byte thanks to Value Ink
x=1
for i in input():
 if x:o=['.']*7
 if'@'i:x=i>'('
 if x:print o

Try it online! or Try all test cases
Explanation
'@'i is to check if i is a parenthesis, if it is x=i>'(' will put 0 on x to prevent the printing/clearing of o, when i==')', it will put 1 on x re-enabling the printing/clearing of o.
When i=='.' nothing will be changed, and '.......' will be printed.
The charater order is given by their ASCII code, where '('<')'<'*'<'.'<'@'<'A'

oh i missed that comment. nvm.

Ditch the comma: ['.']*7. Perhaps it's a holdover from when you were using a tuple, which would require the comma. Also, I might be wrong, but this seems to output an array ['O', '.', '.', '.', '.', '.', '.'] per line, and I'm not sure if that's allowed?

@ValueInk yep, OP allowed

You mentioned the byte change and changed your TIO link but the code listed on your post is still the same :V

@ValueInk ¯\(ツ)/¯

Batch, 209 bytes
@set s=%1
@set p=)
@for %%n in (a b c d e f g)do @set %%n=.
:g
@if %s:~,1% lss @ (set "p=%s:~,1%")else set %s:~,1%=O
@set s=%s:~1%
@if %p%==( goto g
@echo %a%%b%%c%%d%%e%%f%%g%
@if not "%s%"=="" %0 %s%

Works by accumulating letters and outputting the line if the last symbol seen was not a (.

Röda, 97 78 76 bytes
{search`\(\w+\)|.`|{|c|seq 65,71|{|l|["O"]if[chr(l)in c]else["."]}_;["
"]}_}

Try it online!
It's an anonymous function that reads the input from the stream. Use it like this: main { f={...}; push("ABCD") | f() }. It uses the regex from ETHproductions' answer.
Ungolfed:
{
    search(`\(\w+\)|.`) | for chord do
        seq(ord("A"), ord("G")) | for note do
            if [ chr(note) in chord ] do
                push("O")
            else
                push(".")
            done
        done
        push("\n")
    done
}

Previous answer:
f s{(s/"(?=([^()]*(\\([^()]*\\))?)*$)")|{|c|seq 65,71|{|l|["O"]if[chr(l)in c]else["."]}_;["
"]}_}

Try it online!
It works by splitting the given string at places where the string following contains only matched parentheses. Then, for each chord, it iterates through possible notes and print O if the note is a member of the chord and . otherwise.

JavaScript (ES6), 86 85 76 bytes
Saved 9 bytes thanks to @Neil

let f =
s=>s.replace(r=/\(\w+\)|./g,x=>`ABCDEFG
`.replace(r,c=>x.match(c)?"O":"."))
<input oninput="if(/^([A-G.]|\([A-G]+\))+$/.test(value))O.textContent=f(value)">

Explanation
First, we match what will form each line of the output: chords, and chars that aren't part of a chord. Then, for each line, we take the string ABCDEFG\n and replace each non-newline character in it with an O if the line contains it, and a . otherwise.

If a trailing newline is acceptable, you can save 8 bytes using s=>s.replace(r=/\(\w+\)|./g,x=>\ABCDEFG\n`.replace(r,c=>x.match(c)?"O":"."))`.

@Neil Wow, that's amazing :-)

Huh, now that I measure it again, it should be a 10 byte saving...

Can \) be . ?

JavaScript (ES6), 118 116 114 bytes
f=([c,...t],s)=>c?((s?0:x=[...'.......'],c='ABCDEFG)('.indexOf(c))>6?c-7:(x[c]='O',s))?f(t,1):x.join``+`
`+f(t):''

Test cases

f=([c,...t],s)=>c?((s?0:x=[...'.......'],c='ABCDEFG)('.indexOf(c))>6?c-7:(x[c]='O',s))?f(t,1):x.join``+`
`+f(t):''

console.log(f("B(ACE)D"))
console.log(f("GGABC"))
console.log(f("..."))
console.log(f("A..F.C(DA)."))
console.log(f(".(ABCDEF)"))

Ruby, 78 75 71 bytes
->x{x.scan(/\(\w+\)|./).map{|x|l=?.*7
x.bytes{|x|x>47?l[x-65]=?O:1};l}}

Returns an array of strings.
Ungolfed + explanation
def boxes string
  string.scan(/\(\w+\)|./)    # Split the string into an array of chords.
  .map do |chord|             # Replace each chord with...
    line = '.' * 7            # a line, where by default each character is a '.',
    chord.bytes do |note|     # but for each note in the chord...
      if note > '.'.ord       # (if it is in fact a note and not a dot or paren)
        line[note-65] = 'O'   # replace the corresponding dot with an 'O'.
      end
    end
    line
  end
end

Try x.gsub(...){l=?.*7;$&.bytes{...};l+$/} (swap scan with gsub, remove map, and skip the first |x| since you can use $& to access the last regex match) to save 3 bytes and return a multi-line string instead. (Also $/ maps to a newline by default.)

APL (Dyalog Unicode), 30 bytes
'.O'[⍉(⍳7)∘.∊⍎⍕⎕A⍳@(~∊∘'()')⎕]

Try it online!
Only 1b off the Pip solution, what a shame!
Explanation
'.O'[⍉(⍳7)∘.∊⍎⍕⎕A⍳@(~∊∘'()')⎕]   ⍝
                            ⎕    ⍝ Read input. For below examples, this starts at '(AC).D'
               ⎕A⍳               ⍝ Converts to the index (⍳) of the alphabet (⎕A)...
                  @              ⍝ ... For characters which are...
                   (~∊∘'()')     ⍝ ... Not (~) an element (∊) of '()'. Characters outside the alphabet (e.g. dots) will get index 26
                                 ⍝ e.g. '(AC).D' -> ( 0 2 ) 26 3
              ⍕                  ⍝ Convert the mixed array (numerics and characters) to characters (⍕)
             ⍎                   ⍝ Evaluate this string. This abuses the remaining brackets to work as groups, e.g. ( 0 2 ) 26 3 -> three array elements (0  2) 26 3
          ∘.                     ⍝ For each element, compute the outer product of...
      (⍳7)                       ⍝ Each number 0-6...
            ∊                    ⍝ ... vs a boolean of whether this integer is contained in the corresponding vector. Result is a boolean matrix
     ⍉                           ⍝ Transpose this matrix. The result is now in the correct shape with 1 where 'O' needs to be and 0 where a '.' needs to be
'.O'[                        ]   ⍝ For each element of the boolean matrix, treat it as an index of the string '.O'. This will turn 1 into 'O' and 0 into '.'

You can save a byte by switching to Dyalog APL Extended and replacing ∘.∊ with ∊⍀. Try it online!

Perl,  87 71 45 + 2 (-nl flag) = 47 bytes
#!/usr/bin/env perl -nl
use v5.10;
say map$&=~/$_/i?O:".",a..g while/\(\w+\)|./g

Using:
perl -nlE 'say map$&=~/$_/i?O:".",a..g while/\(\w+\)|./g' <<< "A..F.C(DA)."

Try it on Ideone.

PHP, 171 bytes
preg_match_all('#[A-G\.]|\([A-G]+\)#',$argv[1],$m);foreach($m[0]as$l){if($l=='.')echo".......";else foreach([A,B,C,D,E,F,G]as$a)echo strpos($l,$a)!==false?O:'.';echo"\n";}

Breakdown :
preg_match_all('#[A-G\.]|\([A-G]+\)#',$argv[1],$m); // Matches either one character in the range [A-G.] OR multiple [A-G] characters between parentheses
foreach($m[0]as$l)                                  // For each match :
    if($l=='.')                                     //   If no note is played
        echo".......";                              //     Echo empty music line
    else                                            //   Else
        foreach([A,B,C,D,E,F,G]as$a)                //     For each note in the [A-G] range
            echo strpos($l,$a)!==false?O:'.';       //       Echo O i the note is played, . if not
    echo"\n";                                       //  Echo new line
}

Try it here!

Retina, 120 bytes
O`(?<=\([^)]*)[^)]
T`L.`d
(?<=\([^)]*)\d
$*x
\)
m¶
+`\b(x+) \1(x+) m
$1 m$2
 m?x

T`x m(`.\O_
\d
$*.O¶
¶
6$*.¶
%7>`.

I'm sure there's room for golfing, but it works now, so I'll try to golf it more later.
Try it online!
How it works
Basically, the program works by changing each character to a number, then assigning a O to that position in a line. It maps ABCDEFG. to 01234569.
To generate the single note lines, all that has to be done is to put an O after the corresponding number of .s, then pad out the line to 7 characters long.
However, the chords are a bit trickier to do. A similar process is used, but the numbers have to be translated to increments, i.e. the first note in the chord is (whatever), the second is X positions after the first, the third is Y positions after that, etc.
Code
O`(?<=\([^)]*)[^)]

Start out by sorting all characters within chords.
T`L.`d

Perform the transliteration (mapping) from letters to numbers.
(?<=\([^)]*)\d
$*x

Replace all digits within brackets with a unary representation (using xs), followed by a space.
\)
m¶

Replace all closing brackets with m followed by a newline. The m will be used as a marker of sorts for the coming loop:
+`\b(x+) \1(x+) m
$1 m$2

This is a replacement stage that loops until it can't replace anymore. It takes the last two sequences of xs before an m, and subtracts the first from the second, moving the m back. The marker m is needed because it has to perform this operation from right to left.
 m?x

Remove the first x in each sequence except the first one.
T`x m(`.\O_

Transliterate by replacing x with ., space with O, and deleting m and (.
At this point, all the lines for the chords have been created. Now the single-note lines have to be created.
\d
$*.O¶

Replace each digit with that many .s, followed by an O and a newline.
¶
6$*.¶
%7>`.

Pad each line to length 7 by adding .s to the right. This works by adding 6 .s to the end of each line (each line will have at least 1 other character), then replacing every character after the first 7 on each line with nothing. (Since . maps to 9, the O will be cut out on those lines)

Retina 0.8.2, 52 bytes
\(\w+\)|.
abcdefg$&¶
+`([a-g])(.*)\1
O$2
T`().l`___.

Try it online! Takes input in lower case. Explanation:
\(\w+\)|.
abcdefg$&¶

Split the music into chords or notes, and start building the output by adding the list of note equivalents.
+`([a-g])(.*)\1
O$2

For each note in each chord, change the output to an O and delete the note from the chord.
T`().l`___.

Delete all the now extraneous music, and change all the unmatched notes to empty.

05AB1E, 24 bytes
žuS¡2Å€S}˜ε'.7×AySkv'Oyǝ

Input with lowercase letters; output as a list of lines.
Try it online or verify all test cases. (The ]» in the footer is used to pretty-print the output by joining with newlines. Feel free to remove it to see the actual output-list.)
Explanation:
žu                       # Push builtin string "()<>[]{}"
  S                      # Convert "()<>[]{}" to a list of characters
   ¡                     # Split the (implicit) input by these characters
                         # (NOTE: If the input starts with a "("
                         #  the first item will be an empty string)
    2Å€ }                # For every item at a 0-based index that is divisible by 2:
       S                 #  Convert the string to a list of characters
         ˜               # Flatten the list
          ε              # Map each item to:
           '.7×         '#  Push a string with 7 "."s: "......."
               A         #  Push the lowercase alphabet
                y        #  Push the current item we're mapping over
                 S       #  Convert it to a list of characters
                  k      #  Get the index of each in the alphabet (-1 if it's a ".")
                   v     #  Loop over those indices:
                    'O  '#   Push an "O"
                      yǝ #   Insert it in the "......." string at the current index
                         #   (`ǝ` doesn't work with -1, but still pops the "O" and -1)
                         # (after which the resulting list of lines is output implicitly)

Perl 5 - 78 + 1(flag) + 2(Input Quotes) = 81 Bytes
for(;/(\([a-g]+\)|[a-g\.])/g;){$i=$1;print$i=~/$_/?'o':'.'for(a..g);print"\n"}

Can be run like so:
perl -n <name of file holding script> <<< <input in quotations>

Don't you think that the input in quotes would count as 2 extra bytes? I may be wrong, as there may be a meta consensus on this stating otherwise.

@Okx updated my bytecount.  Wasn't sure if it added to it, still kinda new here :)

Ruby, 68 bytes
->s{w=?.*m=7
s.bytes{|i|i>64?w[i-65]=?O:m=i!=40;m&&(puts w;w=?.*7)}}

The idea is to modify the string ....... every time we find a letter, then output and reset it, but only when we are outside brackets. ( switches the outputting off. ) and . both switch/leave the outputting on, but the latter is inconsequential as it will never be found inside a bracket.
Ungolfed in test program
f=->s{w=?.*m=7              #set m to a truthy value (7) and w to seven .'s
  s.bytes{|i|               #for each byte in the string
    i>64?w[i-65]=?O:m=i!=40 #if a letter, modify the appropriate character of w ELSE set m to false if inside brackets, true otherwise.
    m&&(puts w;w=?.*7)      #if m is true, output the contents of w and reset to seven .'s
  }
}

p 1
f["B(ACE)D"]
p 2
f["B"]
p 3
f["GGABC"]
p 4
f["A..F.C(DA)."]
p 5
f[".(ABCDEF)"]

Python 3, 94 bytes
An anonymous function
import re
lambda s:[''.join('.O'[c in x]for c in'ABCDEFG')for x in re.findall(r'\(\w+\)|.',s)]

Haskell, 101 bytes
c#s|elem c s=c|1<3='.'
s?r=map(#s)"ABCDEFG":p r
p('(':r)|(x,_:t)<-span(')'<)r=x?t
p(x:r)=[x]?r
p e=[]

Try it online! Usage: p "AB.(CA)D". Returns a list of strings.
Explanation:
The function p recurses over the string. If it finds an opening bracket '(' then (x,_:t)<-span(')'<)r partitions the rest string r into the strings x before the occurrence of the closing bracket ')' and t after it. Otherwise the current character x is turned into a string [x]. In both cases the function ? is called with the current string of notes and the rest string.
? maps the function # over the string "ABCDEFG", where # replaces all chars that are not in the current string of notes with '.'. The resulting music box line is prepended to the recursive call of p on the rest list r.

PHP, 93 bytes
for($s=$t="
.......";$c=ord($argn[$i++]);$d||$s=$t.!print$s)$c<65?$c-46&&$d=~$c&1:$s[$c&7]=O;

Run as pipe with -nR or try it online.
breakdown
for($s=$t="\n.......";      // init
    $c=ord($argn[$i++]);    // loop through characters
    $d||                        // 2. if chord flag is unset
        $s=$t.!print$s)             // then print and reset chord
    $c<65                       // 1. if not note
        ?$c-46                      // and not dot
            &&$d=~$c&1              // then set or clear chord flag
        :$s[$c&7]=O             // else set note in chord
    ;