#position the data and normalize
source["data"] += source["min"]
smooth = source["data"]
- print(f"{i} -> average: {np.mean(source["data"])} min: {np.min(source["data"])} max: {np.max(source["data"])}")
+ print(f"{i} -> average: {np.mean(source['data'])} min: {np.min(source['data'])} max: {np.max(source['data'])}")
source["data"] = np.round(source["data"])
# plot the data
(f"synth {sr}s " # call effect and duration
f"{source['type']} " # sets the type of synth eg:sine
f"%{round(source['data'][p])} "
- f"gain {source["gain"]}\n") # sets the frequency
+ f"gain {source['gain']}\n") # sets the frequency
# f"{source['data'][p]}/{source['data'][p+1]} norm -12\n") # could be used for a linier sweep of frequencys
)
graph_html = "<div class='figures'>" + "".join([f"<img src='media/graph.{i}.png' alt='graph'>" for i in range(len(data))]) + "</div>"
refs_html = "".join([
- f"<p id='ref{i+refs}'><em>[{i+refs}] {data[i]["realname"]}. <a href='{data[i]["url"]}'>{data[i]["url"]}</a></em></p>" for i in range(len(data))
+ f"<p id='ref{i+refs}'><em>[{i+refs}] {data[i]['realname']}. <a href='{data[i]['url']}'>{data[i]['url']}</a></em></p>" for i in range(len(data))
])
template.insert(1, graph_html)
# pipe reccursion to join all the audio clips together
call = f"sox {order[1]["file"]} -p pad 0 {padding}|"
for clip in order[2:-2]:
- call += f"sox - {clip["file"]} -p pad 0 {padding}|"
+ call += f"sox - {clip['file']} -p pad 0 {padding}|"
call += f"sox --effects-file=config/voice.effects - audio/voice.wav"
os.system(call)
# generate the full report
print("finalizing...")
-os.system(f"sox --effects-file=config/voice.effects {order[-1]["file"]} audio/last.wav")
+os.system(f"sox --effects-file=config/voice.effects {order[-1]['file']} audio/last.wav")
os.system(f"sox --combine mix-power audio/voice.wav audio/bed.wav audio/body.wav")
os.system(f"sox --effects-file=config/master.effects audio/start.wav audio/body.wav audio/end.wav audio/last.wav spaceweather.wav")
print("generated spaceweather!")