No additional explanation.
Report ID | 656 | Title | [Req. file] Octave range in sound commands increased to 8th octave |
Product | Rejected Requests | Status | Closed - No Change (Severity 0 - None Assigned) |
Version | - | Fixed in | - |
Page 1 of 1
Report ID #656: [Req. file] Octave range in sound commands increased to 8th octave
#1 Lachesis
Posted 28 June 2017 - 05:46 PM
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
Page 1 of 1
Replies (1 - 5)
#2 Lachesis
Posted 25 February 2019 - 10:07 PM
Update on this: While making music for Lancer's ZZT game using MZX's play command, I've found the upper octave 6 notes are so shrill that I'm not sure there's much benefit to introducing even higher notes (they might be useful for SFX, but definitely not music...).
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#3 Lachesis
Posted 13 March 2019 - 07:48 AM
Updating status to: Closed - No Change
Update 2: the period values used for sound effects with notes in octave 6 in are already so low that they're starting to get inaccurate. There's also a problem with implementing this just for play notes, which also start to get inaccurate at high values depending on the current sampling rate.
B6 (actually B7) is the highest note MZX can play, which has a frequency of 3840Hz (MZX uses approx. 428Hz tuning for the PC speaker). To summarize since the code seems to have been written with obfuscation in mind: the PC speaker is implemented as an overflow of a 32-bit unsigned integer of which the MSB determines whether the current value is high/low. The the amount this integer is incremented is proportional to (Note freq)/(Sampling rate). For B6 at 44100Hz, this is
3840Hz / 44100Hz ≈ 0.0871
For the highest note currently possible at the sampling rate most people are probably using, this waveform repeats after ≈11.5 samples, and this is only going to shrink as the pitch increases further. This can also be observed by generating a square wave in Audacity and zooming in. As the number of samples per period decreases, so will the accuracy of the note. The effect will be even worse for those using lower sampling rates like 22050Hz.
Also, this note is already probably as shrill as anyone needs for any reasonable purpose.
Closing this with the option of it being revisited if someone has a good excuse for adding it.
Update 2: the period values used for sound effects with notes in octave 6 in are already so low that they're starting to get inaccurate. There's also a problem with implementing this just for play notes, which also start to get inaccurate at high values depending on the current sampling rate.
B6 (actually B7) is the highest note MZX can play, which has a frequency of 3840Hz (MZX uses approx. 428Hz tuning for the PC speaker). To summarize since the code seems to have been written with obfuscation in mind: the PC speaker is implemented as an overflow of a 32-bit unsigned integer of which the MSB determines whether the current value is high/low. The the amount this integer is incremented is proportional to (Note freq)/(Sampling rate). For B6 at 44100Hz, this is
3840Hz / 44100Hz ≈ 0.0871
For the highest note currently possible at the sampling rate most people are probably using, this waveform repeats after ≈11.5 samples, and this is only going to shrink as the pitch increases further. This can also be observed by generating a square wave in Audacity and zooming in. As the number of samples per period decreases, so will the accuracy of the note. The effect will be even worse for those using lower sampling rates like 22050Hz.
Also, this note is already probably as shrill as anyone needs for any reasonable purpose.
Closing this with the option of it being revisited if someone has a good excuse for adding it.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#4 Lachesis
Posted 13 March 2019 - 08:06 AM
Here's the original reason this was requested for reference:
I'm still not convinced we'd gain much here.
Quote
Again!
I'd like the octave range in sound commands to be raised to the 8th octave (as opposed to the current 6th). It's less idiotic of a request than it seems, considering MZX handles WAVs and OGGs now, and 44.1KHz/48KHz just barely makes it into the end of the 6-octave range, making speedup sound manipulation of OGG/WAVs somewhat limited. (Mathematically, extending the octave range by two will allow 192KHz wavs/oggs to be played at/near native speeds with octave settings, but that's a benefit that I don't see being used for pretty obvious reasons. 96KHz is comparatively feasible, sort of. The extension to eight octaves is simply because it's more "natural" than seven.)
I'd like the octave range in sound commands to be raised to the 8th octave (as opposed to the current 6th). It's less idiotic of a request than it seems, considering MZX handles WAVs and OGGs now, and 44.1KHz/48KHz just barely makes it into the end of the 6-octave range, making speedup sound manipulation of OGG/WAVs somewhat limited. (Mathematically, extending the octave range by two will allow 192KHz wavs/oggs to be played at/near native speeds with octave settings, but that's a benefit that I don't see being used for pretty obvious reasons. 96KHz is comparatively feasible, sort of. The extension to eight octaves is simply because it's more "natural" than seven.)
I'm still not convinced we'd gain much here.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
Page 1 of 1
0 User(s) are reading this issue
0 Guests and 0 Anonymous Users
Powered by IP.Tracker 1.3.2 © 2025 IPS, Inc.