midicycles is a small tool written in Go that visualizes incoming MIDI notes. It was originally created to both hear and visualize output from Melrōse programs, but it also works with any MIDI source.
The project is simple to start and flexible to tune. On startup it opens one or more MIDI input ports and renders note activity in near-real time.
Why this is fun When composing with loops…
For Go developers working with Protocol Buffers, ensuring data integrity is crucial. While Protobufs guarantee type safety, they don’t enforce semantic rules out of the box. This is where protocheck comes in, a lightweight and powerful tool for adding validation logic to your Protobuf messages.
This blog post will explore the design choices behind protocheck, focusing on its simplicity…
melrose-mcp is a tool that uses the MCP protocol to receive melrōse expressions to play. You install this tool locally on your machine and connect it from an MCP client such as Claude Desktop, Goose, VSC etc.
example Prompt:
play a tune from Claude Debussy AI:
I'll create a small segment inspired by Claude Debussy's impressionist style using the Melrose language. MCP server:
{…
The function map is used to create a composition by applying a transformation on each sequence in a collection.
1 2 3 4 5 6 7 a1 = sequence('G_3 D_ G_ A D_5 G_5') a2 = sequence('D_3 A_3 D_ E A_ D_5') a3 = sequence('E3 B3 E A_ B E5 ') a4 = sequence('B2 G_3 B3 E_ G_ B') c = map( join(a1,a3,a4,a2), fraction(8,resequence('1 4 2 4 3 6 5 4', _ )) ) loop(c) line 1.
Why you want this and how to become one 10-15 minutes read
This article is part of a series that began with The Replaceable Developer. That article examines how developers can prevent their current work from hindering their professional growth.
TL;DR Growing your skills will open doors to new challenging opportunities, which in turn can lead to making a bigger impact and, with promotions,…
Can AI tell me what design is implemented ? Recently, I wanted to contribute to some open-source Go packages that I use. Some of them have a large codebase with lots of subpackages. Despite the carefully chosen names for this these packages, without an overview and design description, it will require quite some time reading sources and debugging tests before a mental model is created. Without such…
Why you want this and how to become one TL;DR Once you are replaceable, you are free to start new initiatives, explore new technologies, solve the next complex problem which will make you happy and interested to stay at your job. Your organisation has a lower risk of discontinuity and can benefit more from your expertise. To be a replaceable developer, you need to
deal with all the relevant…
Using the notemap function with dots . and bangs ! you can write a pattern for an instrument. In this example, multiple instruments are choosen from the General MIDI set. The note C2 is typically assigned to a Kick drum. The loop plays the 16 beats in a bar and for each bang ! it will shortly (16th) play the note. You can start and stop each loop individually.
Once you have a MIDI capable…
TL;DR Melrōse is both a language and a tool to create and listen to music interactively, The language uses musical primitives (note, sequence, chord) and many functions (map, group, transpose) that can be used to create more complex patterns, loops and tracks. Melrōse uses MIDI output to produce sound by any (hard or software) device attached. Melrōse can also react on MIDI inputs to start, record…
This script is an example that uses the Melrōse language to create your own drum beats. Line by line, I will explain how it is composed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 bpm(85) // https://usermanuals.finalemusic.com/SongWriter2012Win/Content/PercussionMaps.htm open = midi(16,46,60) close = midi(16,42,60) clap = midi(16,39,60) kick = midi(16,36,80) d1 = notemap(' 3 10 11',open) d2 =…
1 2 3 4 5 6 7 8 9 bpm(90) s = sequence('c e g b') i = iterator( '(1 2) (3 4)', '(1 3) (2 4)', '1 (2 3) 4', '(1 4) (2 3)') m = resequence(i,s) l = loop(m,next(i)) 🎶 Play
Using resequence you can compose a new sequence with index-based entries. The first compostion played by the loop is (C E) (G B).
Logic Pro is a product of Apple Inc. Goal Logic Pro is a professional Digital Audio Workstation (DAW) available for Apple Mac OSX. Melrōse can communicate with Logic Pro by sending MIDI messages. Logic Pro has a rich set of sounds and instruments to play MIDI notes. In addition, Logic Pro is able to play multiple MIDI channels simultaneously which can be programmed individualy by melrōse.
This…
GarageBand is a registered trademark of Apple Inc. Goal Garageband is a simple Digital Audio Workstation (DAW) that comes with the standard installation of Apple Mac OSX on devices such as MacBook or MacPro. Melrōse can communicate with GarageaBand by exchanging MIDI messages. GarageBand has a rich set of sounds and instruments to play MIDI notes.
This article describes the steps to get…
Infrastructure automation The Google Cloud Platform (GCP) can provide the IT infrastructure you need to run your own applications or services. In addition, the platform also provides many products and services that can be used to build your complete IT landscape. Setting up infrastructure no longer includes provisioning hardware, patching operating systems and cable wiring up network…
On March 23, Q42 and Google Amsterdam organized an event to watch the keynote from the GCP Next 2016 conference held in San Fransico.
As the Ubanita platform is hosted on the Google Cloud Platform, we were given the opportunity by Q42 to talk about our platform as part of a lightning talk. Ofourse, we had prepared a demo game and the audience was invited to join a simple multiplayer game.
This short (2 min) video was created using a simple interactive Ubanita script that translated touch events into Triangle generation. See below the interesting part of that program.
For each touchMove event, a random colored Triangle sprite is added. For each touchEnd event, such Triangles are created with a outwards radial velocity.
// touchMove is called when the game detects a movement…
Kimtato is the name of a simple interactive demo that runs on the Ubanita platform. It is a playground of physical objects which are created by players using touch gestures on the controller. Once created, the objects can be pushed around using the two-finger gesture, we call edge input mode.
The following will discuss the making of this demo using the Ubanita Script API.
get dimensions To…
Go package forest was created to simplify the code needed to write real tests of a REST api. Such tests need to setup Http Requests, send them and inspect Http Responses. The Go standard library has all that is needed to achieve this flow but the required amount of code, especially the error handling, makes tests harder to read and longer to write.
Testing github Let's create a few tests that…
Artreyu is an open-source command line tool for software build pipelines that need to create artifacts which are composed of multiple versioned build parts. The design of this tool is inspired by the Apache Maven project which provides assembly support for Java projects. I created Artreyu to support a project that delivers compositions of many non-Java artifacts of which some are operating system…
Today, I needed to keep track of the linenumber while scanning table driven tests. The standard Go bufio.Scanner does not provide such information. Fortunately, in Go you can create your own by embedding the standard type and overriding the right function. That’s it.
import ( "bufio" "io" ) type linescanner struct { *bufio.Scanner line int } func newScanner(reader io.Reader) *linescanner…
I needed a simple solution to notify components about changes in some global settings. In my Java days, I have been using the Guava Eventbus to solve similar problems, so I decided to cook something that does the basics.
From Guava: “The EventBus allows publish-subscribe-style communication between components requiring the components to explicitly register with one another (and thus be…
package main import "fmt" type intSlice []int func (i intSlice) collect(block func(i int) int) intSlice { r := make(intSlice, len(i)) for j, v := range i { r[j] = block(v) } return r } func main() { numbers := intSlice{1, 2, 3} squared := func(i int) int { return i * i } fmt.Printf("%v", numbers.collect(squared)) } Try it.
Implementations of select,inject,detect are left as an excercise for…
Today, I was playing with Otto and hacked together a small command-line-interface program in Go.
package main import ( "bufio" "fmt" "os" "strings" "github.com/robertkrimen/otto" ) var Otto = otto.New() func main() { fmt.Println("otto\n") loop() } func dispatch(entry string) string { if len(entry) == 0 { return entry } value, err := Otto.Run(entry) if err != nil { return err.Error() } else {…
These are the results of exploring one aspect of the Go language; functions can return multiple values. Consider the following simple function:
func ab() (a,b int) { a,b = 1,2 return } Clearly, this function cannot be used in other function calls that expect a single value.
fmt.Printf("%v\n",ab()) The compiler will help you: “multiple-value ab() in single-value…
Update: Based on several comments posted on the Google+ Go community, I rewrote the solution presented here. See past the Conclusion section.
Recently, I was asked to write a small program for collecting product promotion information for a large collection of products. Given an input file of product identifiers, the following tasks had to be done:
read all identifiers from an input file…
Hopwatch is an experimental tool that can help debugging Go programs. Unlike most debuggers, hopwatch requires you to insert function calls at points of interest in your program. At these program locations, you can tell Hopwatch to display variable values and suspend the program (or goroutine). Hopwatch uses Websockets to exchange commands between your program and the debugger running in a HTML5…
In an earlier post, I discussed an example of using plain functions as objects. Today, I investigated solutions for using Methods as objects. As I understand it, Go methods are functions that are “bound” to a named type that is not a pointer or an interface.
package main import 'fmt' type T struct { S string } func (t T) GetS1() string { return t.S } func (t *T) GetS2() string {…
In a previous post, I discussed the design of go-restful which is a package for building REST-style WebServices using the Google Go programming language.
Today, I completed the implementation of that package which provides the basics:
Creating a WebService with Routes (mapping between Http Request and a Go function) Each Route requires information about the Http method (GET,POST,...), URL…
Today, I played with functions as objects in the Go programming language. If functions are first class citizens in Go then it must be possible to store them in fields of a struct, pass them as arguments to other functions and use them as return values of other functions.
So I visited play.golang.org for putting together a simple program that demonstrates this.
package main import 'fmt'…
I have been using JAX-RS for many REST-based service implementations in Java.
As part of my journey into the Google Go programming language, I am exploring designs for such REST support using the standard net/http package in Go.
JAX-RS provides a set of Annotation classes which can be used to add meta-data to classes, methods and method arguments. In JAX-RS these annotation are used to…
I started working on this “yet-another-web-server” project for one of the most important reasons: because its fun. I got inspired for doing this after reading about the Netty framework and all the positive reviews that people write.
My requirements for this server are
provide a minimal MVC framework that uses renderSnake to render HTML pages (distributed) Http session…
For the past month, I have been working on a new iPad Web application that recently was launched at 6hoek.com. This application provides easy access to the complete product catalog of the Dutch online webshop bol.com.
Because it is targeted to owners of tablet devices such as the Apple iPad, I decided to embrace the upcoming JQuery Mobile framework (JQM), an open-source Javascript library that…
rendersnake is a Java library for creating components and pages that produce HTML using only Java. Its purpose is to support the creation of Web applications that are better maintainable, allows for easier reuse, have testable UI components and produces compact HTML in an efficient way.
This blog post explains how to start from a carefully designed rich HTML page and create new or use the…
renderSnake is a open-source library for creating components that produce HTML using only Java. By defining Java classes for HTML components and pages you can exploit all the language features (e.g. inheritance, composition, type-checking) and IDE tooling (e.g. refactoring, unit-testing, references search, debugging,…). In addition, renderSnake is designed to produce compact HTML in an…
The site soek.goodies.st gives access to the sources of open-source Smalltalk libraries and frameworks. A big advantage to developers is that they can explore Smalltalk classes without having to successfully load them into one of the Smalltalk dialect platforms. Recently, I have changed much of the Smalltalk generator and HTML/Javascript generated code.
Formerly, all Smalltalk source was…
Melissa is a simple tool that can help in building development and runtime images in a continous integration environment. It is being used extensively to create daily builds for Smalltalk images. This post describes the steps to use Melissa for VA Smalltalk 8+.
The intended way to use Melissa is to start with a clean VA image, load the Melissa config app and save it as melissa.im. In order to…
JNIPort for VisualWorks provides a way to use Java and its huge number of available libraries directly from Smalltalk.
For example, to access the Google Spreadsheets APIs and Tools, you need to download the Java client libraries and all its dependencies. The paths to there Jars must be known to the JVM and can be set through JNIPort. For easy deployment, I put together a single jar using an…
One way to build applications for the iPhone is to create a Web application that tries to look and behave like a native one. Currently, many Javascript libraries are being developed that try to accomplish just that. One of the big reasons for choosing this route is that developing such applications is so much easier compared to the Apple-way (learn Objective-C, build and test on the local emulator…
Soek is a Smalltalk application that provides a different way to navigate through documentation and source code of a Smalltalk library. Instead of the classic multi-list browser view in an image, Soek offers a flat view on all methods and classes and is build using the Seaside Web framework.
missing image /2009/11/screen-shot-2009-11-13-at-6-33-24-pm.png I discovered this way of publishing a…
If you want an existing package to register as a WebVelocity one and as a result make it visible to the browser page, you can evaluate this script:
(Store.Registry packageNamed: 'Your-Package-Name') propertyAt: #application put: true; propertyAt: #namespace put: 'Your-Namespace'; propertyAt: #velocityThemeName put: 'Default'. which I found when looking for the newApplication functionality in…
Logging can be very helpful in analyzing the (faulty) behavior of a server application in response to client requests. HypertextLogger is a simple component that produces HTML in response to logging instructions. Its main purpose it to provide a better readable log file. By choosing you favorite CSS, you can highlight what is important and leave other information unfocused…
Glare-DataServices is a framework for building Flex Remoting services in VisualWorks Smalltalk. In this post, I will guide you through the steps for creating a small application that demonstrates the use of the framework.
Install the bundle First, you have to connect to the Cincom Public Store Repository. Then open the list of Published Items and load the bundle GlareDataServices. It includes…
To make the VAStGoodies client work right from the VA image, I needed a service API in addition to the Seaside application that is running on VAStGoodies.com. Requirements for that service include “get all available configuration map names” and “get a download url for a particular version of a configuration map”.
Instead of implementing a full-blown end-to-end SOAP…