Переглянути джерело

slight cleanup of late-night toolbox work

Thomas Buck 8 місяці тому
джерело
коміт
a29ebe0798
2 змінених файлів з 26 додано та 20 видалено
  1. 23
    19
      Makefile
  2. 3
    1
      render.py

+ 23
- 19
Makefile Переглянути файл

@@ -1,9 +1,24 @@
1
+# ----------------------------------------------------------------------------
2
+# Copyright (c) 2024 Thomas Buck (thomas@xythobuz.de)
3
+# Copyright (c) 2024 Philipp Schönberger (mail@phschoen.de)
4
+#
5
+# This program is free software: you can redistribute it and/or modify
6
+# it under the terms of the GNU General Public License as published by
7
+# the Free Software Foundation, either version 3 of the License, or
8
+# (at your option) any later version.
9
+#
10
+# This program is distributed in the hope that it will be useful,
11
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
+# GNU General Public License for more details.
14
+#
15
+# See <http://www.gnu.org/licenses/>.
16
+# ----------------------------------------------------------------------------
17
+
1 18
 inputs = $(wildcard *.svg)
2 19
 
3
-# outputs = $(inputs:%.svg=output/%_44100.wav)
4
-# outputs += $(inputs:%.svg=output/%_48000.wav)
5
-# outputs += $(inputs:%.svg=output/%_96000.wav)
6
-outputs += $(inputs:%.svg=output/%all.wav)
20
+outputs = $(inputs:%.svg=output/%.wav)
21
+outputs += $(inputs:%.svg=output/%_rotate.wav)
7 22
 
8 23
 .PHONY: all
9 24
 all: output ${outputs}
@@ -11,27 +26,16 @@ all: output ${outputs}
11 26
 output:
12 27
 	mkdir output
13 28
 
14
-output/%_44100.wav: %.svg
15
-	./render.py -s 44100 -o $(@:%.svg=%_44100.wav) $<
16
-
17
-output/%_48000.wav: %.svg
18
-	./render.py -s 48000 -o $(@:%.svg=%_48000.wav) $<
19
-
20
-output/%_96000.wav: %.svg
21
-	./render.py -s 96000 -o $(@:%.svg=%_96000.wav) $<
29
+output/%.wav: %.svg
30
+	./render.py -s 192000 -o $@ $<
22 31
 
23
-output/%_192000.wav: %.svg
24
-	./render.py -s 192000 -o $(@:%.svg=%_192000.wav) $<
25
-
26
-output/%all.wav: %.svg
32
+output/%_rotate.wav: %.svg
27 33
 	for number in {000..360..5} ; do \
28 34
 	   ./render.py -s 192000 -t 0.1 -o output/$(@F)_$$number.wav -r $$number $< ; \
29 35
 	done
30
-	sox  output/$(@F)_*.wav $@
31
-	ffmpeg -f concat -safe 0 -i <( for f in output/$(@F)_*.wav; do echo "file '$$(pwd)/$$f'"; done ) output.wav
36
+	ffmpeg -f concat -safe 0 -i <( for f in output/$(@F)_*.wav; do echo "file '$$(pwd)/$$f'"; done ) $@
32 37
 	rm output/$(@F)_*.wav
33 38
 
34
-
35 39
 .PHONY: clean
36 40
 clean:
37 41
 	rm -rf output

+ 3
- 1
render.py Переглянути файл

@@ -7,6 +7,7 @@
7 7
 #
8 8
 # ----------------------------------------------------------------------------
9 9
 # Copyright (c) 2024 Thomas Buck (thomas@xythobuz.de)
10
+# Copyright (c) 2024 Philipp Schönberger (mail@phschoen.de)
10 11
 #
11 12
 # This program is free software: you can redistribute it and/or modify
12 13
 # it under the terms of the GNU General Public License as published by
@@ -26,6 +27,7 @@ import math
26 27
 import wave
27 28
 import argparse
28 29
 from svgpathtools import svg2paths
30
+
29 31
 def rot_p(p_center, p,  angle_d):
30 32
     angle = math.radians(angle_d)
31 33
     ox = p_center[0]
@@ -99,7 +101,7 @@ def read_image(filename, path_steps, volume_percent, angle_d):
99 101
 
100 102
     print("min={} max={}".format(p_min, p_max))
101 103
     print("center={} ".format(p_center))
102
-    print("dist ={} ={} ".format(dist_min, dist_max))
104
+    print("dist min={} max={} ".format(dist_min, dist_max))
103 105
 
104 106
     data = bytearray()
105 107
 

Завантаження…
Відмінити
Зберегти