Fix: fixing some stuff before SAMP version upgrade
This commit is contained in:
@ -8,7 +8,7 @@ Bank : Singleton {
|
||||
var <paths, buffers, <channels, <foundRoot, <foundRootModTime, markersCache, atCache;
|
||||
|
||||
*initClass {
|
||||
root = "/Users/bubo/.config/livecoding/samples";
|
||||
root = "/Users/bubo/.config/livecoding/samples".standardizePath;
|
||||
extensions = ["wav", "aiff", "aif", "flac", "mp3"];
|
||||
}
|
||||
|
||||
@ -227,8 +227,15 @@ Bank : Singleton {
|
||||
^this.at(index);
|
||||
}
|
||||
|
||||
do { |...args| buffers.size.collect(this.bufferAt(_)).do(*args) }
|
||||
collect { |...args| ^buffers.size.collect(this.bufferAt(_)).collect(*args) }
|
||||
do {
|
||||
|...args|
|
||||
buffers.size.collect(this.bufferAt(_)).do(*args)
|
||||
}
|
||||
|
||||
collect {
|
||||
|...args|
|
||||
^buffers.size.collect(this.bufferAt(_)).collect(*args)
|
||||
}
|
||||
|
||||
prUpdateBuffers {
|
||||
if (Server.default.serverBooting or: {
|
||||
@ -284,10 +291,19 @@ Bank : Singleton {
|
||||
^Pindex(Pseq([this], inf), keyPat)
|
||||
}
|
||||
|
||||
// Single buffer support
|
||||
asBuffer { ^this.singleSampleWrap(nil) }
|
||||
asControlInput { |...args| ^this.prSingleSampleWrap(\asControlInput, *args) }
|
||||
play { |...args| ^this.prSingleSampleWrap(\play, *args) }
|
||||
asBuffer {
|
||||
^this.singleSampleWrap(nil)
|
||||
}
|
||||
|
||||
asControlInput {
|
||||
|...args|
|
||||
^this.prSingleSampleWrap(\asControlInput, *args)
|
||||
}
|
||||
|
||||
play {
|
||||
|...args|
|
||||
^this.prSingleSampleWrap(\play, *args)
|
||||
}
|
||||
|
||||
prSingleSampleWrap {
|
||||
|method ...args|
|
||||
|
||||
@ -42,7 +42,7 @@ Boot {
|
||||
this.samplePath = samplePath ? "/Users/bubo/.config/livecoding/samples";
|
||||
|
||||
// Setting up the audio samples/buffers manager
|
||||
Bank.lazyLoading = true;
|
||||
Bank.lazyLoading = false;
|
||||
Bank.root = this.samplePath;
|
||||
|
||||
// Post actions: installing behavior after server boot
|
||||
@ -68,14 +68,16 @@ Boot {
|
||||
Event.addEventType(\buboEvent, {
|
||||
// This is a custom event that makes it easier to play samples
|
||||
arg server;
|
||||
~sp = ~sp ?? 'default';
|
||||
~nb = ~nb ?? 0;
|
||||
~buf = Bank(~sp)[~nb % Bank(~sp).paths.size];
|
||||
if (~buf.numChannels == 1) {
|
||||
~instrument = \player;
|
||||
} {
|
||||
~instrument = \splayer;
|
||||
};
|
||||
if (~sp.notNil && ~nb.notNil, {
|
||||
~sp = ~sp ?? 'default';
|
||||
~nb = ~nb ?? 0;
|
||||
~buf = Bank(~sp)[~nb % Bank(~sp).paths.size];
|
||||
if (~buf.numChannels == 1) {
|
||||
~instrument = \player;
|
||||
} {
|
||||
~instrument = \splayer;
|
||||
};
|
||||
});
|
||||
~type = \note;
|
||||
currentEnvironment.play;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user