diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index ada8782..8427cf6 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -63,6 +63,9 @@ def substitute_vars(replacements: dict, text: str, verbose: bool) -> str: if verbose: print("Substituting values:") for placeholder, replacement in replacements.items(): + if isinstance(replacement, bool): + replacement = preprocessor_bool(replacement) + if verbose and placeholder != "bytebeat_contents": print(placeholder, ": ", replacement, sep="") text = text.replace(f"`{placeholder}`", str(replacement)) @@ -182,14 +185,14 @@ if __name__ == "__main__": "original_sample_rate": original_sample_rate, "final_sample_rate_code": final_sample_rate_code, "bit_depth": args.bit_depth, - "is_signed": preprocessor_bool(args.signed), - "precalculated_ratio": preprocessor_bool(args.precalculate_ratio), - "faster_sample_ratio_math": preprocessor_bool(args.precalculate_ratio), - "fp_return_type": preprocessor_bool(args.floating_point), + "is_signed": args.signed, + "precalculated_ratio": args.precalculate_ratio, + "faster_sample_ratio_math": args.precalculate_ratio, + "fp_return_type": args.floating_point, "channels": args.channels, "length": samples, - "silent_mode": preprocessor_bool(args.silent), - "verbose_mode": preprocessor_bool(args.verbose and not args.silent), + "silent_mode": args.silent, + "verbose_mode": args.verbose and not args.silent, "fwrite_le": "../" + PATHS["fwrite_le_header"] }, read_file(PATHS["template"]), args.show_substituted_values))