(2) PureData | Arduino serial tutorial
Arduino reads the digitis of a number as ASCII. For example the number 100 should be sent as a list like this [49 48 48( where 49 is ASCII 1 and 48 ASCII 0. If you want to send more than one number at the same time, you'll have to separate them with a space, so [100 200( would be [49 48 48 32 50 48 48( where 32 is ASCII space.
If you want to use a slider you'll have to parse the digits of the incoming number and add 48 to each digit (ASCII 0). I've already made a patch that does this, but for now I'll leave it to you, it's a better lerning process. If you can't make it, come back and ask for help
(2) PureData | Arduino serial tutorial
Thanks for the quick reply. I can't find much documentation on Serial.parseInt on the reference page?
I have to browse the web for some examples, so I can figure it out somehow. Regarding ASCII i suppose Pd should send i.e. 88 for the arduino to pick up an X ?
This is what I have for the Arduino so far...
int red = 9;
int green = 10;
int blue = 11;
int R = 0;
int G = 0;
int B = 0;
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
pinMode(red, OUTPUT);
pinMode(green, OUTPUT);
pinMode(blue, OUTPUT);
}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
int R = Serial.parseInt(); // R ASCII DEC 82
int G = Serial.parseInt(); // G ASCII DEC 71
int B = Serial.parseInt(); // B ASCII DEC 66
// say what you got:
analogWrite(red, R);
analogWrite(green, G);
analogWrite(blue, ;
}
}
What module/message should I put in pure data between comport and the slider, to hold the ASCII decimal in order for sending the right value?
Thanks again.
Problem compiling external on Windows
@joelakes said:
Hi David,
Did you resolve the problems with the $s_float in the counter example? I am getting the same problem using Dev-C++.
Thanks,
Joe
I was having the same problem. Also in the [pan~] signal class example with &s_signal.
But I finally solved it, or at least found a way around it that seems to work.
In How to Write PD Externals there's a line explaining that s_signal refers to the
string "signal" in a lookup table somewhere, so I tried to just replace &s_signal with "signal" each place it was used. Of course, this didn't work.
Later I noticed that anywhere else a string appeared, it was added with gensym("string"). So this time I replaced &s_signal with gensym("signal") and it actually worked.
My ideas on what's going on are either:
A. The external is compiled before "signal" is added to the table.
B. "signal" is never added to the table, unless you do it
C. The external can't see the table, for what ever reason.
These are just guesses. I'm learning as I go, and not very familiar with C yet.
I would like to know however if this is a good practice or a hack.
Also, should I use gensym() every time s_signal appears, or does it just need to be called once? ie Will it cause any problems to call gensym() multiple times with the same argument?
Hopefully this will help someone else out there having the same problem.
Noteout MIDI issues
I am new to PD and am working on creating a series of notes that I am sending out to Logic. I am using noteout 1, noteout 2, etc. but for whatever reason, whatever I send in noteout 2 or 3 is also being sent to the noteout 1. Any ideas or suggestions?
I have attached the pd patch that I am working on.
Thanks,
Kilafu
Set up the path for abstractions
hey,
I don't know but I wonder if maybe there isn't a more general problem going on right now (though it seems simple and wierd so I dont get it)
I am also having trouble loading abstractions even though I have done it quite a lot before, in particular (I posted this problem a few days ago but am posting in response to your problem in hopes that it might be a more global problem - though my abstractions, other than the ones mentioned below, load so I dont understand)
specifically, was the problem with the path not being recognised?
anyway -
Hello everyone,
This is a strange problem because I have loaded libraries and things with the 'Paths' dialog under the file menu before and had no problems.
I am trying to get Chris McCormick's s-abstractions to load. The folder is in the same folder as my other libraries and it is listed in both the "paths" and "startup" areas. It wasn't before but I added it.
I am running windows 7 64 bit. Another oddity that I noticed is that in my Program Files (x86) which is where the 64 bit programs live, I have pd installed and the folder is simply called pd. However in the Program Files folder (missing the x86, where the non-64 bit programs live) I have a folder called "Pd-0.42.5-extended"
I wonder if that couldn't be the problem. The s-abstractions folder is included in both though...
Hopefully somebody has some idea about this...
((anyway sorry to post twice but I hoped maybe there was some common problem there))
MIDI to Logic
Hey, I've got Pd sending MIDI notes to Logic no problem but it's only on one channel.
Basically I have two sets of MIDI notes connected to noteouts. One is called [noteout 1] and the other [noteout 2]. Like so:
[60] [70] [80] [90] [100] [110]
| | | | | |
[noteout 1] [noteout 2]
In Logic, I've set one software instrument to be on MIDI channel 1 and the other MIDI channel 2 but the messages from both noteout objects are being sent to both software instruments at the same time. So rather than [noteout 1] being a guitar and [noteout 2] being a piano, they're both both.
How do I send the MIDI notes out on different channels?
Running patch in the background (ascii to midi) to control Mainstage
Hello,
Brand new to Pd (just today) and was able to create an ASCII to midi convertor patch that allow me to trigger Apple's Mainstage from a wireless USB keypad.
And guess what, it worked (after a couple of hours messin' w/ it).
I actually have two small issues that would make this work better and hoping you might be able to help.
1. Due to the patch grabbing ASCII values from keypad, I need to have the patch as the forground application. Not a big deal because I can minimize the window and put it in the corner of the screen and still see/interact w/ Mainstage.
My question: Is there a way to have the patch in the background and still be capturing the ASCII keypad input?
2. I will be doing more research learning about Pd but thus far I could not find an object that would allow me to send anything other than noteout values. Mainstage does not accept note on/off values to control parameters (at least not in my test) but did accept midi data values after I sent the note on midi data through a midi filter program (midipipe for mac) and grabbed that value in Mainstage. I would like to eliminate running an additional program if I could.
My question: Can you suggest an object that will take the ASCII value and convert it other kinds of midi out value within Pd?
Thanks so much and I look forward to many more projects w/ Pd
Larry Knox
Couldn't create under \*nix :(
Hi all!
I'll use this first message to introduce myself to this forum and to ask for some noob-help
I'm Zoten, from Italy, and I'm studying computer science at Udine university.
A little time ago I've been get started with pd and data-flow programming for a little project, that I've just decided to enlarge.
So, my aim is now to make some interaction between some c++/qt application and PureData by LAN/web, but the problem is muuuuch before.
I'm an open source supporter, so I decided to make all under free OSs.
So, here's the problem:
I've got two stations, that I (want to) use to try my programs in real situation.
Station one comes with Sabayon 3.5 as OS, Pd compiled from sources, and station two with Ubuntu 8.04 (Hardy), Pd installed by GUI, but the problem is the same: I open my old project (a simple client/server synth that I want to use, between the others, to sniff some packets) and it starts to give error messages like
sendOSC
..couldn't create
OSCroute /adsr
..couldn't create
and so on.
If I try to send something via web it comes with an error,
error: inlet: expected '' but got 'send'.
Searching the forum for similar issues, I tried installing pd-extended on the 'buntu machine, but the problem, if possible, degenerated, with more "couldn't create" issues.
On Windows XP SP2 the project seems to work, so I can easily say that it is some installation-path-lib problem.
Anyone has any idea?
Fiddle~ and piano
Hello there,
I'm trying to get the signal from a piezzo mic stuck to a cello to send a midi note to an instrument. So, needless to say I've learnt quite a lot from this thread. Thanks for that!
Now, I'm having some trouble : fiddle seems to send a bang, and therefore a new noteout, every time it's trying to pick up a frequency. I don't know if I'm being clear, but the problem is that when I play a note on the cello, the patch sends A LOT of noteout, making something like a "swarm" of notes that becomes really chaotic in no time.
I tried to bypass this problem by sending a bang (and therefore a note) regularly, but that's obviously not a good way to do it.
What I would need is a patch that would detect the beginning of a note played by the cello, send the "noteout", wait for the beginning of another note to send the corresponding "noteout", and so on.
Any idea on getting this happening?
Here's the code, it's obviously very similar to what has been shown here
Cheers.
Rodolphe
Loopback devices, virtual audio devices?
i'm looking for a free solution too. i don't think my original idea is going to work out because i don't have the time to implement it. maybe some of you have ideas for the problem i am trying to solve.
the problem is this:
i am helping a professor with some research. for his research he is doing a case study on 3 composers. he is asking them to record a narrative of there thoughts on the composition process as they compose. for this, the composers will be working an a mac studio workstation putting the composition together in logic. a second computer, a pc , running audacity will be used to record there sounds. when the composer reaches what they consider a significant change in the program, we are asking them to save their project to a new file (so we end up with a series of files showing the various stages of the composition). we would like a way, however, to map the timestamps of those files to the 'timeline' of their narrative.
here are a few solutions that are not exactly desirable:
a. do not stop the recording at all and make a note of what time the recording started. this means that you can calculate what time speech is taking place by adding the number of minutes and seconds (and hours) to the time at which the recording started. the problem with this is that it will yield very large files which are not very practical, especially considering that we have to transcribe these files.
b. have the composers start each segment of narration with a timestamp: "it is now 9:15 on tuesday...." as part of the research methodology, this creates problems with the flow of a more natural narrative of the compositional process.
c. have the composers save each segment of narration as a seperate time-stamped file. the problem here is that this takes more time, and could create a lot of files that would be very annoying to work with when it comes to transcribing.
c. my idea was to have, instead of just input from the microphone, 2 streams of audio input,one on the left channel and one on the right channel. on the left, would be the recorded narrative. on the right, would be an audio signal that encodes a time stamp. i was think of simply convert a number such as DDMMHHMM (day, month, hour, minute) into DTMF tones. these could then be translated back into a timestamp. an 8-tone dtmf sequence would be generated every 10 seconds or so. this way, as long as the narrative segment was longer than 10 seconds, it would contain a timestamp. the problem with this is that i have no way to mix such a signal with the input from the microphone.
any suggestions would be greatly appreciated. thanks.