NEWS
====
+------------------------------------------
+0.7.2 (to be announced) "optical friction"
+------------------------------------------
+
++- A major cleanup of the audio file selector.
++- The client no longer prints error messages from afs commands to
++ stdout but to stderr.
+- The sleep subcommand of para_mixer gained two options to control
+ the startup mood and the time period before fade-out starts. A bunch
+ of further improvements for this subcommand went in as well.
+- Minor cleanup of the net subsystem.
+
+Downloads:
+[tarball](./releases/paraslash-git.tar.xz)
+
--------------------------------------
0.7.1 (2022-10-03) "digital spindrift"
--------------------------------------
* overflows and rounding errors we store the common divisor of the
* correction factors separately.
*/
- static long compute_score(struct afs_info *afsi)
-static int64_t normalized_value(int64_t x, int64_t n, int64_t sum, int64_t qd)
-{
- if (!n || !qd)
- return 0;
- return 100 * (n * x - sum) / (int64_t)int_sqrt(n) / (int64_t)int_sqrt(qd);
-}
-
+ static long compute_score(struct afs_info *afsi,
+ const struct afs_statistics *stats)
{
- long score = -normalized_value(afsi->num_played, stats->num,
- stats->num_played_sum, stats->num_played_qd);
- score -= normalized_value(afsi->last_played, stats->num,
- stats->last_played_sum, stats->last_played_qd);
- return score / 2;
+ int64_t mean_n, mean_l,score_n, score_l;
+
- assert(statistics.normalization_divisor > 0);
- assert(statistics.num > 0);
- mean_n = statistics.num_played_sum / statistics.num;
- mean_l = statistics.last_played_sum / statistics.num;
++ assert(stats->normalization_divisor > 0);
++ assert(stats->num > 0);
++ mean_n = stats->num_played_sum / stats->num;
++ mean_l = stats->last_played_sum / stats->num;
+
+ score_n = -((int64_t)afsi->num_played - mean_n)
- * statistics.num_played_correction
- / statistics.normalization_divisor;
++ * stats->num_played_correction
++ / stats->normalization_divisor;
+ score_l = -((int64_t)afsi->last_played - mean_l)
- * statistics.last_played_correction
- / statistics.normalization_divisor;
++ * stats->last_played_correction
++ / stats->normalization_divisor;
+ return (score_n + score_l) / 2;
}
- static int add_afs_statistics(const struct osl_row *row)
+ static int add_afs_statistics(const struct osl_row *row,
+ struct afs_statistics *stats)
{
uint64_t n, x, s, q;
struct afs_info afsi;