Architect: Does anyone have a * macro/script

Official support for: loomer.co.uk
Post Reply New Topic
RELATED
PRODUCTS

Post

I was actually reacting to Tom's post ;) FWIW, I've also grabbed several of your fragments and plan to analyse what you did, you patching ninja ;) Thanks for all your contributions in regard to Architect btw (I genuinely mean it).
Maybe I've read it wrong, I believe Tom's first attempt doesn't rely on LUA, which might make it more "understandable" to me than yours. I plan to dive into LUA too, though I have no clue when I'll be able to.
Last edited by nilhartman on Fri Nov 12, 2021 3:08 pm, edited 1 time in total.
Computer musician / Ableton Certified Trainer / Mastering engineer
.com
3OP

Post

I’ll do a little more work on this over the weekend.
Last edited by cturner on Fri Nov 12, 2021 7:32 pm, edited 1 time in total.
Tranzistow Tutorials: http://vze26m98.net/tranzistow/
Xenakis in America: http://oneblockavenue.net

Post

cturner wrote: Fri Nov 12, 2021 12:22 pm
This sounds like you're talking procedurally, not in terms of what you want as a result of your algorithm. You're not suggesting that
[0, 1, 4, 5, 7, 13, 15, 16, 19, 22, 25, 28]
should be the output, are you?

I'd think that
[0, 1, 4, 5, 7, 10, 13, 15, 16, 19, 22, 25, 28]
is what you'd want, correct?
I meant that both elements are dropped from their respective arrays and only one instance is passed to the new sorted array- so yeah, the second one is what already happens in the patch i posted. The only problem is that you need to trigger it as many times as the new(sorted) array has members.

If you are referring to your sieves patch it does nowhere near 95% of what i described as it deals only with logical values (true/false)- which are not of much use to me as they carry very little information that can be further manipulated. It is a great patch that successfully copies the Xenakis method-but it doesn't do what I need it to.

I haven't had the time to test the lua table sort method you posted with the rest of the patch but in your patch i saw it works in a way that it duplicates the values shared between arrays which i suppose can be fixed but I lack the know-how.

also, inputting values manually in lua is a dealbreaker as the patch must be operable in real time via the panel. while i managed to assign variables with rotary knobs within a function i still don't know how to use them successfully in the rest of the script. Trial and error is a slow way to advance, but it's all i have.

Post

Btw, made decent progress with the Olafur Arnalds inspired tool..let's say arpeggiator.
In fact it is a multi note parallel note delay with control over division(including unorthodox divisions such as 1/5 etc), trigger probability, division random oscillation, octave range, and 2 velocity modes: a random and a hairpin one.
It responds to both your velocity and pitch and sends randomized repeats for the first x voices (4 voice version in this video but adding more is trivial) to a combination of midi channels 1-3 with random selection between 2 and 3 being the default.

tldr- you play a note and random repeats of octave shifted note bounce between left and right channels.


There are a lot of tweaks to be done so if anyone wants to help me test it before I paste it here, it would be greatly appreciated.

https://youtu.be/npqK3IKibtk

never mind the random stabbing of the Push that's meant to be "playing" or the lack of sound design, this was all i had time for right now.

Post

Hi Tom,

Sounds great! I would love to see what you've done.

Post

tom plese wrote: Fri Nov 12, 2021 5:03 pmIf you are referring to your sieves patch it does nowhere near 95% of what i described as it deals only with logical values (true/false)- which are not of much use to me as they carry very little information that can be further manipulated.
It sounds like you need to put more effort into understanding what an array is. You're ignoring the "information value" of the index.

Algorithmically, you can translate my T/F arrays into your numeric arrays by iterating through each element, outputting the index for only those elements whose value is True.

Colin has made it even easier for his visual patching environment in Architect:

1. Take a [select element] object.
2. Connect the output of my [Sieve] object to the "pattern" inlet.
3. Take an [arithmetic sequence] object and set it up to generate an integer sequence the same length as the "pattern" array.
4. Connect the output of the [arithmetic sequence] object to the "array" inlet of [select element]
5. Trigger [select element] in some way you find appropriate.
6. Output is translation of the T/F array into your integer sequence.

Obviously you can create different [arithmetic sequence]s that will give interesting transpositions of the original Sieve pattern.

So I stand by my 95% assertion. This is what I meant by understanding domains. Often it's easier to translate a problem into a different domain, do your processing and translate back, than it is to work directly with MIDI values.
Tranzistow Tutorials: http://vze26m98.net/tranzistow/
Xenakis in America: http://oneblockavenue.net

Post

Okay, here's Tom Plese's preset reworked to use my [Sieve] macro and the translation algorithm described above:
SIO-211112.zip
I'm not completely certain that I have every knob triggering output and maintaining correct evaluation order. For now, double-click on the [Build] object to process the Sieve.

The "length" knob sets array length for both arrays. Given Sieves, I'm not sure the value of having independent length for each of the two arrays.

Values print to the log window in Architect. There's no MIDI output as is the case for Plese's preset.

SIO-211112b.png
You do not have the required permissions to view the files attached to this post.
Tranzistow Tutorials: http://vze26m98.net/tranzistow/
Xenakis in America: http://oneblockavenue.net

Post

Another thing that surfaced in my discussion with Tom Plese was the availability of a sort() routine in Architect's Lua implementation. Many of the visual programming languages for audio that embed scripting languages do away with their package facilities. (There are good reasons to do this, I assume.) So I was a bit surprised to see that sort() worked as advertised as a Lua call.

You can download a preset that contains two simple Lua script objects:
sort_array-211113.zip
sort_array-211113.png

They do what their names suggest in the Unix world. [sort_array] takes an Architect array and sorts the elements, [uniq_array] takes a previously sorted array and removes duplicate elements.

[sort_array] converts an Architect array into a Lua table, runs the Lua sort() routine with the Lua table as input, then converts the result back into an Architect array.

[uniq_array] takes an Architect array and iterates through its elements, comparing the current element to the previous. If current and previous elements are found equal, the current element is thrown away, otherwise the current element is appended to the end of the array. Iteration continues to the end. Running [uniq_array] on an unsorted array probably doesn't produce the results you are looking for.
. . . .

My usual caveats: code isn't elaborately tested. You determine its suitability for your use; don't blame me if things get damaged. Do what you want with the code. I claim no ownership or expect no credit. I'm always interested to hear of trouble, but I may elect not to do anything about it. If I do work on the code, I'll certainly post it here.

Enjoy!
You do not have the required permissions to view the files attached to this post.
Tranzistow Tutorials: http://vze26m98.net/tranzistow/
Xenakis in America: http://oneblockavenue.net

Post

Thanks cturner.

Post

You’re welcome mannymang!
Tranzistow Tutorials: http://vze26m98.net/tranzistow/
Xenakis in America: http://oneblockavenue.net

Post

Hi Everyone,

I'm very new to Architect, and am thinking about trying to port some lua-based midi scripts for use within the program. The scripts I would like to port utilize a small LED-based display for relevant information. Is there a fragment or module that would perform a similar function within Architect? Is this something I would just have displayed in the Panel view? If there is a document that explains how to output data to the Panel, could you kindly direct me to it (I don't see it in the tutorial PDF document)?

Thanks in advance!

Post

Maybe you could use either the a [grid] module, or a number of LED panel components to accomplish this. I can cobble together a small demo, if you'd like, into which you could (hopefully seamlessly) plug your Lua scripts.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

That would be fantastic, and very much appreciated!!

Post

bharris22 wrote: Tue Mar 22, 2022 8:10 pm That would be fantastic, and very much appreciated!!
Maybe something like this?

Image

Code: Select all

function arc.module.receive(inlet, object) 
  -- build a table sequence length 8 of random true and falses
  t = {}
  for i = 1, 8 do 
    t[#t + 1] = math.random(2) == 1
  end

  -- convert the sequence to an arc array, and output it
  arc.module.outlets[1]:send(arc.array.new(table.unpack(t)))
end
I've attached the example as a macro: please don't hesitate to ask if you need help getting it installed, or how to amend it for your specify examples.
You do not have the required permissions to view the files attached to this post.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

Excellent - thanks! It may take me some weeks to find the time to implement this (and to learn Architect generally).

One quick question - if I wanted to simulate an LED display of 100 x 100 pixels, for example, would I amend the line that says:

for i = 1, 8 do

to

for i = 100, 100 do?

In addition, is there a way to change the size of the individual boxes within the grid (i.e., make them smaller, like individual pixels)?

Post Reply

Return to “Loomer”