TulipAcid a Youtube where a man taking lessons had his teacher suggesting something was lacking in his playing of a true grand, and it was because of the headphone/volume flexibility of digitals
I know that YT video! He made me believe that all the volume/level/gain knobs/sliders (physical & virtual) should be carefully and properly set, then never touched again. And this should apply to recording, too, as long as nothing is repositioned.
The real question is, what does "carefully and properly set" mean, and how it's done. It's different for the recording phase, and the post-production (mastering) phase.
For recording, the top priority is avoid clipping. Almost all meters that came with recording software is peak meter. Input gain should be set such that peak never gets above -6 dbFS. Even err on the side of lower input gain if unsure, for example keep peak below -12 dbFS. A second priority is to maximize signal to noise ratio. In analog recording, this means don't set input gain TOO low. In digital recording, too low is rarely a problem because noise is sooooo low as well.
The above practice should give you a clean recording with no clipping. The only potential issue is if you are monitoring the input sound as your record, you need to turn up the volume on the monitoring device (headphone or speaker).
For post-production (i.e. mastering), your priority changes. First, to make sure the overall loudness is suitable to the intended audience and listening environment. Your recording should be easy to hear, neither too loud nor too quiet in comparison to the other recording your audience also listen to. Second, and no less important, is to preserve the dynamics and mood of your piece - your Clair de Lune should sound exquisite, and your Revolutionary Etude sound bombastic.
Your tools here could be an audio editor (e.g. Audacity, Adobe Audition), a DAW (Reaper, Logic Pro, Garage Band)), or a video editor (Davinci Resolve, Final Cut, iMovie).
To manipulate overall loudness, use a loudness meter, or loudness analysis tool, in the software. Measure the average loudness (LUFS) and true peak. Increase the level/gain will add the same amount of dB gain to both loudness and true peak. Because true peak above 0 dBFS will clip, avoiding the clipping will limit how much gain you can add to average loudness. This can be mitigated by applying Limiter, and/or Compressor. Still, this is a quite straight forward process if you have a piece at -24 dB LUFS, and want to target, say, -20 dB LUFS - just add 4 dB.
To get a "proper" loudness for your particular piece, now that's a tricky one. Clair de Lune should be quieter, of course. But by how much? That answer is really hard to find. Instead, an easier answer to find is how loud should be a loud piece? Bob Katz says a forte section should sound at 83 dB SPL, or at -14 dB on a loudness meter (not peak meter). So, if we record a short section that's mostly f in dynamics, set the master bus gain to achieve -14 dB loudness, and keep that gain unchanged from now on, then if we record a soft piece, let it through the same mastering process, then it should come out just right.
What's left unanswered is how to get a loudness meter. If you know how to install audio plugins, Voxengo SPAN is a free one with K-System meters. Youlean also has a free loudness meter plugin. If you don't, you can approximate it by analyzing average loudness of a short segment that's played entirely at forte. If that's still too complicated, and you only have peak meter to rely on, then peak normalize a piece with forte to -6 dBFS is generally a safe approach - just remember to write down the amount of gain applied by that peak normalization, then apply this gain value manually to all of your subsequent pieces during mastering.