Skip to content

Commit

Permalink
add files
Browse files Browse the repository at this point in the history
  • Loading branch information
dessertplanet committed Jan 30, 2024
0 parents commit c5525e6
Show file tree
Hide file tree
Showing 8 changed files with 1,334 additions and 0 deletions.
59 changes: 59 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/sh

export USER_DIR=${USER_DIR:="/usbdrive"}
export DEBIAN_FRONTEND=noninteractive

grep -q 'ID=archarm' /etc/os-release

if [ $? -eq 0 ]; then
oscsend localhost 4001 /oled/aux/Clear ii 3 1
oscsend localhost 4001 /oled/aux/line/1 s "not valid for"
oscsend localhost 4001 /oled/aux/line/2 s "organelle-1"
cd ..
rm -rf $1
exit 128
fi

if ! [ -f /usr/local/bin/sclang ]; then
oscsend localhost 4001 /oled/gClear ii 3 1
oscsend localhost 4001 /oled/aux/line/1 s "linking sclang"
sudo ~/scripts/remount-rw.sh
sudo ln -s /usr/bin/sclang /usr/local/bin/sclang
sudo ~/scripts/remount-ro.sh
fi



which jackd

if [ ! $? -eq 0 ]; then
wget -q --spider http://google.com

if [ ! $? -eq 0 ]; then
oscsend localhost 4001 /oled/gClear ii 3 1
oscsend localhost 4001 /oled/aux/line/1 s "Connect Internet"
oscsend localhost 4001 /oled/aux/line/2 s "Then try again"
cd ..
rm -rf $1
exit 128
fi

oscsend localhost 4001 /oled/gClear ii 3 1
oscsend localhost 4001 /oled/aux/line/1 s "Installing jackd"
sudo ~/scripts/remount-rw.sh
sudo mv /etc/apt/sources.list /etc/apt/sources.list/bak
sudo cp ./sources.list /etc/apt/sources.list
sudo apt-get -y update
echo 'jackd2 jackd/tweak_rt_limits boolean true' | sudo debconf-set-selections
sudo -E apt-get -y install jackd2
if [ ! $? -eq 0 ]; then
oscsend localhost 4001 /oled/aux/line/1 s "jackd install failed"
sudo ~/scripts/remount-ro.sh
cd ..
rm -rf $1
fi
sudo ~/scripts/remount-ro.sh
fi

exit 1

94 changes: 94 additions & 0 deletions init.scd
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
//Declare variables for use in Main!

~knobs = nil ! 4;
~aux = false;
~bounceFilter = false;
~bounceDelay = false;
~bounceFeedback = false;
~tempFeedback = nil;
~tempDelaytime = nil;
~tempFilter = nil;

//buses for server consumption
~coreParams = Bus.control(numChannels: 4);
~adsrParams = Bus.control(numChannels: 4);
~voiceParams = Bus.control(numChannels: 4);

//Default Values written to these buses
~coreParams.setSynchronous(
/*filter*/ 0.0,
/*delaytime*/ 0.25,
/*feedback*/ 0.3,
/*destructionlvl*/ 0.0);

~adsrParams.setSynchronous(
/*attack*/ 1/12,
/*decay*/ 1/3,
/*sustain*/ 9/10,
/*release*/ 2/3);

~voiceParams.setSynchronous(
/*octave*/ 0.0,
/*Portamento*/ 0.0,
/*sub level*/ 0.0,
/*input mix*/ -1.0
);

//initial page to appear at launch
~page = 0;

//strings for each param page
~coreParamStrings = [
"Depth: ",
"Time: ",
"Sun: ",
"Black Hole: " ];

~adsrParamStrings = [
"Attack: ",
"Decay: ",
"Sustain: ",
"Release: " ];

~voiceParamStrings = [
"Octave: ",
"Portamento: ",
"Sub Osc: ",
"Input Mix: " ];

//Units for each param page
~coreUnits = "%" ! 4;
~adsrUnits = [ "sec", "sec", "%", "sec"];
~voiceUnits = ["", "sec", "%", "%"];

//Language side value storage (always friendly values)

~values = ();

~values[\core] = [0, 25, 0.3.linlin(0.0, 1.0, 50, 150).asInteger, 0];

~values[\adsr] = [(1/12).asStringPrec(3), 0.33, 90, 0.7];

~values[\voice] = [0, 0, 0, 0];

//Useful lookups
~pageKeys = [nil, \core, \adsr, \voice];
~pageStrings = [nil, ~coreParamStrings, ~adsrParamStrings, ~voiceParamStrings];
~pageUnits = [nil,~coreUnits, ~adsrUnits, ~voiceUnits];


//graphics variables

~rdelay = 25.linlin(0,100,270,90);

~rpos = [ 63 + (40 * 225.degrad.sin), 31 + (40 * 225.degrad.cos) ];

~center = [63, 31];

~rfeedback = 0.3.linlin(0.0, 1.0, 4, 20).asInteger;

~rvolume = 0.asInteger;

~horizon = 30;

~rdestruct = 0.asInteger;
68 changes: 68 additions & 0 deletions lib.scd
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//////FUNCTIONS/////////////

//load or reload a whole param page (Updates screen)
~loadParamPage = {
arg page, values;

~graphics.(\Clear);
~graphics.(\ShowInfoBar, true);
4.do { |i|
m.sendMsg("/oled/line/" ++ (i+1), ~pageStrings[page][i] ++ values[i] ++ " " ++ ~pageUnits[page][i]);
}
};

//load or reload a specific line on a param page (Updates screen)
~loadParamLine = {
arg page, index, value;

if(page > 0)
{
m.sendMsg("/oled/line/" ++ (index+1), ~pageStrings[page][index] ++ value ++ " " ++ ~pageUnits[page][index]);
}
};

//Cleanup functions for reuse!
~valueCleanup = ();

~valueCleanup[\percentage] = { |input| (input * 100).asInteger };

~valueCleanup[\seconds] = { |input, max = 10.0| input.linlin(0.0, 1.0,0.0, max).asStringPrec(3) };


//page-specific cleanup functions (raw in, friendly out)

~friendlyValues = ();

~friendlyValues[\core] = {
|raw, index|

switch (index)
{0}{~valueCleanup[\percentage].(raw)}
{1}{~valueCleanup[\percentage].(raw)}
{2}{raw.linlin(0.0,1.0,50.0,150.0).asInteger;}
{3}{~valueCleanup[\percentage].(raw)}

};


~friendlyValues[\adsr] = {
|raw, index|

switch (index)
{0}{~valueCleanup[\seconds].(raw);}
{1}{~valueCleanup[\seconds].(raw, 3.0);}
{2}{~valueCleanup[\percentage].(raw);}
{3}{~valueCleanup[\seconds].(raw);};
};

~friendlyValues[\voice] = {
|raw, index|


switch (index)
{0}{raw.linlin(0.0,1.0,-2,2).asInteger;}
{1}{~valueCleanup[\seconds].(raw)}
{2}{~valueCleanup[\percentage].(raw)}
{3}{~valueCleanup[\percentage].(raw)};

};
Loading

0 comments on commit c5525e6

Please sign in to comment.