💾 Archived View for gemini.ctrl-c.club › ~synth › topics › orca-experiment-03.gmi captured on 2024-08-18 at 18:00:43. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-04)

-=-=-=-=-=-=-

🝕 The Synthesis Zone

Experiment III

Alright, not gonna lie I'm kinda proud of this one. It improves on the concept of experiment 2 in the sense that it tries to be a sort of player piano type thing, but several improvements make it much more musical. Additionally I came up with a few ideas on how to improve the way I was doing things with regard to writing multiple variables at a time.

I'm not going to post the entire thing inline like I did on the previous two because this one is a good deal larger - that being said you should be able to view the linked file in any old text editor if you just want to see how it ended up.

I guess I cam post bits of it in isolation though. The first thing I figured out was a way to write out multiple values at a time in an aesthetically pleasing way - particularly compared to the nightmare that I built in experiment 2.

...01000000.
...JJJJJJJJ.
.0V0JJJJJJJ.
..1V1JJJJJJ.
...2V0JJJJJ.
....3V0JJJJ.
.....4V0JJJ.
......5V0JJ.
.......6V0J.
........7V0.

The values being written are those in the top row. Ultimately I ended up separating each column of the row out using (J)ympers which I imagine to be vertical tubes. The values are written out to variables 0-7 in this example. While I wish there was a way to do this in a "one-liner" the way that the (K)onkat instruction can read variables, I'm mostly pleased with this arrangement.

Because of how Orca processes from left to right and top to bottom, the arrangement does make for rather tall ... machines.

As with experiment 2, I used the concept of a LUT for retrieving the values belonging to the selected key - that worked well enough last time so I didn't bother trying to improve it.

The next thing to mention is the input track (unlabelled) which is the set of notes to play during any given step. As before the notes are chosen from a key, but unlike before, a different key and set of notes can be selected to be played on each step.

..........
.01010000.
.00010000.
.00000100.
.00000001.
.00000100.
.00010000.
.01000000.
.00010000.
..........

The first value represents the key based on the index of that key in the LUT I mentioned earlier. In this case, we're just kind of hanging out in C major. For simplicity (or fun), the first note is always played with the octave as well. In this example, we're playing a Cmaj7 arpeggio but with a major 3rd interval thrown in on the first step. Anyway, it plays from top to bottom, at a tempo which is exposed via the variable "t" (for tempo. get it?).

The next improvement is one I shamelessly borrowed from someone else's work. Instead of just computing the notes and then banging conditionally on whether the appropriate flag is set, we're "projecting" them, so that they sort of scroll to the right until they hit the MIDI note thingy and finally make a noise. That part looks like this:

....Vt...Vt...Vt...Vt...Vt..Vt..Vt..Vt.................................
....4C1..4C1..4C1..4C1..4C1.4C1.4C1.4C1................................
...1A0..1A0..1A0..1A0..1A0.1A0.1A0.1A0.....Va....Vb....Vc....Vd........
....1....1....1....1....1...1...1...1...q4XC..k6XD..e8XE..8aXF.........
..V1J..V2J..V3J..V4J..V5J.V6J.V7J.V1J..................................
..1F1..0F1..0F1..0F1..0F1.0F1.0F1.1F1......Ve....Vf....Vg....Vh........
...*H....H....H....H....H...H...H..*H...q2XG..k4XA..e6XB..88XC.........
.z0xE.u2xE.p4xE.k6xE.f1xEb3xE75xE37xE..................................
......................................E.....................E....:13C7.
............................................E.......E............:13G7.
.................................................................:13D7.
.................................................................:13A7.
........................................E...............E........:13E7.
................................................E................:13B7.
.................................................................:13F7.
......................................E.....................E....:14C7.
.......................................................................

This part is admittedly quite dense, and I could barely tell you how it works, the same way I could barely tell you how any perl script I've ever written works even minutes after writing it. But the gist is that we decide whether to play each of the 7 (8 because of the octave) notes, and if we decide it should be played, we project an "E" which moves (E)ast until it hits the MIDI triggers. The notes for the triggers are filled in via spooky action at a distance, more formally known as the X operator - that's what the junk in the top right is doing.

A side effect of how I've implemented this is that the pattern being played and the specific values of the notes are not in sync. This means that when we move to the next line in the input track, if the key changes, any notes which have already been E'd will end up playing the corresponding note in the new key rather than the key in play at the time it was projected. Generally sounds fine in practice but to fix it I'd have to refactor some things to bring the MIDI note thingies to sit adjacent to where they're projected from.

Anyway, I think that's about it for this one. Quite a bit more involved, but I'm happy with how it turned out and it has been fun to play with. Surely there is a simpler way to play arpeggios and chords though...

Thanks for reading.

Experiment III

Up.

To the top.