Skip to content

Instantly share code, notes, and snippets.

View kmorrill's full-sized avatar

Kevin Morrill kmorrill

  • Mattermark
  • San Francisco, CA
View GitHub Profile
(async function() {
// Utility function to pause execution for a specified duration (in milliseconds)
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
// Function to extract book information based on ASIN
function extractBookInfo(asin) {
// Extract the book title
const titleElement = document.querySelector(`#${asin} h2.a-size-base.a-color-base.a-text-center.kp-notebook-searchable.a-text-bold`);
const title = titleElement ? titleElement.innerText.trim() : 'Title not found';
(function() {
console.log('Script started.');
// Array to hold the CSV lines
let csvLines = [];
// Prepare the CSV header
csvLines.push('Title,URL,Channel Name,Upload Date,Duration,Thumbnail URL');
// Select all video elements inside the liked videos page
We're going to create a preset patch using this guide.
Technical Specification for OP-XY Patch JSON File Format
1. Introduction
1.1 Purpose
The purpose of this document is to provide a comprehensive technical specification for the JSON file format used to store and exchange patch data on the OP-XY device. This specification aims to standardize the structure and content of patch files, ensuring compatibility and consistency across different patches, whether they are synth presets, drum kits, or sample-based instruments. By adhering to this format, developers, sound designers, and users can create, modify, and share patches efficiently and reliably.
1.2 Overview
@kmorrill
kmorrill / gist:ac2e20613d45a7bea6e919f68f494eb6
Created December 19, 2024 20:22
Mozaic OP-XY Drum Generator
@Description
OP-XY Drum Pattern Generator v2.0
A dynamic drum pattern generator for OP-XY creating musical 4-bar patterns.
Controls:
- Density: Overall number of hits (sparse to busy)
- Variation: Pattern unpredictability and dynamics
- Balance: Emphasis between core drums vs percussion
- Repetition: Pattern evolution over time
@kmorrill
kmorrill / Mozaic melody generator
Last active February 2, 2025 16:26
Mozaic OP-XY Melody Generator
@Description
Melodic Generator v2.0
Uses four knobs to control melodic generation:
- Melodic Contour: Smooth ↔ Angular intervals
- Rhythm: Steady ↔ Syncopated patterns
- Register: Narrow ↔ Wide pitch range
- Harmony: Sparse ↔ Rich note choices
Adjust any knob to generate a new melody.
@End
@kmorrill
kmorrill / OP-XY JS Library
Last active February 2, 2025 16:25
OP-XY Midi Controller
<!DOCTYPE html>
<html>
<head>
<title>OP-XY MIDI Control</title>
</head>
<body>
<div id="status"></div>
<button onclick="opxy.start()">Start</button>
<button onclick="opxy.stop()">Stop</button>
Below is a cheat sheet highlighting Mozaic’s key differences, limitations, and “gotchas” relative to typical coding or scripting languages. If you’re guiding other LLMs (or developers) who want to generate code for Mozaic, these are some of the most important points to emphasize.
1. Limited String Handling
No string variables: Mozaic doesn’t allow you to store strings in variables.
Cannot do string interpolation: You must log strings as constants in braces (e.g., Log {Hello}), or log numeric variables separately (e.g., Log var).
No concatenation: There is no built-in method to build dynamic strings.
Gotcha: This means you can’t do myString = "Hello " + name or myString = {"Hello "}{name} in Mozaic. You also cannot store a string from user input in a variable.
2. Unique Event Model with Labelled Blocks
@kmorrill
kmorrill / Mozaic Script Syntax Sheet.txt
Last active February 2, 2025 16:32
Mozaic script syntax sheet
MOZAIC SCRIPT SYNTAX SHEET
Download the full programming manual on ruismaker.com
MIDI functions:
SendMIDIOut <byte1>, <byte2>, <byte3> [,<delay_in_milliseconds>]
SendMIDINoteOn <chan>, <note>, <velocity> [,<delay_in_milliseconds>]
SendMIDINoteOff <chan>, <note>, <velocity> [,<delay_in_milliseconds>]
SendMIDICC <chan>, <controller>, <value> [,<delay_in_milliseconds>]
@kmorrill
kmorrill / gist:32039889d3c5f9698311c57fb11d58e3
Created February 2, 2025 16:30
Mozaic Touché for OP-XY
@OnLoad
ShowLayout 0
gActiveChannel = 1
// Set initial knob and pad labels
Call @UpdateKnobLabels
Call @UpdatePadLabels
@End
@UpdateKnobLabels
@kmorrill
kmorrill / Mozaic OP-XY LFO explorer.txt
Last active February 2, 2025 16:33
Mozaic OP-XY LFO explorer
@OnLoad
ShowLayout 0
Call @ResetKnobLabels
// Set default LFO values
lfoDest = 0 // Default: Volume
lfoSpeed = 6 // Default: Quarter Note
lfoCurve = 0 // Default: Sine
lfoAmount = 127 // Default: Full Range
midiCC = 7 // Default CC: Volume