Browse Source

small fixes

main
James Fenn 7 months ago
parent
commit
0497a7f15a
2 changed files with 65 additions and 79 deletions
  1. +64
    -78
      .eleventy.js
  2. +1
    -1
      blog/2021-01-31-Audio-Automation.md

+ 64
- 78
.eleventy.js View File

@@ -6,82 +6,68 @@ const _moment = require("moment");
const _pluginRss = require("@11ty/eleventy-plugin-rss");

module.exports = function(eleventyConfig) {
eleventyConfig.setDataDeepMerge(true);

eleventyConfig.addLayoutAlias("default", "layouts/default.liquid");
eleventyConfig.addLayoutAlias("base", "layouts/base.liquid");
eleventyConfig.addLayoutAlias("page", "layouts/page.liquid");
eleventyConfig.addLayoutAlias("redirect", "layouts/redirect.liquid");

eleventyConfig.addPassthroughCopy("favicon.ico");
eleventyConfig.addPassthroughCopy("resume.pdf");
eleventyConfig.addPassthroughCopy({"assets/images": "images"});
eleventyConfig.addPassthroughCopy({"assets/files": "files"});
eleventyConfig.addPassthroughCopy({"assets/css": "css"});
eleventyConfig.addPassthroughCopy({"assets/js": "js"});

const markdownItRenderer = new _markdown({ html: true })
.use(require('markdown-it-prism'), { plugins: ["autoloader"] })
.use(require("markdown-it-anchor"));

eleventyConfig.addFilter("markdownify", function(str) {
if (typeof str === 'string')
return markdownItRenderer.render(str);
});

eleventyConfig.setLibrary("md", markdownItRenderer);

eleventyConfig.addFilter("where", function(array, prop, value) {
return (array || []).filter((item) => item[prop] == value);
});

eleventyConfig.addFilter("dateUTC", function(date, format) {
return _moment.utc(date).format(format);
});

/*eleventyConfig.setBrowserSyncConfig({
callbacks: {
ready: function(err, browserSync) {
const content_404 = _fs.readFileSync('_site/404.html');

browserSync.addMiddleware("*", (req, res) => {
// Provides the 404 content without redirect.
res.write(content_404);
res.end();
});
}
}
});*/

eleventyConfig.addFilter("starts_with", (string, test) => (string + "").startsWith(test));

eleventyConfig.addDataExtension("yaml", contents => _yaml.safeLoad(contents));

eleventyConfig.addPlugin(_pluginRss);

return {
templateFormats: [
"md",
"njk",
"html",
"liquid"
],

// If your site lives in a different subdirectory, change this.
// Leading or trailing slashes are all normalized away, so don’t worry about it.
// If you don’t have a subdirectory, use "" or "/" (they do the same thing)
// This is only used for URLs (it does not affect your file structure)
pathPrefix: "/",

markdownTemplateEngine: "liquid",
htmlTemplateEngine: "liquid",
dataTemplateEngine: "liquid",
passthroughFileCopy: true,
dir: {
input: ".",
includes: "_includes",
data: "_data",
output: "_site"
}
};
eleventyConfig.setDataDeepMerge(true);

eleventyConfig.addLayoutAlias("default", "layouts/default.liquid");
eleventyConfig.addLayoutAlias("base", "layouts/base.liquid");
eleventyConfig.addLayoutAlias("page", "layouts/page.liquid");
eleventyConfig.addLayoutAlias("redirect", "layouts/redirect.liquid");

eleventyConfig.addPassthroughCopy("favicon.ico");
eleventyConfig.addPassthroughCopy("resume.pdf");
eleventyConfig.addPassthroughCopy({"assets/images": "images"});
eleventyConfig.addPassthroughCopy({"assets/files": "files"});
eleventyConfig.addPassthroughCopy({"assets/css": "css"});
eleventyConfig.addPassthroughCopy({"assets/js": "js"});

const markdownItRenderer = new _markdown({ html: true })
.use(require('markdown-it-prism'), { plugins: ["autoloader"] })
.use(require("markdown-it-anchor"));

eleventyConfig.addFilter("markdownify", function(str) {
if (typeof str === 'string')
return markdownItRenderer.render(str);
});

eleventyConfig.setLibrary("md", markdownItRenderer);

eleventyConfig.addFilter("where", function(array, prop, value) {
return (array || []).filter((item) => item[prop] == value);
});

eleventyConfig.addFilter("dateUTC", function(date, format) {
return _moment.utc(date).format(format);
});

eleventyConfig.addFilter("starts_with", (string, test) => (string + "").startsWith(test));

eleventyConfig.addDataExtension("yaml", contents => _yaml.safeLoad(contents));

eleventyConfig.addPlugin(_pluginRss);

return {
templateFormats: [
"md",
"njk",
"html",
"liquid"
],

// If your site lives in a different subdirectory, change this.
// Leading or trailing slashes are all normalized away, so don’t worry about it.
// If you don’t have a subdirectory, use "" or "/" (they do the same thing)
// This is only used for URLs (it does not affect your file structure)
pathPrefix: "/",

markdownTemplateEngine: "liquid",
htmlTemplateEngine: "liquid",
dataTemplateEngine: "liquid",
passthroughFileCopy: true,
dir: {
input: ".",
includes: "_includes",
data: "_data",
output: "_site"
}
};
};

+ 1
- 1
blog/2021-01-31-Audio-Automation.md View File

@@ -19,7 +19,7 @@ Firstly, I had a distinct need to write this software in Kotlin. I am most comfo

## Using Kotlin Flows

In order to translate source events such as "a metronome tick" into a set of notes, I needed a way to construct the path of that data through my program. In Max/MSP, this path is visualized as a stream of events that gets transformed as it passes through different "objects" in its patcher interface. For my attempt to be effective, I would need a way to rapidly iterate upon this path in a similar fashion.
In order to translate source events such as "a metronome tick" into a set of notes, I needed a way to construct the path of that data through my program. In Max/MSP, this path is visualized as a stream of events that gets transformed as it passes through different "objects" in its patcher interface. For my attempt to be effective, I would need a way to rapidly iterate upon these paths in a similar fashion.

![The Max/MSP patcher interface, a handful of objects connected with spaghetti wires in-between.](/images/blogs/audio-maxmsp.png)



Loading…
Cancel
Save