diff options
author | Richard <q@1bpm.net> | 2025-04-16 01:04:34 +0100 |
---|---|---|
committer | Richard <q@1bpm.net> | 2025-04-16 01:04:34 +0100 |
commit | bda3a99797df33f8bff48960318b14a0d81c52a3 (patch) | |
tree | ef28024823751abd4cbcb73093bb18b338628161 /site | |
parent | 9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22 (diff) | |
download | apps.csound.1bpm.net-bda3a99797df33f8bff48960318b14a0d81c52a3.tar.gz apps.csound.1bpm.net-bda3a99797df33f8bff48960318b14a0d81c52a3.tar.bz2 apps.csound.1bpm.net-bda3a99797df33f8bff48960318b14a0d81c52a3.zip |
Diffstat (limited to 'site')
-rw-r--r-- | site/app/base/base.js | 1 | ||||
-rw-r--r-- | site/app/twirl/appdata.js | 8 | ||||
-rw-r--r-- | site/app/twirl/transform.js | 8 | ||||
-rw-r--r-- | site/app/twirl/twirl.js | 10 | ||||
-rw-r--r-- | site/app/twirl/twirl_compiler.py | 15 | ||||
-rw-r--r-- | site/app/twist/index.html | 2 | ||||
-rw-r--r-- | site/app/twist/twist.js | 30 | ||||
-rw-r--r-- | site/app/twist/twist_ui.js | 12 | ||||
-rw-r--r-- | site/service/config.pyc | bin | 275 -> 0 bytes | |||
-rw-r--r-- | site/service/db.pyc | bin | 1933 -> 0 bytes | |||
-rwxr-xr-x | site/udo/twist/transforms/generate.udo | 8 |
11 files changed, 75 insertions, 19 deletions
diff --git a/site/app/base/base.js b/site/app/base/base.js index 8bf12f2..5438e16 100644 --- a/site/app/base/base.js +++ b/site/app/base/base.js @@ -75,6 +75,7 @@ var CSApplication = function(appOptions) { async function copyUrlToLocal(url, name) {
if (!csound) return;
+ if (!name) name = basename(url);
const response = await fetch(url);
const arrayBuffer = await response.arrayBuffer();
await copyDataToLocal(arrayBuffer, name);
diff --git a/site/app/twirl/appdata.js b/site/app/twirl/appdata.js index b417c3f..b8a7734 100644 --- a/site/app/twirl/appdata.js +++ b/site/app/twirl/appdata.js @@ -271,7 +271,7 @@ twirl.appdata = { parameters: [
{preset: "amp"},
{presetgroup: "notefreq"},
- {name: "Feedback", min: 0.1, max: 10, dfault: 1.1},
+ {name: "Feedback", min: 0.1, max: 10, dfault: 2},
{name: "Filter bandwidth", channel: "bandwidth", min: 10, max: 500, dfault: 125},
{name: "Post gain", channel: "postgain", min: 0.1, max: 2, dfault: 1},
{presetgroup: "applymode"}
@@ -285,10 +285,10 @@ twirl.appdata = { parameters: [
{preset: "amp"},
{presetgroup: "notefreq"},
- {name: "Frequency step multiplier", channel: "multiplier", min: 1.0001, max: 2, dfault: 1.1},
- {name: "Frequency multiplier", channel: "stepmultiplier", min: 0.5, max: 2, dfault: 1},
+ {name: "Frequency step multiplier", channel: "stepmultiplier", min: 1.0001, max: 2, dfault: 1.1},
+ {name: "Frequency multiplier", channel: "multiplier", min: 0.5, max: 2, dfault: 1},
{name: "Amplitude smoothing", channel: "ampprofile", min: 0, max: 1, step: 1, dfault: 1},
- {name: "Harmonics", min: 2, max: 256, dfault: 64, automatable: false},
+ {name: "Harmonics", min: 2, max: 128, step: 1, dfault: 64, automatable: false},
{presetgroup: "applymode"}
]
}
diff --git a/site/app/twirl/transform.js b/site/app/twirl/transform.js index 1feff51..2d89d8c 100644 --- a/site/app/twirl/transform.js +++ b/site/app/twirl/transform.js @@ -1011,11 +1011,11 @@ twirl.transform.Transform = function(options) { }
}
groupParameters = [
- {name: "Apply mode", channel: "applymode", absolutechannel: true, description: "Apply mode", automatable: true, options: ["Replace", "Mix", "Modulate", "Demodulate", "Filter"], dfault: 0, conditions: pdef.conditions},
+ {name: "Apply mode", channel: "applymode", absolutechannel: true, description: "Apply mode", automatable: true, options: ["Replace", "Mix", "Modulate", "Demodulate", "Filter mix"], dfault: 0, conditions: pdef.conditions},
{name: "Dry mix", description: "Original signal amplitude", channel: "applymodedry", absolutechannel: true, conditions: conditionsMix, min: 0, max: 1, dfault: 1},
{name: "Wet mix", description: "Transformed signal amplitude", channel: "applymodewet", absolutechannel: true, conditions: conditionsMix, min: 0, max: 1, dfault: 1},
- {name: "Minimum frequency", description: "Minimum frequency to transform", channel: "applymodedry", absolutechannel: true, conditions: conditionsFilter, min: 20, max: 44100, dfault: 500},
- {name: "Maximum frequency", description: "Maximum frequency to transform", channel: "applymodedry", absolutechannel: true, conditions: conditionsFilter, min: 20, max: 44100, dfault: 2000}
+ {name: "Minimum frequency", description: "Minimum frequency to transform", channel: "applymodehpf", absolutechannel: true, conditions: conditionsFilter, min: 20, max: 22000, dfault: 500},
+ {name: "Maximum frequency", description: "Maximum frequency to transform", channel: "applymodelpf", absolutechannel: true, conditions: conditionsFilter, min: 20, max: 22000, dfault: 2000}
];
} else if (pdef.presetgroup == "pvanal") {
@@ -1195,7 +1195,7 @@ twirl.transform.TreeView = function(options) { var dp = items[k].added.split("-");
var added = new Date(dp[0], dp[1] - 1, dp[2]);
if (Math.round((new Date() - added) / (1000 * 60 * 60 * 24)) <= 14) {
- x.html(name + " <p style=\"display:inline;color:#ff2222;\"> [new]</p>");
+ content = name + " <p style=\"display:inline;color:#ff2222;\"> [new]</p>";
}
}
li.html(content).css("cursor", "pointer").click(function() {
diff --git a/site/app/twirl/twirl.js b/site/app/twirl/twirl.js index 5f201f6..71c3316 100644 --- a/site/app/twirl/twirl.js +++ b/site/app/twirl/twirl.js @@ -31,7 +31,7 @@ twirl.init = function() { var NoteData = function() {
var self = this;
this.data = null;
- fetch("https://apps.csound.1bpm.net/app/twirl/notedata.json").then(function(r) {
+ fetch("../twirl/notedata.json").then(function(r) {
r.json().then(function(j) {
self.data = j;
});
@@ -93,6 +93,12 @@ twirl.random = { }
};
+twirl.getSharedFiles = async function() {
+ var data = await fetch("../sounddb/data.json");
+ var json = await data.json();
+ return json;
+};
+
twirl.createIcon = function(definition) {
var state = true;
var active = true;
@@ -272,7 +278,7 @@ twirl.sendErrorState = async function(errorObj) { if (twirl._remote.sessionID) {
data.session_id = twirl._remote.sessionID;
}
- var resp = await fetch("https:///service/", {
+ var resp = await fetch("https:///apps.csound.1bpm.net/service/", {
method: "POST",
headers: {
"Content-type": "application/json"
diff --git a/site/app/twirl/twirl_compiler.py b/site/app/twirl/twirl_compiler.py index cc2ba3e..5a72e2d 100644 --- a/site/app/twirl/twirl_compiler.py +++ b/site/app/twirl/twirl_compiler.py @@ -64,7 +64,7 @@ def compile(app): with open(os.path.join(target_dir, "{}.css".format(app)), "w") as f:
f.write(css_data)
- links = [
+ dups = [
[twirl_path, "twirl"],
[os.path.join(twirl_path, "font"), "font"],
[os.path.join(top_path, "udo"), "udo"],
@@ -72,11 +72,18 @@ def compile(app): [os.path.join(app_path, "{}.csd".format(app)), "{}.csd".format(app)]
]
- for l in links:
+ for l in dups:
target = os.path.join(target_dir, l[1])
- if os.path.islink(target):
+ if os.path.islink(target) or os.path.isfile(target):
os.unlink(target)
- os.symlink(l[0], target)
+ elif os.path.isdir(target):
+ shutil.rmtree(target)
+
+ if os.path.isfile(l[0]):
+ shutil.copy2(l[0], target)
+ elif os.path.isdir(l[0]):
+ shutil.copytree(l[0], target)
+ #os.symlink(l[0], target)
copies = ["documentation.html", "developer_documentation.html"]
for c in copies:
diff --git a/site/app/twist/index.html b/site/app/twist/index.html index 4652991..c629b31 100644 --- a/site/app/twist/index.html +++ b/site/app/twist/index.html @@ -90,6 +90,8 @@ </div>
<div id="twist_hidden_links">
<a id="twist_contact" href="https://csound.1bpm.net/contact/?type=general&app=twist" target="_blank">Contact</a>
+ <a id="twist_sourcecode" href="https://git.1bpm.net/apps.csound.1bpm.net/about/" target="_blank">Source code</a>
+ <a id="twist_video" href="https://www.youtube.com/watch?v=oAFStTJWDZc" target="_blank">Walkthrough video</a>
<a id="twist_reportbug" href="https://csound.1bpm.net/contact/?type=report_bug&app=twist" target="_blank">Report bug</a>
<a id="twist_documentation" href="documentation.html" target="_blank">Documentation</a>
</div>
diff --git a/site/app/twist/twist.js b/site/app/twist/twist.js index a7a248c..515235c 100644 --- a/site/app/twist/twist.js +++ b/site/app/twist/twist.js @@ -108,7 +108,7 @@ var Twist = function() { };
}
- twist.version = 1;
+ twist.version = 1.1;
this.currentTransform = null;
var errorState;
var instanceIndex = 0;
@@ -967,6 +967,34 @@ var Twist = function() { app.insertScore("twst_getbuffers", [0, 1, cbid]);
};
+ this.loadFileFromURL = async function(url, name, onComplete) {
+ if (!name) name = url.split("/").reverse()[0];
+ await app.copyUrlToLocal(url, name);
+ var cbid = app.createCallback(async function(ndata){
+ twirl.loading.hide();
+ if (ndata.status > 0) {
+ if (waveformTabs.length == 0) {
+ self.createNewInstance(true);
+ instanceIndex = 0;
+ }
+ self.waveformTab.text(name);
+ await globalCallbackHandler(ndata);
+ waveformFiles[instanceIndex] = name;
+ waveformLoaded[instanceIndex] = true;
+ } else if (ndata.status == -1) {
+ twirl.prompt.show("File not valid");
+ } else if (ndata.status == -2) {
+ twirl.prompt.show("File too large");
+ } else {
+ twirl.prompt.show("File loading error");
+ }
+ if (onComplete) {
+ onComplete(ndata);
+ }
+ });
+ app.insertScore("twst_loadfile", [0, 1, name]);
+ };
+
this.loadFileFromClipboard = function() {
if (!twist.hasClipboard) {
return twirl.prompt.show("Cannot create: clipboard is empty");
diff --git a/site/app/twist/twist_ui.js b/site/app/twist/twist_ui.js index 08e5fe1..15e7b44 100644 --- a/site/app/twist/twist_ui.js +++ b/site/app/twist/twist_ui.js @@ -143,6 +143,9 @@ var twistTopMenuData = [ {name: "Help", click: function(twist){
$("#twist_documentation")[0].click();
}},
+ {name: "Walkthrough video", click: function(twist){
+ $("#twist_video")[0].click();
+ }},
{name: "Developer reference", click: function(twist){
$("#twist_developer_documentation")[0].click();
}},
@@ -155,6 +158,9 @@ var twistTopMenuData = [ {name: "Submit transform code", click: function(twist){
$("#twist_developer_submit")[0].click();
}},
+ {name: "Source code", click: function(twist){
+ $("#twist_sourcecode")[0].click();
+ }},
{name: "About", click: function(twist) {
twist.ui.showAbout();
}},
@@ -474,6 +480,12 @@ var TwistUI = function(twist) { });
};
+ this.globalFiles = function() {
+ //twirl.getSharedFiles();
+
+ //"/sounddb/" + path
+ };
+
this.developerConsole = function() {
$("#twist_developer").show();
$("#twist_inject_devcsound").click(async function() {
diff --git a/site/service/config.pyc b/site/service/config.pyc Binary files differdeleted file mode 100644 index 4df456d..0000000 --- a/site/service/config.pyc +++ /dev/null diff --git a/site/service/db.pyc b/site/service/db.pyc Binary files differdeleted file mode 100644 index 81639ee..0000000 --- a/site/service/db.pyc +++ /dev/null diff --git a/site/udo/twist/transforms/generate.udo b/site/udo/twist/transforms/generate.udo index e7355a8..8ccdda9 100755 --- a/site/udo/twist/transforms/generate.udo +++ b/site/udo/twist/transforms/generate.udo @@ -60,7 +60,7 @@ opcode twst_tf_gensimpleadditive, a, kkkkkio endif
aosc oscili (1 / iharmonics) * kgain, (kfreq * kmultiplier)
if (index < iharmonics) then
- arec twst_tf_gensimpleadditive, min:k(kfreq * kstepmult, sr / 2), kstepmult, kampprofile, iharmonics, index + 1
+ arec twst_tf_gensimpleadditive kamp, kmultiplier, min:k(kfreq * kstepmult, sr / 2), kstepmult, kampprofile, iharmonics, index + 1
aosc += arec
endif
xout aosc * kamp
@@ -93,7 +93,7 @@ opcode twst_tf_genfeedback, a, kkkk asig += (adel * kfeedback)
asig butterbp asig, kfreq, kbw
asig butterbp asig, kfreq, kbw
- asig tanh ain
+ asig tanh asig
asig *= kpostgain
xout asig
endop
@@ -107,11 +107,11 @@ instr twst_tf_genfeedback kpostgain = twst_param:k("postgain")
kbw = twst_param:k("bandwidth")
if (ileft == 1) then
- aL twst_tf_genfeedback kfeedback, kfreq, kpostgain
+ aL twst_tf_genfeedback kfeedback, kfreq, kpostgain, kbw
aL *= kamp
endif
if (iright == 1) then
- aR twst_tf_genfeedback kfeedback, kfreq, kpostgain
+ aR twst_tf_genfeedback kfeedback, kfreq, kpostgain, kbw
aR *= kamp
endif
outs aL, aR
|