Shared references to stateful objects?
It decouples the output of your state machine from one and only one path.
I'm afraid I'm not quite following you.
Returning to a sequencer as an example -- if I want the output of a [text sequence something] to be directed to different places depending on the system's state, the one thing I can't do is to have multiple instances of [text sequence] -- because each instance has its own position that is independent of other instances.
You get N paths where N is the number of abstraction instances you use to, say, implement the Supercollider state machine thingy you linked to. (Just to clarify-- each abstraction only generates output when a message gets sent to its own inlet.)
... which means each abstraction instance must have a separate sequencer instance.
That isn't going to work.
The only way I can think of to make it work is to have one abstraction containing one sequencer, and use the [send] to reroute to the appropriate [receive].
Here, the upper construction is wrong; the lower one gets the result I want.
hjh
PS Ergonomics do matter. The systems we use exert some influence over the ideas we're willing to consider (or, in extreme cases, the ideas we can even conceive). If something is inconvenient enough to express, then it restricts the range of thoughts that are practical within the system. In part this means we should choose systems that are closer in line with the thoughts we want to express, but it also means there's no harm in extending the system's reach.
Shared references to stateful objects?
Something I was thinking about yesterday, while adding to my [text sequence]-based abstractions:
[text sequence] is a stateful object, in that the result of [step( depends on the previous state.
What if you need the result to be handled differently in different cases?
Specifically, I'm rejiggering the data so that it outputs the time delta to the next event alongside the data list, rather than the time delta from the previous event. As a step sequencer, in pseudocode, it looks like this:
coroutine
t = text sequence blah blah;
list = t.next;
#time ... data = list; // [list split 1]
time --> time outlet; // withhold data now
wait for bang;
while
list = t.next;
list isn't empty
do
#time ... data2 = list;
time --> time outlet;
data --> data outlet;
data = data2;
wait for bang;
loop;
end
So there's an "initializer" handling of the [text sequence] result, and then a "normal" handling within the loop.
For stateless operations like [+ 1], you can just replicate the operator for the different contexts. But because [text sequence] is stateful, you can't do that.
I could actually think of a nice, clean solution for numeric results -- I'm OK with this as it would scale up to any number of references:
But [value] can hold only a single number (why? wouldn't the equivalent of a 'variant' type be useful?), and [text] is dealing with lists.
I ended up using the [list prepend] --> [route 0 1] trick -- fair enough as the above routine uses the sequence in only two places. It might not scale when things get more complicated (for instance, in https://github.com/jamshark70/ddwChucklib-livecode/blob/master/parsenodes.sc I'm passing a stateful string iterator through dozens of functions, haven't counted them but I guess it's easily 50 or 60 places -- from a computer science perspective, a parser is not an exotic use case -- quite common really -- [route 0 1 2 3 4 5 6 7 8 9 10 11 12] oh, I give up already ).
Wondering if there are other options. It would be really nice if graphical patchers had a concept of a shared object reference, replicating the 't' variable in the pseudocode, but I guess that won't happen soon.
hjh
PdParty, sending/recieving OSC
Hi folks!
I reached this thread because I had the same problem: there were no way to receive OSC messages in PDparty. I was sending a simple bang from Isadora, just for test purposes, and it works fine on PD on my Mac (sending to locahost), but does not work sending to my Iphone IP. I was sure that the OSC were issued corrected, cause I can see them on Isadora OSC monitor.
Finally I found the problem was a conflict between the OSC incoming port in PDparty (Iphone) and de OSC port that the patch is lisent to (specified in a message to netreceive). If this one (in netreceive) is the same that the one in Port incoming (PDparty), you get in the console this error "error: blind: Address already in use (48), and the patch in PDparty do not receive OSC messages. I changed the OSC incoming port in PD settings, and the patch is receiving OSC messages to the port specified in [lisent] and [netreceive].
I attach my test patch (just play the sound file "cascabel" from the bang button or from OSC (send "/toggle1 1" to port 4321 to the IP where PDparty is running).
Hope it is useful for somebody. I was stuck for hours finding the reason for no receiving OSC
Regards
Daniel
TEST_PDparty.pd cascabel.wav
Converting audio signals to binary with no externals ?
@Jona Thanks again for the idea. This concept can be extended into something really interesting. I was thinking that it is possible to connect a counter that counts N steps and at different steps could replace the values of a particular parameter in a sequential manner with a specific pattern parameter. So you have a polymorphic formula where each parameter $f2,$f3,$f4 is replace by a pattern sequence at different steps. The pattern sequence loading into the formula can be started at a random step in one of the sequencers. Or modulated by other sequencers to be set at a specific step. So you could have one of the sequencers to decide the step value for another sequencer. You could use the gap between steps to hold a specific value in the formula.
<this is just one sequence for one parameter >
[counter]
|
[sel 0 1 2 3 4]
|
[2] <- at step 0 send a message to $f2 ; at step 1 send a different message to $f2 ...
|
[expr~ ($v1 & $v1 % 255) - ($v1 * $f2 & $v1 >> $f3 & $v1 >> $f4]
DNA Sequence (Nucleotide) Player: Converting nucleotide sequences to (midi) Music
gene-seq-to-music-via-pd~-help.pd
gene-seq-to-music-via-pd~.pd
DNA Sequence (Nucleotide) Player: Converting nucleotide sequences to (midi) Music
Credits:
All source data is retrieved from the "Nucleotide Database" (DB) via National Center for Biotechnology Information, U.S. National Library of Medicine (NCBI) at
https://www.ncbi.nlm.nih.gov/nucleotide/
Miller Puckette for the J08.classicsynth
and
the creator(?) of the vlist2symbol abstraction.
Requirements:
wget, Linux command line web retrieval tool
Linux
ggee, [shell]
cyclone, [counter]
Use Case:
Actors: those who want to hear the patterns in DNA nucleotide sequences and/or comprehend how Nature makes Music not "noise"/Gene sequences are like one of Nature's "voices"/
Case:
Enter the "Accession" (identification number (id)) of a NCBI DB entry into the id symbol field
Case:
Click on "LOAD"
Case:
Click "PLAY".
Instructions:
1-Go to the DB (https://www.ncbi.nlm.nih.gov/nucleotide/) and find an Accession(id) of a sequence;
2-Enter that value into the ID [symbol] box of the patch
3-Click the "LOAD" [button/bang];
4-Set pitch, velocity, duration, and repeat for G,A,C, and T (representing the four nucleotide bases of a DNA strand — guanine, cytosine, adenine, and thymine);
5-Toggle "PLAY" to 1, i.e. to On, to hear the sequence using the variables you set in 4) and to "0" to stop it.
How It Works:
The patch takes the input ID and packs it into a string as the FILE(Path) for wget.
The wget command is then sent as a list to a shell object.
The output of the shell object is then parsed (using an intermediate [text] object) into a [text] object with each line being 4 characters long, each character being either G,C,A, or T.
Once loaded and Play is clicked, each line is then reconstructed as a midi note with the pitch as determined by the first character, velocity (2nd) and duration (3rd) and repeated as many times as the 4th character dictates (as set in 4) above).
Once the entire sequence is played, the player stops sending notes.
Inlets(left to right):
id, either numbers or symbols
values, a 16 item list of 4x4 sets of pitch, velocity, duration, repeat (i.e. one set per nucleotide type, G,C,A, or T) (Note: the sequence, if loaded, will play immediately upon receipt of this list.)
beats per minute, bpm, esp. as it relates to note durations.
Outlets:
the current midi note, i.e. pitch/velocity/duration
id (of the gene sequence)
sequence name, as listed by the NCBI DB
nucleotide being played as a string, ex. GGAC
AFTERWARD:
-
Since it really is only sending midi value it can be connected to whatever synth you would like;
-
Elsewhere on this Forum, I shared a patch which took "noise" as its input and converted it into music using sigmund~, in that case "running water" as its source. (See for reference: https://forum.pdpatchrepo.info/topic/12108/converting-noise-to-music-rushing-water-using-sigmund) This patch takes that concept and applies it to what might also be called "noise", DNA sequences, were it not that the results (like the running water, yet even more so) sound like "Music".
This exploration has me wondering...
How can we delineate what is noise (only natural at this point) and what is music?
Is the creative/ordering/soulful nature's being expressed in our own music not also being expressed by Nature itself? ...so that we might be considered one "bow" playing upon it?
And, if by Music we mean notes laid down on purpose, might not it be said that is what Nature has been done? Is doing?
I hope you find the patch useful, stimulating, and exciting, or at the very least funny to think about.
Love through Music, no matter in what state Life may find you,
Peace,
Scott
How do I play up to 64 txt files at once. 16 digits can be 1's or 0's loaded as toggle states.
@RetroMaximus Sorry, i should have read your first post again, where you described what you want to do in simple terms. My apologies.
Here is a simple sequencer that plays the values of the different sequences stored in [text]. Click on [text define -k $0-sequences] to see the sequences. There are six sequences stored there as an example: text-sequencer.pd
How do I play up to 64 txt files at once. 16 digits can be 1's or 0's loaded as toggle states.
So I have 64 txt files containing 16 digits that could be a 1 or 0. these digits are used as toggle states for my sequencer. the state of a toggle is sent to [s seqstep1] to [s seqstep16] and recieved to its 1 of the 16 toggles boxes in the sequencer. When a sequence is loaded a file path with the sequence number attached to it like this for example pattern-1.txt to pattern-64.tx there can be up to 64 sequences play at any given time based on the [s seqstep1 ] for the loaded txt file.
I am able to play them one at a time by changing the number atom and pushing play but im not sure how I should go about loading and playing all 64 txt files at once.
The below screen shot is how the sound is trigger using the [OBBangOnMetronome] abstract. The outlet is sent to second inlet of [OBPlayPadSample]. The first inlet is the selected sequence (the sequence that we want to play) number atom.
I need a a [Play all] button is the easiest way I can describe it.
The last screen shot is simply for visual representation of how the sequencer looks.
abstraction for controlling Ardour plugin parameters
I made this abstraction to simplify the process of connecting to an Ardour-run plugin through OSC.
You just pick the strip number, plugin number, and parameter number. Data sent to the abstraction's input will be passed to the parameter you choose. You need to make sure that you enable OSC in Ardour by going to Edit > Control Surfaces > Open Sound Control (OSC). You should also make sure Ardour is using the same port as the patch (obvy).
I hope this saves somebody some time digging through Ardour documentation!
Getting Pure data to work on Raspbian Jessie (giving pure data permission to access device?)
@pmh1d15 OSC is an IP network protocol. You will need Ethernet or Wi-Fi on the Teensy to "talk" OSC...... unless it is possible to get the Teensy to make its USB connector behave like a network port?...... maybe dangerous for future programming requirements?
At the moment it is behaving as a TTY port...... which is logical given that it is its only com port.
Either give it a network port......... https://forum.pjrc.com/threads/40238-Teensy-3-2-with-WIZ820io-and-OSC ......or convert your messages within PD from OSC to TTY data and use the USB connection.
However, looking at your OP link it seems that is exactly what is happening in "pumpsn17".
The patch [slipserial.pd] is doing the conversion to the teensy datastream.
So it is using the tty port and you should have a working system.....
Is [slipserial.pd] looking through the USB port to the pins on the Teensy...... is any voltage appearing on Teensy "S0".
More info here......
https://github.com/CNMAT/OSC
David.
multi=param note event sequencing approaches
@dxk Yes, with [text sequence] you could start each line with a "note_n" flag and use the -w argument to set a flag for waits. To jump to a particular note you can connect the output of [text search] thus:
[note_16(
|
[text search $0-sequencer 0] -> 0 means search in the first field of each line
|
[line $1(
|
[text sequence $0-sequencer]
Like I said, I haven't tried it yet and I'm sure it would require some trial and error (as well as some trickery) to get it to do what you want, but I'd say in general [text] is a lot more flexible than both lists and arrays (even if you don't use [text sequence] and build a sequencer around [text get]). It's also easier to save, read and modify the sequences "by hand" this way.