Skip to content

Commit

Permalink
- added thread controller
Browse files Browse the repository at this point in the history
- other minor improvements
  • Loading branch information
christoph-hart committed Jul 10, 2023
1 parent 4816ef3 commit 88ae14b
Show file tree
Hide file tree
Showing 24 changed files with 536 additions and 133 deletions.
38 changes: 34 additions & 4 deletions Loris Toolbox/Scripts/LorisProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,25 @@ namespace LorisProcessor
if(!Manifest.SaveButton.getValue())
return;

local suffixToUse = suffix;

if(PitchLock.AutomatePitch.getValue())
{
Console.print(rootNote.getValue());

local thisRoot = rootNote.getValue() + parseInt(PitchLock.PitchLockSliders[1].getValue());

Console.print(suffixToUse);

suffixToUse += "_" + Engine.getMidiNoteName(thisRoot);


}

local sr = CURRENT_FILE.loadAudioMetadata().SampleRate;
local prefix = CURRENT_FILE.toString(CURRENT_FILE.NoExtension);
local ext = CURRENT_FILE.toString(CURRENT_FILE.Extension);
local target = outputDirectory.getChildFile(prefix + suffix + ext);
local target = outputDirectory.getChildFile(prefix + suffixToUse + ext);

target.writeAudioFile(data, sr, 24);

Expand Down Expand Up @@ -265,7 +280,7 @@ namespace LorisProcessor

originalTone = lorisManager.synthesise(CURRENT_FILE);

saveBuffer(originalTone, "_tone");
//saveBuffer(originalTone, "_tone");

if(isMultichannel)
{
Expand All @@ -279,7 +294,7 @@ namespace LorisProcessor
original -= originalTone[0];
}

saveBuffer(original, "_noise");
//saveBuffer(original, "_noise");
}

worker.setStatusMessage("Processing...");
Expand Down Expand Up @@ -378,6 +393,9 @@ namespace LorisProcessor

if(ALL_SAMPLES_MODE)
{
Console.print("ALL SAMPLES");


for(s in CURRENT_SAMPLE_LIST)
{
OriginalWatcher.CURRENT_NOTE = s.get(Sampler1.Root);
Expand All @@ -389,7 +407,19 @@ namespace LorisProcessor
}
else
{
rebuildFile(CURRENT_FILE);
if(PitchLock.AutomatePitch.getValue())
{
for(i = -12; i <= 12; i++)
{
PitchLock.PitchLockSliders[1].setValue(i);
PitchLock.PitchLockSliders[1].changed();
rebuildFile(CURRENT_FILE);
}
}
else
{
rebuildFile(CURRENT_FILE);
}
}

PENDING = false;
Expand Down
38 changes: 33 additions & 5 deletions Loris Toolbox/Scripts/Manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,28 @@ namespace Manifest
exampleLoad.setControlCallback(onExampleLoad);



const var ON_COLOUR = 0x33000000;
const var OFF_COLOUR = 0x11000000;

const var pageButtonLaf = Content.createLocalLookAndFeel();

pageButtonLaf.registerFunction("drawToggleButton", function(g, obj)
{
g.setColour(0x22000000);
g.fillRoundedRectangle(obj.area, obj.area[3]/2);
g.setColour(obj.textColour);
g.setColour(ON_COLOUR);

var circle = Rect.removeFromLeft(obj.area, obj.area[3]);

g.fillRoundedRectangle(circle, { "CornerSize": obj.area[3]/2, "Rounded": [true, false, true, false]});

g.setColour(OFF_COLOUR);

g.fillRoundedRectangle(obj.area, { "CornerSize": obj.area[3]/2, "Rounded": [false, true, false, true]});

g.setColour(obj.textColour);




var alpha = 0.3;
if(obj.over)
alpha += 0.1;
Expand All @@ -216,6 +226,7 @@ namespace Manifest

g.setColour(Colours.withAlpha(Colours.white, alpha));

Rect.removeFromLeft(obj.area, 10);

g.setFontWithSpacing(obj.value ? "Lato Bold" : "Lato", 12.0, 0.05);
g.drawAlignedText(obj.text, obj.area, "left");
Expand All @@ -229,9 +240,24 @@ namespace Manifest
"tags": ["page-handling"]
});

const var pageStates = [false, false, false, false];

const var pageStateBroadcaster = Engine.createBroadcaster({
"id": "pageStateBroadcaster",
"tags": ["page-handling"],
"args": ["component", "event"]
});


pageStateBroadcaster.addListener(pageStates, "update page states", function (component, event)
{
if(event.clicked)
{
var idx = component.get("id").getTrailingIntValue();
Console.print(idx-1);
this[idx] = !this[idx];
//component.set("bgCo")
}
});

inline function initPageButtons()
{
Expand All @@ -257,6 +283,8 @@ namespace Manifest
pageButtons.push(b);
}

pageStateBroadcaster.attachToComponentMouseEvents(pageButtons, "Clicks Only", "");

pageBroadcaster.attachToRadioGroup(9000, "page group");
}

Expand Down
6 changes: 6 additions & 0 deletions Loris Toolbox/Scripts/PitchLock.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

namespace PitchLock
{
const var AutomatePitch = Content.getComponent("Automate Pitch");

AutomatePitch.setLocalLookAndFeel(Manifest.defaultLaf);



// UI Setup

const var PitchLockSliders = [Content.getComponent("PitchLockAmount"),
Expand Down
5 changes: 5 additions & 0 deletions Loris Toolbox/Scripts/UI/RectHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ namespace Rect
return [ area[0], area[1], area[2], area[3]];
}

inline function getCentre(area)
{
return [area[0] + area[2]/2, area[1] + area[3]/2];
}

inline function contains(area, point)
{
return point[0] >= area[0] &&
Expand Down
30 changes: 25 additions & 5 deletions Loris Toolbox/XmlPresetBackups/Loris Toolbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,28 @@
NumDisplayBuffers="1">
<ChildProcessors/>
<Content>
<Control type="ScriptSlider" id="ConfigSlider1" value="1.0"/>
<Control type="ScriptSlider" id="ConfigSlider2" value="-63.0"/>
<Control type="ScriptSlider" id="ConfigSlider3" value="0.0"/>
<Control type="ScriptSlider" id="ConfigSlider4" value="79.55999755859375"/>
<Control type="ScriptSlider" id="ConfigSlider5" value="1.0"/>
<Control type="ScriptSlider" id="ConfigSlider6" value="1.0"/>
<Control type="ScriptSlider" id="PitchLockAmount" value="1.0"/>
<Control type="ScriptSlider" id="PitchShift" value="12"/>
<Control type="ScriptSlider" id="NoiseGain" value="-100.0"/>
<Control type="ScriptButton" id="Automate Pitch" value="0.0"/>
<Control type="ScriptSliderPack" id="Harmonics" value="27.0" data="128....f+XlYl6yv0ipO...f9rGEt3yiBWeOrGEt8vdT31C6QgaOov0i8zLyL0iBWOROJb8H8nv0iziBWOROMyLS8jBWO1iBWOZOJb8n8nv0i1iBWOZOov0i8jBWO1iBWOROOJb87nv0iviBWOBO..........................."/>
<Control type="ScriptSlider" id="DilateScaleSlider" value="1.0"/>
<Control type="ScriptPanel" id="Ruler" value="0.0"/>
<Control type="ScriptButton" id="RetainNoiseButton" value="1.0"/>
<Control type="ScriptComboBox" id="RootNote" value="40.0"/>
<Control type="ScriptButton" id="PreviewDiffButton" value="1.0"/>
<Control type="ScriptButton" id="SettingsButton" value="0.0"/>
<Control type="ScriptSlider" id="NoiseAmount" value="-6.799998760223389"/>
<Control type="ScriptLabel" id="SuffixLabel" value="_noise"/>
<Control type="ScriptButton" id="DirectoryButton" value="0.0"/>
<Control type="ScriptComboBox" id="SampleMapList" value="1.0"/>
<Control type="ScriptButton" id="UseSampleMaps" value="0.0"/>
</Content>
<UIData Source="Loris ToolboxUIData"/>
</Processor>
Expand All @@ -26,11 +46,11 @@
<Processor Type="EffectChain" ID="FX" Bypassed="0">
<ChildProcessors/>
</Processor>
<Processor Type="AudioLooper" ID="Original" Bypassed="1" Gain="1.0" Balance="0.0"
<Processor Type="AudioLooper" ID="Original" Bypassed="0" Gain="1.0" Balance="0.0"
VoiceLimit="256.0" KillFadeTime="20.0" IconColour="0" SyncMode="1.0"
PitchTracking="0.0" LoopEnabled="0.0" RootNote="64.0" SampleStartMod="0.0"
Reversed="0.0" FileName="{PROJECT_FOLDER}sound_examples/musicbox.aiff"
min="0" max="168000" loopStart="0" loopEnd="168000">
Reversed="0.0" FileName="D:\Development\Projekte\wavetabletest\Samples\dorian_test\Temp Samples for Christoph\Jaw Harp\jawharp_CLOSE_15.wav"
min="0" max="157038" loopStart="0" loopEnd="157038">
<ChildProcessors>
<Processor Type="MidiProcessorChain" ID="Midi Processor" Bypassed="0">
<ChildProcessors/>
Expand Down Expand Up @@ -91,14 +111,14 @@
</ChildProcessors>
<RoutingMatrix NumSourceChannels="2" Channel0="0" Send0="-1" Channel1="1" Send1="-1"/>
</Processor>
<Processor Type="StreamingSampler" ID="Sampler1" Bypassed="0" Gain="1.0"
<Processor Type="StreamingSampler" ID="Sampler1" Bypassed="1" Gain="1.0"
Balance="0.0" VoiceLimit="256.0" KillFadeTime="20.0" IconColour="0"
PreloadSize="8192.0" BufferSize="4096.0" VoiceAmount="256.0"
SamplerRepeatMode="3.0" RRGroupAmount="1.0" PitchTracking="1.0"
OneShot="0.0" CrossfadeGroups="0.0" Purged="0.0" Reversed="0.0"
NumChannels="1" UseStaticMatrix="0.0" Group0Table="" Group1Table=""
Group2Table="" Group3Table="" Group4Table="" Group5Table="" Group6Table=""
Group7Table="" SampleMapID="violin_musicbox">
Group7Table="" SampleMapID="LYRE">
<ChildProcessors>
<Processor Type="MidiProcessorChain" ID="Midi Processor" Bypassed="0">
<ChildProcessors/>
Expand Down
Loading

0 comments on commit 88ae14b

Please sign in to comment.