View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0005801 | Spring engine | General | public | 2017-10-10 01:00 | 2017-10-11 11:30 |
| Reporter | Antero | Assigned To | Kloot | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 104.0 +git | ||||
| Summary | 0005801: PitchAdjust not taking low game speed into account enough | ||||
| Description | With PitchAdjust enabled in springsettings, game speed affects sound length and pitch. This is useful when recording a cinematic clip on less than 1.0 speed, then speeding it back up in a video editor (for smoother fps etc). However, currently PitchAdjust isn't taking low game speed into account enough. When sped up, the sounds are too short and high pitched. I recorded a sound on 0.6 game speed. To match the length of the same sound recorded on 1.0 speed, I had to speed it up to 0000118:0000125% instead of the expected 167%. A sound recorded on 0.3 speed had to be sped to 0000064:0000180% instead of 333%, and a sound recorded on 0.1 speed had to be sped to 0000262:0000315% instead of 1000%. A fix would be greatly appreciated. I'll gladly provide any other info. Thank you. | ||||
| Steps To Reproduce | 1. Record an ingame sound on 1.0 speed. 2. Record the same sound on a lower speed with PitchAdjust enabled. 3. Speed up the lower speed recording and compare. | ||||
| Tags | pitch sound speed | ||||
| Checked infolog.txt for Errors | |||||
|
|
Looks like I managed to break the formatting. Let's try that again. I recorded a sound on 0.6 game speed. To match the length of the same sound recorded on 1.0 speed, I had to speed it up to around 125% instead of the expected 167%. A sound recorded on 0.3 speed had to be sped to around 180% instead of 333%, and a sound recorded on 0.1 speed had to be sped to around 315% instead of 1000%. |
|
|
To explain your numbers: Spring sets the pitch-adjustment factor to the square root of the game speed. Fixing this would be a one-liner but I don't remember the reason behind it. |
|
|
Ah, the square root modifier is added in NetCommands? It looks intentional, but the result is rather unsatisfactory. Whether it's left that way or changed, I'll need a custom compiled engine anyhow, so thanks for pointing the right way. |
|
|
a workaround is to just call Spring.SetConfigFloat("PitchAdjust", gameSpeed) from a Lua snippet of choice after every speed change. |
|
|
Widgetifying this is a nice idea for a workaround without needing a custom engine, but I get the following: [cawidgets.lua] Error: Error in Update(): [string "LuaUI\Widgets\dbg_cinematic.lua"]:40: attempt to call field 'SetConfigFloat' (a nil value) Isn't PitchAdjust a boolean in springsettings anyhow, and not a float? But I can continue with a custom engine, so this isn't urgent. |
|
|
you're right, the setting isn't actually a float. pitch adjustment needs some retooling before my suggestion would work. by accident SetConfigFloat is not exposed to Lua in 104 (which has been fixed upstream), but you can disregard that. |
|
|
Your addition of the linear adjustment mode to the config is enough for me, so feel free to close. Making the PitchAdjust modifier a configurable float would allow for additional shenanigans, but personally I see no use for that, so feel free to close this ticket. Cheers! |
|
|
yw |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2017-10-10 01:00 | Antero | New Issue | |
| 2017-10-10 01:00 | Antero | Tag Attached: pitch sound speed | |
| 2017-10-10 01:03 | Antero | Note Added: 0018490 | |
| 2017-10-10 01:33 | Kloot | Note Added: 0018491 | |
| 2017-10-10 02:01 | Antero | Note Added: 0018493 | |
| 2017-10-10 11:15 | Kloot | Note Added: 0018494 | |
| 2017-10-10 11:15 | Kloot | Note Edited: 0018491 | |
| 2017-10-10 11:22 | Kloot | Note Edited: 0018494 | |
| 2017-10-10 21:28 | Antero | Note Added: 0018499 | |
| 2017-10-11 00:08 | Kloot | Note Added: 0018500 | |
| 2017-10-11 09:21 | Antero | Note Added: 0018502 | |
| 2017-10-11 11:30 | Kloot | Assigned To | => Kloot |
| 2017-10-11 11:30 | Kloot | Status | new => closed |
| 2017-10-11 11:30 | Kloot | Resolution | open => fixed |
| 2017-10-11 11:30 | Kloot | Note Added: 0018503 |