Skip to content

Commit e2f0cef

Browse files
committed
experiment with include custom maxpat synths
1 parent 27ddcef commit e2f0cef

6 files changed

Lines changed: 2218 additions & 394 deletions

File tree

mercury_ide/code/mercury.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const handlers = {
159159
return Algo.pisano(...v);
160160
},
161161
// generate a normalized pisano period. returns in range 0 - 1
162-
'fPisano' : (...v) => {
162+
'nPisano' : (...v) => {
163163
return Util.normalize(Algo.pisano(...v));
164164
},
165165
// generate the numbers in the fibonacci sequence

mercury_ide/code/preferences.js

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ const libPath = path.posix.join(system.app, '../patchers/visual/');
131131
const libFile = path.posix.join(base, '/Data/code-library.json');
132132
let library = {};
133133

134+
const soundLibPath = path.posix.join(system.app, '../patchers/sound/');
135+
const soundLibFile = path.posix.join(base, '/Data/sound-extensions.json');
136+
let soundLibrary = {};
137+
const visualLibPath = path.posix.join(system.app, '../patchers/visual/');
138+
const visualLibFile = path.posix.join(base, '/Data/visual-extensions.json');
139+
let visualLibrary = {};
140+
134141
// directories for storage of code logs, recordings and sketches
135142
const userDirs = ['/Code Logs', '/Recordings', '/Library'/*, '/Sketches'*/];
136143

@@ -196,11 +203,26 @@ max.addHandler('init', () => {
196203
}
197204

198205
// create path for requires and load if exists
199-
library = loadFiles(libPath, '**/*.maxpat');
200-
library = Object.assign({}, loadFiles(path.posix.join(base, '/Library'), '**/*.maxpat'), library);
201-
writeJson(libFile, library);
202-
max.post('Created code library: '+libFile);
203-
max.outlet('lib', library);
206+
// library = loadFiles(libPath, '**/*.maxpat');
207+
// library = Object.assign({}, loadFiles(path.posix.join(base, '/Library'), '**/*.maxpat'), library);
208+
209+
soundLibrary = loadFiles(soundLibPath, '**/*.maxpat');
210+
soundLibrary = Object.assign({}, loadFiles(path.posix.join(base, '/Library/Sound'), '**/*.maxpat'), soundLibrary);
211+
visualLibrary = loadFiles(visualLibPath, '**/*.maxpat');
212+
visualLibrary = Object.assign({}, loadFiles(path.posix.join(base, '/Library/Visual'), '**/*.maxpat'), visualLibrary);
213+
// max.post('soundLib', soundLibrary);
214+
// max.post('visualLib', visualLibrary);
215+
216+
writeJson(soundLibFile, soundLibrary);
217+
writeJson(visualLibFile, visualLibrary);
218+
219+
// writeJson(libFile, library);
220+
// max.post('Created code library: '+libFile);
221+
// max.outlet('lib', library);
222+
max.outlet('vlib', visualLibrary);
223+
max.outlet('slib', soundLibrary);
224+
max.post('Visual library imported: '+visualLibFile);
225+
max.post('Sound library imported: '+soundLibFile);
204226
});
205227

206228
const prefHandlers = {

0 commit comments

Comments
 (0)