News:

PsrStyles.com
- Download Styles and Expansion Packs

Main Menu

Why is volume up to 127?

Started by jcm2016, October 29, 2021, 06:23:00 PM

Previous topic - Next topic

jcm2016

It seems like an odd number.  I appreciate that anything is arbitrary and what really matters is how a volume is relative to what else is happening.  But still,y inner desire for order wants these to be up to 100 - no more, no less!

MikeS

A keyboard is a computer and a computer uses 8, 16, 32 or 64 bits to represent numbers. With 8 bits, an integer number can range from -128 to +127. For an unsigned integer the range is 0 to 255. If using integer the range would be 0 to 127 as -ve volume is meaningless.

Alternatively just working on the numbers of bits

With 8 bits the range is 0 - 255 or -128 to +127- wide range
7 bits 0 - 127 or -64 to +63.
6 bits 0 - 63 - or -32 to +31 - getting too narrow.

Limiting the volume rage to 0 - 100 still requires 7 bits or 8 bits and would require additional processing overhead.

Al Ram

MikeS
Very elegant explanation . . . . . . that makes complete sense.  I would not have thought about it that way.

JCM
Excellent and very interesting question, with deep connotations and almost philosophical even  !!!  Like why is the sky blue ?

Just to complement MikeS very good explanation, the 127 value is not at all arbitrary. It only seems arbitrary because we are used to think numbers in multiples of ten . . . .most or many of us grew up using a base 10 numeral system where each digit can have a value from 0 to 9. However, there are other numeric systems with different base, like binary that uses only two values: 0 and 1, or octal [8]; hexadecimal [16], etc. 

In the early days of computer development, it turned out that a binary system was almost natural because the state of an electric cable can be either on or off, therefore 0 or 1.

Hexadecimal is also used quite a bit. 

So, it all depends on what we are used to.   In fact at first, the English measurement system used in many Countries seemed very complicated to me because it is not base 10 like the decimal system i grew up with.

The measure units such as inch, foot, yard, mile, pound, etc seemed very strange to me, overly complicated and extremely difficult to understand, but that is only because i did not grow up with it and therefore was not used to it.   i am not criticizing it at all and apologize in advance if anyone takes issue with my comments.  I know that it makes perfect sense for the millions of people that use it everyday and I now understand it better, although sometimes struggle with it's multiples . . . . .

So you are not alone there. LOL

and in case you would now wonder why the value explained by MikeS would range from -128 to +127

. . . . . a byte = 8 bits ..... 1 bit is binary and could be 0 or 1 in value

Therefore the 0,1 range value of one byte for each of the 8 bits is shown below . . .  .

Starting from all zeros and going up for positive numbers and down for negative numbers

01111111 = +127
01111110 = +126
01111101 = +125
...
00000001 = +1

00000000 =  0


11111111 = -1
...
10000010 = -126
10000001 = -127
10000000 = -128

Sorry if the complement went longer than i was planning . . . . just trying to help and the topic is very interesting to me . . . . .

Thanks and have a great day all.

p.s. i had to refresh my memory by double checking some of the info by using google . . . . it's been too many years since i learned/used this info for any practical purposes.

AL
San Diego/Tijuana

overover

Quote from: jcm2016 on October 29, 2021, 06:23:00 PM
It seems like an odd number.  I appreciate that anything is arbitrary and what really matters is how a volume is relative to what else is happening.  But still,y inner desire for order wants these to be up to 100 - no more, no less!

Hi jcm2016,

A keyboard is controlled internally by MIDI. And here you usually work with the value range 0 ... 127. This applies, for example, to all MIDI controllers ("Control Change", "CC") such as Bank Select MSB and LSB (CC 0 and CC 32), Channel Volume (CC 7), Expression (CC 11) or for the Program Change values. The internal Part Volume values, e.g. "Volume(Style)Offset", also work with this value range, of course.

If you are a little closer with the topic "MIDI", you will find that the value range 0 ... 127 almost everything determines. :)


Best regards,
Chris
● Everyone kept saying "That won't work!" - Then someone came along who didn't know that, and - just did it.
● Never put the Manual too far away: There's more in it than you think! ;-)

Toril S

And now I have a headache😀😀 Interesting subject.!
Toril S

Genos, Tyros 5, PSR S975, PSR 2100
and PSR-47.
Former keyboards: PSR-S970.

https://www.youtube.com/channel/UCLVwWdb36Yd3LMBjAnm6pTQ?view_as=subscriber



Toril's PSR Performer Page

jcm2016

Thanks everyone, very interesting stuff.   

I would guess in principle that nowadays the info below could be kept in the background and that the actual volume settings could be calibrated to 1-100 for the metric among us.  Do things remain on 1-137 for legacy reasons?  Meaning people that have things setup and calibrated going back multiple generations of keyboards, so a cosmetic change would mess up lots of people, and only satisfy my desire for a metric approach?!



andres_fprado

The isue is a bit more... complicated... In fact, using a linear scale (whether from 0 - 127 or 0 - 100 is irrelevant) is not a good choice for volume. Perceptually, we "feel" volume in a logarithmic fashion, and therefore a logarithmic scale (typically in dB - decibel) would be the best choice. And this wouldn't be a 0 - 100 scale, either. It would probably be something like 0 dB for "standard" volume, up to, let´s say, 20dB for some gain, and then down to minus infinity for complete attenuation...

But the fact is, these values were defined by the MIDI standard, based on binary representations of numbers, many years ago. At that time, the definitions had to contend with several tradeoffs: keep it simple, as processors didn't have much computing power (a logarithm was completely out of the question), keep it small (few bits) to minimize transmission time (MIDI used a very slow transmission speed... by today's standards. At the time, it was cutting edge!). Therefore, MIDI is based on 8-bit representation for everything, but using one bit to differentiate between commands (like "note played") and values (like which note was played). Therefore, everything ended up limited to the 7-bit binary value range: 0 - 127 (or -64 to +63 for signed values). This is simply a consequence of the binary system used by computers, and the number of bits assigned, and has nothing to do with specific units of measurement. This impacts everything in MIDI: note numbers (0 - 127!) instruments (0 - 127, alhough Yamaha prefers to number them 1 - 128, simply adding one to the number to avoid confusing people with an instrument 0... and ending up adding to the confusion!), volume (as you noticed), velocity, filter parameters and everything else.

(Incidentally, the same happens in computers with memory: thats by "1 MB" is actually 1,048,576 bytes, and not one million of bytes, and why ISO/ANSI has started proposing the use of MiB instead of MB to differentiate M = mega = million in the metric system from Mi = mega = 1,048,576 in the computer industry. For more information on this, refer to: https://en.wikipedia.org/wiki/Binary_prefix).

Could this be changed? Technically, yes, of course. But realistically, and logistically, it would be a nightmare. The MIDI standard is THE standard to interconnect musical instruments, DAWs, and many, many more devices (from film editing and synchronization, to sound and video recorders, and even lighting control systems in theatres). Changing the range of values, even if it was only on an instrument and only for display (i.e., the values stay the same internally, only are displayed differently) would confuse everything! Imagine setting the volume to, let's say, 70 on the new "metric" scale, and finding that the value you received in the DAW you are using to record and control your keyboard, the value appears as 89... And viceversa, you set the volume on your DAW to 100, and find that on your keyboard the volume is now 79...

And changing the MIDI standard is out of the question. It is used to control not only new equipment, where a transition could be done, but also old (very old!) equipment, still used and appreciated today. This is also why the evolution of MIDI has been so slow: it needs to keep backwards compatible. The first really big change is rolling out right now, with MIDI 2.0, but this is an opt-in standard (i.e., unless and until both pieces of equipment interconnected agree to use the new standard, everything works as usual). And MIDI 2.0 is, still, a binary standard (although the number of bits, and with it the value ranges, have been greatly expanded).

Sorry for the long explanation, but I didn't want this to end up as a discussion of metric vs. non-metric, which this issue really isn't about. And, for the records, I'm from a fully metric country, and US customary units baffle me...

tl;dr: in e-music and MIDI, the standard value ranges are determined by the binary nature of the standard, and this is what everyone and everything uses, understands, and adapted to.

jcm2016

Really interesting, thank you.

Do guitar amps work off a scale of 1-10 because they are analog - meaning they aren't computers?   I know nothing about guitar amps (my background is in the brass world, so no dials are gages to play with!). 

overover

Quote from: jcm2016 on November 01, 2021, 05:16:02 AM
... Do guitar amps work off a scale of 1-10 because they are analog - meaning they aren't computers?   I know nothing about guitar amps (my background is in the brass world, so no dials are gages to play with!).

Off topic

Many guitarists have the following opinion: A guitar amplifier (only) sounds good if you turn all controls (regardless of their scaling) all the way to the right! ;)


Best regards,
Chris
● Everyone kept saying "That won't work!" - Then someone came along who didn't know that, and - just did it.
● Never put the Manual too far away: There's more in it than you think! ;-)

MikeS

Guitar amps are usually analog, do not know if there are any digital guitar amps - most guitarists prefer the old valve analog amps due to their sound quality. The volume control is a logarithmic potentiometer which is continually variable from minimum to maximum volume. The numbers on the dial (0 to 10) are for reference only so the guitarist can easily reproduce settings. Some guitarists changed the number decal to 0 to 11 so they could say their amp went to 11.