Architect: Does anyone have a * macro/script

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

Post

--.
Last edited by Obsolete485692 on Fri Nov 19, 2021 8:18 pm, edited 1 time in total.

Post

Hey y'all !
Would anyone have a working data / MIDI looper / repeater please ? For some reason I can't get to make it work.
I'd like to "freeze" for n bars something generated with various degrees of random / probability.
Cheers :)
Computer musician / Ableton Certified Trainer / Mastering engineer
.com
3OP

Post

nilhartman wrote: Fri Sep 24, 2021 2:21 pm Hey y'all !
Would anyone have a working data / MIDI looper / repeater please ? For some reason I can't get to make it work.
I'd like to "freeze" for n bars something generated with various degrees of random / probability.
Cheers :)
I have a Lua script that does that exactly, although I think it's on my old laptop. I'll dig it out over the weekend.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

Awesome, thanks Colin ! Then may I ask, what are exactly the MIDI Repeat and Data Repeat objects for ?
Computer musician / Ableton Certified Trainer / Mastering engineer
.com
3OP

Post

[MIDI repeat] and [Data repeat] basically repeats the same MIDI message at the specified interval. For JavaScript coders, I guess the closest analogy would be `setInterval`. You could use them to build, say, a flexible metronome that sends a message every n ticks.

I tend to use them in Euclidean rhythm type processes. Because these modules take floating-point intervals, they are great for subdividing a beat into a non-integer tick without losing accuracy over time.

So these modules themselves aren't quite what you need, as [MIDI repeat] will only repeat a *single* MIDI message, not a number of them. You could also use [write to MIDI pool], but that has the issue that there is a tiny, but non-deterministic, delay after finishing writing the MIDI file before it appears in the MIID pool ready to play again.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

nilhartman wrote: Fri Sep 24, 2021 2:35 pm Awesome, thanks Colin ! Then may I ask, what are exactly the MIDI Repeat and Data Repeat objects for ?
It's the gateway to sound like autechre :lol:
Seriously , the data repeat is totally nuts , I've created a structure where data repeats triggers all kinds of stuff etc..



Image
You do not have the required permissions to view the files attached to this post.
Eyeball exchanging
Soul calibrating ..frequencies

Post

--.
Last edited by Obsolete485692 on Fri Nov 19, 2021 8:19 pm, edited 1 time in total.

Post

Ah Autechre... M62 vibes anyone ?
https://soundcloud.com/nilhartman/arch24092021-raw

Fully generative doodle, made with Architect. I started with the sequencer in the Quick Start Guide, and modified it quite a bit.

@gentelclockdivider: thanks so much ! Will have a deep look into that toktik.xml. I love the look of your faders hehe. Quick, dumb question : how do have these angular, clean cables between objects ?

@colin : now I must say I'm very curious to learn how you patch Euclidian sequences. I relied on these (pretty complex, shifting ones too) a lot when using Tidal Cycles.
Computer musician / Ableton Certified Trainer / Mastering engineer
.com
3OP

Post

nilhartman wrote: Sat Sep 25, 2021 8:27 am @gentelclockdivider: thanks so much ! Will have a deep look into that toktik.xml. I love the look of your faders hehe. Quick, dumb question : how do have these angular, clean cables between objects ?
The `node` icon on the graph toolbar, to the right of the zoom slider, let you edit cable nodes.
@colin : now I must say I'm very curious to learn how you patch Euclidian sequences. I relied on these (pretty complex, shifting ones too) a lot when using Tidal Cycles.
Noted: I will sort that out for you too!
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

nilhartman wrote: Fri Sep 24, 2021 2:21 pm Would anyone have a working data / MIDI looper / repeater please ? For some reason I can't get to make it work
Couldn't find my other Lua script, so I ended up rewriting something that does the same. I'm not sure of your *exact* requirements, so if there is anything that I've missed or you want changed, don't hesitate to ask.

Essentially, MIDI goes in the left inlet. The right inlet controls the mode of the recorder, which you can set by sending it integer values. 0 stops it, 1 begins recording, and 2 begins playing.

I've attached the frag file below, and the body of the Lua script can also be found below:

Code: Select all

local State = {
  NONE = 0,
  RECORDING = 1,
  PLAYING = 2
}

local Inlets = {
  MIDI = 1,
  MODE = 2
}

local clock
local state
local buffer = {}
local bufflength = 0
local playindex

function setstate(newstate)
  if state == newstate then 
    return 
  end

  state = newstate

  if state == State.RECORDING then
    buffer = {}
    clock = 0
    print('recording')
  elseif state == State.PLAYING then
    bufflength = clock
    clock = 0
    playindex = 1
    print('starting playing buffer of length', bufflength)
  end
end

function arc.module.reset() 
  clock = 0
  playindex = 1
  state = State.NONE
end

function arc.module.tick() 
  if state == State.PLAYING then
    while buffer[playindex] and buffer[playindex].clock <= clock do
      arc.module.outlets[1]:send(buffer[playindex].object)
      playindex = playindex + 1
    end
  end

  -- Increment the clock. Once we've played the length of the record buffer,
  -- reset the clock to begin again from the start so that the recorded
  -- content loops.
  clock = clock + 1
  if state == State.PLAYING and clock >= bufflength then
    clock = 0
    playindex = 1
  end
end

function arc.module.receive(inlet, object) 
  if inlet == Inlets.MIDI then
    if state == State.RECORDING then
      buffer[#buffer + 1] = { clock = clock, object = object }
    end

  elseif inlet == Inlets.MODE then
    if object == State.NONE then
      setstate(State.NONE)
    elseif object == State.RECORDING then
      setstate(State.RECORDING)
    elseif object == State.PLAYING then
      setstate(State.PLAYING)
     else
      setstate(State.NONE)
    end
  end
end
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

Purchased Architect yesterday and all i can say is wow!-it literally changed my life.
still getting to know it so it's useless to send requests since whatever i find problematic is due to user incompetence but i'm making real progress and i've finally decided to get into programming thx to this.
Starting with lua, who knows where it'll take me.
Thank you for making such an inspiring tool, Colin.

Post

tom plese wrote: Mon Oct 25, 2021 4:40 pm Purchased Architect yesterday and all i can say is wow!-it literally changed my life.
Thanks Tom, much appreciated. I just hope you mean it changed your life for the better, not the worse! :P
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

colin@loomer wrote: Mon Oct 25, 2021 4:43 pm Thanks Tom, much appreciated. I just hope you mean it changed your life for the better, not the worse! :P
i am not exaggerating when I say it and i wholeheartedly believe it's for the better xD

always had an interest in programming but never got into it because i couldn't see what i was supposed to be working towards. Now, my purpose is clear and fun! Hopefully, my newly learned skills will translate to a broader understanding of programming, but even if they don't I am having too much fun as it is.

sorry for the ot and thanks for taking the time to reply!

Post

first inquiry..sorry if it's blatantly obvious or impossible.

how do you guys make a per note chain?

the idea is to play a chord/few midi notes and each should get its own chain of processing that terminates only once you release the specific note.
closest i got was a single chain that ignores all notes past the first pressed one but whatever i try with polyphony and comparators etc just makes me lose my noteoff and the first note chain stops either as soon as any noteoff is received or just doesnt work.
i suspect note id could be a crucial part but i can't figure out how to put it to use.

another way to put it is: i'd like to build a layer selector so that a new note uses the first free layer without stopping the processing of previous layers as long as the notes that activated them are active.

thx in advance!

Post

Use [give note id] and a [MIDI switch 1 to N].

Image

[give note id] will allocate a unique id to a noteon, starting from 0, and then release this id when it receives a matching noteoff (ie, a noteoff with the same key and channel.) You can combine this with a [MIDI switch] to route each MIDI note to a seperate processor. The [MIDI switch] is smart enough to send matching note off (and any polyphonic MIDI events) to the same channel as the previous note on.

There are a few cavets here. One is that you need to create enough processing layers for however many notes you expect to handle at once: at the moment, Architect doesn't automatically creates different instances. And [give note id] will output an `undefined` if it receives a MIDI message other than noteon, noteoff, or a polyphonic MIDI event. The [MIDI switch] won't be too happy about that value as a control, and will complain. If this is an issue, you can either filter out MIDI events before [get note id], or filter out the `undefined` values with the [is undefined] and [branch] modules.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post Reply

Return to “Loomer”