Objects for bangs ???
Cheers but not what i'm looking for. I am trying to use a wii remotes Yaw and Accel values to trigger a hit when the wii mote is waved/hit in a certain manner. At the moment I am having to use a past object so that when it hits .9 on the pitch it bangs and then only resets once it falls below that number. However, this works to an extent but when waving the wii mote in opposite directions, as in hit up and hit down you will essentially be causing the same values to be hit. So I am using a repack to split up the data from the wiimote to then be analysed by a series of past and onebang objects. Just to try and give some more accuracy to each individual "hit" that I am trying to program.
I'm sure I read of what I think I need somewhere when just browsing at useful objects but unfortunately all I can remember about it is the goddam quote on it's help page of "like a traffic light for bangs." Might not work how I imagine though.
Comparing Arrays
Hi,
I'm trying to compare the timings of two sets of data, consisting of only 1s or 0s.
Basically I have an input audio file that has a '1' representing each hit of a drum pattern. There are going to be different variations of this audio file as I hope to automate parameter changes in the creation of the file. Therefore I want to test this input file against a set pattern that I know is correct to see how accurate the algorithm that creates the audio file is.
I was just wondering if any of you clever guys might have any ideas on how to achieve this.
At the moment I'm using an array that stores the correct pattern from a step-sequencer in the same format as the audio input file. Then using [klashnikov] I count every '1' in both tables. By subtracting the pattern array count from the input array I'll get a number that indicates the accuracy. If the result is 0 then it must mean that there are the same number of hits in both files, if its a minus number then there must be too little in the input file and if its greater than 0 then there are too many.
However, I wanted to introduce a sort of window. So that the input file hit could be within so many samples of the pattern hits.
My knowledge of dealing with arrays is limited, but I feel there must be some object/function that would helpful that I'm overlooking.
Any ideas would be extremely helpful. Hope I've explained it properly.
Cheers,
J
Creating metallic klangs, bullet hits and doppler-effect?
I just started with with PD and I'm trying to create a bullet hit generator patch (hitting a car or some such large metallic object), but stuff I've come up with sounds more like bells or musical instruments than bullet hits (more "pling" than "thud-plong").
I'm using noise source and impulse (taken from kalashnikov tutorial by obiwannabe) with six bandpass filters with high resonance, but how do you people go about creating less musical sounds? My sounds are way too thinny, they sound like penny dropping and not like mass of metal hit violently.
Also, what would be the way to do a sound of bullet whizzing past the listener, tumbling in the air (that is, how to do doppler shift effect)? I didn't find PD examples on google, maybe because it's so trivial. I was thinking if bandpass filter with moving frequency would do the trick (from high to low)?
Thanks!
Bonked beat slicer
Since the detection is a one time deal it's just a matter of putting it in its own subpatch and using switch~ to turn it off after mapping the hits.
An even more sophisticated way of doing it would be to then to save the hits map to the disc using the sample's MD5 hash as a reference. That way if that file exists just load it instead of detecting the hits, if not detect the hits and save it.
By using the MD5 rather than the filename you guarantee that any changes done to the original file force re-detection by the patch. Another side effect is that you might have the same file copied with different names and they will still have the same MD5.
Don't think there is an md5 object in pd. I'll whip one up later.
Live Mic'd Vocal Manipulation
Okay, so I made a little patch comparing the table approach and delay approach, and they both have their ups and downs. For one, the table method will only allow you to speed/pitch down for the most recent audio. Faster playback will result in the virtual playback head to pass in front of the record head, causing it to playback previously recorded material, which I get the feeling isn't what you're after.
The downside to the delay method has more to do with the fact that I just can't remember how to go about determining the exact transposition you're looking for. But it does allow for longer playback than the table method using the same size buffer. This is because the playback head is always following the record head and can thus wrap around the buffer before reaching the max buffer length or catching up with the record head.
I used the [cos~] object to generate an envelope. This is what is used in G09.pitchshift.pd. The difference is that there are two of them, offset by 180 degrees. These envelope to delays playing back at different speeds, and as one delay is silent the other is at max peak. They are essentially crossfading in and out with each other. The silent one is switching from the beginning of the delay line to the end (or vise versa, depending on the pitchshift) while we can't hear it. So basically it plays short snippets (or grains) at different speeds to change pitch, but the start times of each grain are relative to the input signal so there's no sense of timestretching.
Something like that.
I don't know what's going on with the math in the transpose section, I just know it works!
Problem compiling external on Windows
I'm having trouble getting the helloworld external to compile properly on Windows.
The main resource is apparently this: HOWTO write an External for puredata, and some previous posts on this topic are here: Compiling new external, Max/MSP microtuning externals to convert to pd
Bear with me, because working with the C compiler is still rather mysterious to me, so I may be making some obvious mistakes. I've installed the djgpp compiler, and followed all the instructions as best as I could. I'm working on XP. I put "m_pd.h" (from the pd/src/ folder) and "helloworld.c" in the same folder and from that directory on the command line (in a DOS "Command Prompt" window) typed:
gcc -c helloworld.c -o helloworld.o
As far as I can tell, this successfully produced the "helloworld.o" object file in the same directory as the "helloworld.c" file. Then I typed:
ld -export_dynamic -shared -o helloworld.dll helloworld.o -lc -lm
Which, as I understand, is the "linking" step, and the only difference between this command and the command for linux is that ".pd_linux" is replaced with ".dll". Anyway, the compiler responded with:
c:/progra~1/djgpp/bin/ld.exe: -shared not supported
So, not having any other ideas, I tried omitting the -shared flag:
ld -export_dynamic -o helloworld.dll helloworld.o -lc -lm
That produced this response:
c:/progra~1/djgpp/bin/ld.exe: warning: cannot find entry symbol xport_dynamic; defaulting to 000018d0
helloworld.o:helloworld.c:(.text+0x1e): undefined reference to `post'
helloworld.o:helloworld.c:(.text+0x37): undefined reference to `pd_new'
helloworld.o:helloworld.c:(.text+0x60): undefined reference to `gensym'
helloworld.o:helloworld.c:(.text+0x79): undefined reference to `class_new'
helloworld.o:helloworld.c:(.text+0x96): undefined reference to `class_addbang'
Why is -shared not supported and what can I do to fix that? I tried Microsoft Visual C++ Express Edition, but found the interface bewildering. I don't think I could even find the words "compile" and "link" in any menu...
Then I looked in the "0.README" file located in the pd/doc/6.externs/ directory, and found this line (in reference to the 3 example enternals in that folder):
To compile, type "make pd_linux", "nmake pd_nt", "make pd_irix5" or "make pd_irix6".
If I wanted to compile these, where would I even type this? Is "nmake" an actual command?
Then I tried poking around the GNU info files, and saw some vague information about "binutils" and "dlltool" but it is so beyond me right now that I'm turning here. Could someone please enumerate the steps required to take the C source file "helloworld.c" and make it into a usable object in pd without skipping any steps? I (and I'm sure many others) would greatly appreciate that.
Thanks in advance!
Help needed with PD externals
I don't know how this slipped through, its an old post, but just in case you didn't find it already there's a full howto at
http://iem.at/pd/externals-HOWTO/
which has everything you need to get started
One pitfall not mentioned is you need to link as shared object/dll rather than executable.
Threshold~ not working correctly
I am building a drum system with piezo sensors connected to the input of a pic microcontroller, the data from the piezo's is outputted from the microcontroller over a serial interface and then into PD using the comport external.
The data is being transmitted perfectly, i'm using threshold~ to fix a hit threshold value and decay time for each hit, it works for most hits but it seems to miss some hits. Any ideas as to why it would miss out some hits ?
Joystick.pd Help
I'm sorry for the completely noobish questions, but where would I connect the number boxes too? Would I connect them to the autoscale 0 1 boxes? When I do that, I get a lot of errors after pressing start:
/usr/local/src/hid-0.6/hid.pd_linux: /usr/local/src/hid-0.6/hid.pd_linux: ELF file data encoding not little-endian
hid $1
... couldn't create
autoscale 0 1
error: inlet: expected '' but got 'start'
Is it possible that it does not have the right joystick. It is at /dev/input/js0, so how would I tell the patch that?
Thanks for all the help