Since $7$ is prime and there is no $7$-note signature that sums to $12$ with all $7$ steps identical, we don't have to worry about periodicity; we can just divide by $7$ in the end. Thus, we just have to count the number of ways of distributing $12-7=5$ balls into $7$ bins with capacity $3-1=2$. There are $\binom75=21$ ways to have $5$ steps of $2$, $\binom7{1,3,3}=140$ ways to have $3$ steps of $2$ and $1$ step of $3$, and $\binom7{2,1,4}=105$ ways to have $1$ step of $2$ and $2$ steps of $3$, for a total of $21+140+105=266$ scales in $266/7=38$ cyclically inequivalent types.
In the present case, inclusion-exclusion would be a bit of an overkill, but since you said you'd like a method that generalises to any number of notes with any number of maximum steps, let's generalise: For $k$ notes with a maximum of $m$ steps that sum to $12$, we want to distribute $12-k$ balls into $k$ bins with capacity $m-1$. As explained at Balls In Bins With Limited Capacity, inclusion-exclusion yields a count of
$$
\sum_{t=0}^{12-k}(-1)^t\binom{12-k}t\binom{12-k+k-tm-1}{12-k-1}=\sum_{t=0}^{12-k}(-1)^t\binom{12-k}t\binom{11-tm}{11-k}\;,
$$
where, contrary to convention, binomial coefficients with negative upper index are taken to be zero. For the present case of $k=7$, $m=3$, this again yields
$$
\sum_{t=0}^7(-1)^t\binom7t\binom{11-3t}6=\binom{11}6-\binom71\binom86=266
$$
signatures. If $k$ isn't prime, or if it divides $12$, then you have to do a bit more to deal with periodicity; otherwise, you can just divide the above result by $k$.
I'm going to write a formula $H(a, b, n, p)$ for the number of items congruent to $n$, modulo $p$, in the interval $a \le k < b$. If you want to apply it to get the answer to the question you've asked, you need to evaluate $H(a, b+1, n, p)$ to get the sum to be inclusive on both ends. I'm assuming here that $b \ge a$.
Furthermore, I'm going to use the computer-scientist's convention that
$$
(x, y) \mapsto x \bmod y
$$
is a function defined on pairs of integers, where $y$ must be positive, and that the value of this function is the number in the range $0, 1, \ldots, y-1$ that is congruent to $x$, modulo $y$.
Observe that for any $a, b, n, p$, and $s$ we have
$$
H(a, b, n, p) = H(a-s, b-s, n-s, p),
$$
so picking $s = a$, we can simply compute our answer by computing
$$
H(a-a, b-a, n-a, p) = H(0, b-a, n-a, p).
$$
Next observe that if we adjust $n-a$ by some multiple of $p$, the answer remains the same, so if we say $n' = (n-a) \bmod p$, then we only need to compute
$$
H(0, b-a, n', p)
$$
and now $n'$ is a number between $0$ and $p-1$. To simplify a little more, let's write $b' = b-a$, so we seek to compute
$$
H(0, b', n', p).
$$
In any span of $p$ sequential integers, there's ONE that's congruent to $n'$, so let's look at how many such spans there are, starting at $0$, and stopping while still less than $b'$. That's exactly
$$
U(b', p) = \lfloor \frac{b'}{p} \rfloor.
$$
What's left over is a sequence of fewer than $p$ numbers from $pU(b', p)$ to $b'$, in which there might or might not be a number congruent to $n'$. Taken $\bmod p$, this sequence looks like
$$
0, 1, 2, \ldots, (b'-1) \bmod p
$$
and we need to add one to our tally exactly if one of those numbers is $n'$. In short, we get
$$
H(0, b', n', p) = U(b', p) + \begin{cases}
1 & n' < (b' \bmod p) \\
0 & n' \ge (b' \bmod p)
\end{cases}.
$$
Replacing this with the original values, we get
$$
H(a, b, n, p) = \lfloor \frac{b-a}{p} \rfloor +
\begin{cases}
1 & (n \bmod p) < ((b-a) \bmod p) \\
0 & (n \bmod p) \ge ((b-a) \bmod p)
\end{cases}.
$$
It's possible that there's some nice way to simplify this a little bit, but...I think I've said enough.
Best Answer
For the intervals part, I think that by definition the number-name of the interval is simply the distance, the difference $\;y-x\;$, between scale steps $\;x\;$ and $\;y\;$.
Only with two complications: Intervals are numbered starting from $1$, not $0$; and sometimes one doesn't want to distinguish between a sixth, a 13th, or an inverted third.
That leads to the $\;+1\;$ and the $\;\text{ mod }7\;$ in the formula from the earlier answer $$ I(x,y) \;=\; (y-x)\text{ mod }7 + 1 $$
Now for the quality, I have found the following.
First, we calculate the number of fifths in the interval, which is $\;F(y) - F(x)\;$, where $$ F(x) = 2m - \left\lfloor (m+4)/7 \right\rfloor\times7 - \left\lfloor m/7 \right\rfloor\times7 \text{, where } m = x-1 $$ is the number of fifths (modulo octaves) from the tonic to $\;x\;$. (Note that $\;\left\lfloor \dots/7 \right\rfloor\times7\;$ rounds down to the nearest multiple of $7$.)
Then the quality is $$ Q(x,y) = h(k) - h(-k) \text{,} \\ \text{where } k = F(y) - F(x) \\ \text{ and } h(k) = \max(0, \left\lfloor (k+8)/7 \right\rfloor) $$ where the quality is encoded as
There is more behind this, but I cannot expand on that now. For now, suffice it to say that $\;h(k)\;$ indicates how 'major' the $\;k\;$-fifths interval is; and a perfect interval is, in some sense, one that is both major and minor.