You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since I started working on Sardine, I have relied quite a lot on fixed form Senders like note, cc and other types. They excel at writing one specific type of message but it would be nicer to be able to compose "chains" or "groups" of operations like this:
The most problematic thing is to reproduce a 'succession' of patterns, something that would work akin to a track. Maybe we could probably make use of a special Pattern type, that eats other patterns, and manage their iteration cycle:
Each pattern in the inner layer will only loop n times and signal its iteration end, triggering the upper Ptrack that it needs to move forward to the next children. The limit can be the number of specified durations or a fixed number.
The main question for everything is: where should durations be specified? Should each pattern in the chain have its own rhythm? This would be super convenient and flexible but also slightly harder to implement correctly. This syntax comes with some advantages:
independant durations: more interesting and intricate rhythms, to the expanse of a p kwarg everywhere (in each pattern).
greater composability of I/O operations. A complex instrument is just a complex pattern.
iterators are internal properties of the pattern itself, and not of the player!
Implementation
Obviously, everything has to be implemented (again!) by scratching what currently exists. The Player implementation currently assumes that there is a central sender_method and only one recursive function in charge of everything. This has proven to be a gigantic mess for more complex patterns (polyphony, etc).
Write a Stream class, which is what is returned when you compose a chain of operations: note(50) & note(70) or just feed a single chain to a Player: p1 >> note(50).
Write a Pattern class, a complex type of generator that handles infinite bi-directional indexing, also capable of returning a representation of each pattern ready for conversion as a recursive function to run on the clock.
Rewrite the Player class to work with Streams only. Each Player will act more like a manager and central reference system, marking that a Stream and individual patterns belong to a specific identifier so that the player can alter and/or stop each stream.
The text was updated successfully, but these errors were encountered:
Bubobubobubobubo
changed the title
[Rewrite] What form a Sender should have?
[Rewrite] What is the ideal form of a Sender?
Jul 23, 2024
Introduction
Since I started working on Sardine, I have relied quite a lot on fixed form Senders like
note
,cc
and other types. They excel at writing one specific type of message but it would be nicer to be able to compose "chains" or "groups" of operations like this:We could also think of a way to 'nest' chains like this in order to track many of them with only one player:
The most problematic thing is to reproduce a 'succession' of patterns, something that would work akin to a track. Maybe we could probably make use of a special Pattern type, that eats other patterns, and manage their iteration cycle:
Each pattern in the inner layer will only loop n times and signal its iteration end, triggering the upper
Ptrack
that it needs to move forward to the next children. The limit can be the number of specified durations or a fixed number.The main question for everything is: where should durations be specified? Should each pattern in the chain have its own rhythm? This would be super convenient and flexible but also slightly harder to implement correctly. This syntax comes with some advantages:
p
kwarg everywhere (in each pattern).Implementation
Obviously, everything has to be implemented (again!) by scratching what currently exists. The
Player
implementation currently assumes that there is a centralsender_method
and only one recursive function in charge of everything. This has proven to be a gigantic mess for more complex patterns (polyphony, etc).Stream
class, which is what is returned when you compose a chain of operations:note(50) & note(70)
or just feed a single chain to aPlayer
:p1 >> note(50)
.Pattern
class, a complex type of generator that handles infinite bi-directional indexing, also capable of returning a representation of each pattern ready for conversion as a recursive function to run on the clock.Player
class to work withStreams
only. Each Player will act more like a manager and central reference system, marking that aStream
and individual patterns belong to a specific identifier so that the player can alter and/or stop each stream.The text was updated successfully, but these errors were encountered: