Sfoglia il codice sorgente

slight cleanup of late-night toolbox work

Thomas Buck 1 anno fa
parent
commit
a29ebe0798
2 ha cambiato i file con 26 aggiunte e 20 eliminazioni
  1. 23
    19
      Makefile
  2. 3
    1
      render.py

+ 23
- 19
Makefile Vedi File

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
 inputs = $(wildcard *.svg)
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
 .PHONY: all
23
 .PHONY: all
9
 all: output ${outputs}
24
 all: output ${outputs}
11
 output:
26
 output:
12
 	mkdir output
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
 	for number in {000..360..5} ; do \
33
 	for number in {000..360..5} ; do \
28
 	   ./render.py -s 192000 -t 0.1 -o output/$(@F)_$$number.wav -r $$number $< ; \
34
 	   ./render.py -s 192000 -t 0.1 -o output/$(@F)_$$number.wav -r $$number $< ; \
29
 	done
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
 	rm output/$(@F)_*.wav
37
 	rm output/$(@F)_*.wav
33
 
38
 
34
-
35
 .PHONY: clean
39
 .PHONY: clean
36
 clean:
40
 clean:
37
 	rm -rf output
41
 	rm -rf output

+ 3
- 1
render.py Vedi File

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

Loading…
Annulla
Salva