Skip to content

Commit

Permalink
Fix default tuner resolution
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Oct 13, 2023
1 parent 0ba6fdc commit 2f58ab1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mod/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def __init__(self, hmi, prefs, msg_callback):
self.profile = Profile(self.profile_apply, self.descriptor)

self.swapped_audio_channels = self.descriptor.get('swapped_audio_channels', False)
self.tuner_resolution = self.descriptor.get('tuner_resolution', 16)
self.tuner_resolution = self.descriptor.get('tuner_resolution', 1)

This comment has been minimized.

Copy link
@brummer10

brummer10 Nov 21, 2023

Contributor

On the Dwarf we need a resolution of 100 to get the semi cent into the widget_tuner. Otherwise we lose precision down to 1 Cent. The widget_tuner expected a precision of 0.01 Cent in order to draw the bars correctly. As we send the Cent as int it needs to be multiplied by 100 in tuner.py before it get converted to int. Doing that and revert the last commit on mod-dwarf-controller should fix the tuner.

This comment has been minimized.

Copy link
@falkTX

falkTX Nov 21, 2023

Author Member

the last build is working as intended though, so dont understand what is there more to fix

This comment has been minimized.

Copy link
@falkTX

falkTX Nov 21, 2023

Author Member

regarding this commit, this simply sets the default resolution for the fallback case. the dwarf descriptor config provides a custom value for the high resolution, which overrides this default "1".

This comment has been minimized.

Copy link
@brummer10

brummer10 Nov 21, 2023

Contributor

I must admit that I haven't checked out the latest test-build, I just see the comment on the forum: https://forum.mod.audio/t/tuner-3-5-wrong/10620/26
which gives me the impression that the Cent comes as Cent, not as milli-cent.
Also when I look at the mod-dwarf-controller, when print the Cent directly from int (without decimal point), it should be the wrong (multiplied with 100) value. If it shows the Cent value correct, then the incoming value is only Cent, not milli-cent as expected. That leads in turn to the issue pultek describe with the bars.
However, I'll checkout the latest test-build as soon I've some free time, maybe I'm completely wrong in my assumptions.

This comment has been minimized.

Copy link
@brummer10

brummer10 Nov 21, 2023

Contributor

So I've checked the latest test-release v1.13.3.3287. The tuner is broken. It receive "only" cent, not milli-cent in the widget-tuner.
I implement the following line in order to fix it:


        if self.descriptor.get('platform', None) != "dwarf":
            self.tuner_resolution = self.descriptor.get('tuner_resolution', 1)
        else:
            self.tuner_resolution = self.descriptor.get('tuner_resolution', 100)

also it is needed to revert the last commit on mod-dwarf-controller, so show the cent value with the decimal dot.

This comment has been minimized.

Copy link
@falkTX

falkTX Nov 21, 2023

Author Member

the dwarf already passes 100 as the tuner resolution, there is no need for such a thing. check the json file in /etc inside the dwarf.

the use of cents instead of millicents is intentional, to reduce the cognitive load and things happening on screen.

This comment has been minimized.

Copy link
@falkTX

falkTX Nov 21, 2023

Author Member

is there something going wrong where on the dwarf it is still using value 1 as resolution instead of 100?
we havent change this part on mod-ui side for a long time, so this should be the same as always

This comment has been minimized.

Copy link
@brummer10

brummer10 Nov 21, 2023

Contributor

Let's take the discussion to IRC, I'm there now.


self.current_tuner_port = self.prefs.get("tuner-input-port", 1, int)
self.current_tuner_mute = self.prefs.get("tuner-mutes-outputs", False, bool)
Expand Down

0 comments on commit 2f58ab1

Please sign in to comment.