1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
diff -ruN a/app/server/ruby/core.rb b/app/server/ruby/core.rb
--- a/app/server/ruby/core.rb 2021-02-01 12:10:30.000000000 +0100
+++ b/app/server/ruby/core.rb 2021-09-20 02:02:48.452962508 +0200
@@ -139,7 +139,7 @@
# define this helper first so we can set the constants below
def self.wav_from_buffer_file(filename)
::WaveFile::Reader.new(
- File.expand_path("../../../../etc/buffers/#{filename}", __FILE__),
+ File.expand_path("/usr/share/sonic-pi/buffers/#{filename}", __FILE__),
::WaveFile::Format.new(:mono, :float, 44100)
).read(441000).samples.freeze
end
diff -ruN a/app/server/ruby/lib/sonicpi/util.rb b/app/server/ruby/lib/sonicpi/util.rb
--- a/app/server/ruby/lib/sonicpi/util.rb 2021-02-01 12:10:30.000000000 +0100
+++ b/app/server/ruby/lib/sonicpi/util.rb 2021-09-20 01:53:31.524788455 +0200
@@ -329,11 +329,11 @@
end
def root_path
- File.absolute_path("#{File.dirname(__FILE__)}/../../../../../")
+ File.absolute_path("/usr/share/sonic-pi")
end
def etc_path
- File.absolute_path("#{root_path}/etc")
+ File.absolute_path("#{root_path}")
end
def snippets_path
@@ -341,7 +341,7 @@
end
def doc_path
- File.absolute_path("#{etc_path}/doc")
+ File.absolute_path("/usr/share/doc/sonic-pi")
end
def cheatsheets_path
@@ -353,7 +353,7 @@
end
def tmp_path
- File.absolute_path("#{root_path}/tmp")
+ File.absolute_path("/tmp")
end
def synthdef_path
@@ -369,19 +369,20 @@
end
def app_path
- File.absolute_path("#{root_path}/app")
+ File.absolute_path("/usr/lib/sonic-pi")
end
def html_public_path
- File.absolute_path("#{app_path}/gui/html/public")
+ File.absolute_path("#{doc_path}/gui/html/public")
end
+ # this path is only relevant during build time
def qt_gui_path
File.absolute_path("#{app_path}/gui/qt")
end
def examples_path
- File.absolute_path("#{etc_path}/examples")
+ File.absolute_path("#{doc_path}/examples")
end
def server_path
@@ -397,7 +398,7 @@
end
def server_bin_path
- File.absolute_path("#{server_path}/ruby/bin")
+ File.absolute_path("#{server_path}/bin")
end
def native_path
@@ -414,7 +415,7 @@
end
def sox_path
- File.join(native_path, "sox", __exe_fix("sox"))
+ File.absolute_path("/usr/bin/sox")
end
def scsynth_log_path
@@ -450,7 +451,7 @@
end
def erlang_server_path
- File.join(server_path, "erlang", "sonic_pi_server", "ebin")
+ File.absolute_path("/usr/lib/sonic-pi")
end
def user_audio_settings_path
diff -ruN a/app/server/ruby/util.rb b/app/server/ruby/util.rb
--- a/app/server/ruby/util.rb 2021-02-01 12:10:30.000000000 +0100
+++ b/app/server/ruby/util.rb 2021-09-20 01:53:31.524788455 +0200
@@ -12,15 +12,15 @@
#++
def sp_sonic_pi_path()
- File.absolute_path("#{File.dirname(__FILE__)}/../../")
+ File.absolute_path("#{File.dirname(__FILE__)}/..")
end
def sp_scripts_path()
- File.absolute_path("#{sp_sonic_pi_path}/app/scripts")
+ File.absolute_path("#{sp_sonic_pi_path}/scripts")
end
def sp_synthdefs_path()
- File.absolute_path("#{sp_sonic_pi_path}/app/etc/synthdefs/compiled")
+ File.absolute_path("#{sp_sonic_pi_path}/synthdefs/compiled")
end
def spider_log(message)
|