Playing sound files based on numbers/sets of numbers?
@whale-av Hello, first I just want to say thank you very much for your help and sorry for not replying sooner, I read all the messages, I just didn't want to bother people before I had an actual issue or a question that I understood enough to know how to ask what to do next. So that's why I'm only replying now. And you're totally right, I have suffered and learned in the past day so my brain's kind of all over the place right now, I'm still struggling to get the hang of this and really understand the patches you sent me (thank you so much for taking the time to make them for me!).
To answer your questions, I will not be assessed for this part of the project, it doesn't matter much how I do it as long as it works because no one will look at the project anyway, the end result is what matters in this case. The only "limitation" is that it has to be done in Pd. Also, my version of Pd is Vanilla (I'm assuming that doesn't change your patch much since you said it'd work in that version), and actually no, there's not really a next stage to this project; all I'm supposed to do is get my sound files to play in a loop when I press Enter (after I've typed all my numbers) and to be able to stop the loop again with Enter. I probably should have mentioned that oops, does that mean I need another keyup object or would the one in the patch work for both starting and stopping the sound?
I actually had a patch of my own but it was very simple and mostly improvised based on what I managed to learn (like I said, completely new to this) and nothing like yours so it probably wouldn't have worked anyway... Is it ok if I use your patch as a starting point? If it is, I'm assuming the next step would be the abstractions. From what I understand, abstractions are used for referencing and reusing old patches in order to keep the new patch clean and not messy. I do need something like that, as I have 17 wav files ready to use. But not all 17 should be used in one loop. I actually only need 5 sound files per loop (like in your patch), but the total number of files I can choose from is 17. To be able to tell the program which file to play based on its corresponding number I probably need the select object, right? Would I need it within the calling patch or the patch being called, a.k.a. abstraction (if my thinking is right, it's probably the calling patch)? There's probably an easier way to do this than an x number of select objects but I'm just not familiar enough with the program, sorry... Also, what difference does it make if it's not 1-digit numbers, but 2-digit, 3-digit and 4-digit combinations? To be more precise, the first, second and fourth sound file should correspond to a 2-digit number, the third to a 3-digit number, and the fifth to a 4-digit number (and I can't change this unfortunately, it's part of the task).
Oh, and is there a way I can make this work on any computer, for example if I copy my files onto a flash drive? Or if I can't, would it drastically affect my main patch if I changed the sound file destinations later, once I know what computer is going to be doing all this? Would I need to change the file destinations in all the patches or would it be possible to do so automatically via abstractions, by changing them in the main patch only (probably not but eh I asked...)?
This is all probably waaay too advanced for a beginner (and I have no idea why they'd give me this task without any prior preparation.......) so I realize I might be asking for too much here, and maybe I'm getting ahead of myself, but I still hope you could give some advice on what to do from here, what's the next step, the elements I need to get this done etc. I'm not in too much hurry, I have time until the 5th of February, so it's ok if you don't have the time for me right now, I can wait a bit!
Thank you so so so much, even just sending me the first patch was such a huge help, thank you! And I hope you can guide me through this for a bit longer!
Whoops! Missed this post, just found it by accident. Don't know if the OP gave up but might as well respond for the archive and mention that I finally filed a bug on this issue.
The known problem here -- as I have stated in other threads -- is probably not a midi clock issue but Active Sense messages (the Yamaha PSR-E323 midi implementation chart indicates that these are implemented in that device). Active Sense is part of the System Realtime group of commands in the midi spec (also includes clock, stop, start, and continue).
If configured correctly, Midi Patchbay on the MAC will stop these messages, but it can only be configured to block the entire System Realtime group. If the other messages are needed, a more selective option might be Midi Pipe, thou I have not yet tested this. It can be downloaded from here:
See also these threads:
Pd quits when opening Midi settings
Which version of Pd and on which operating system?
Can't say for sure what's up, one long-standing issue with Mac and Windows PD is that PD has never had a proper software midi interface between the app and the system. What it does have is a hack-in that will connect PD midi to - at maximum - the first nine ports on the system's midi port list and nowhere else. ATM only ALSA MIDI on linux has anything close to a fully interfaced PD midi to system buss.
To get full access to the max available midi porting on Mac/Win you have to start with all midi ports on the system deactivated. You then have to use 3d party midi patching software such as Midi Patchbay on Mac (don't use IAC leave it deactivated) or an equivalent Windows program to create nine virtual midi ports to occupy those first eight slots on the system list. Start PD and connect it to the nine virtual ports. Activate all the other midi ports/devices that you need on the system, then use the patching software to do the actually midi routing to external software and devices.
If the above sounds ridiculous -- it is! Supposedly this is actually being worked on (finally) but it requires a major rewrite of badly botched coding. Most of the Pd coders don't really "get" midi and the few that do haven't been very active since they contributed the ALSA code. Take it from someone who has written multiple midi synth editors with Pd-- there's a reason I prefer PureData on linux.
Wavetable Drum Machine - repost
I uploaded this Wavetable Drum Machine last year but it became a casualty of a server issue (I hope it didn't cause it, it is a bit heavy). Anyway it didn't work under windows so while I was updating old drum machines I sorted this one out.
Here's the instructions, which are also under the Balwyn button.
Wavetable Drum Machine
8 x bank of 64 amplitude sliders, each bank runs in sync driven by a clock. The clock has 16 start/end settings plus a repeat cycles setting, there is also a Vradio block to set the return position.
The mixer block has 8 x level & pan settings with stereo to the dac~
The wave selector is for loading the individual wav files to the relevant drum line. The *.wav files must be stored in the 'waves' folder within the program folder and selected from there.
Saving must be saved to the 'pattern' folder within the program folder. Save the file with one word and no extension, a file of that name will be created for the pattern settings. Another file with the same name will also be created with the extension '.kit', this stores the names of the wave files.
Loading must be from the 'pattern' folder within the program folder. All the clock, pattern and wave files will be updated. select only the file WITHOUT the .kit extension, otherwise nothing will load and soundfiler errors will appear in the Pd window.
The clear button will clear all the amplitude sliders, set all the clock settings to 1 except BPM which is set to 500.
The supplied samples were recorded via Audacity from Qsynth. Ditch them for your own
Is there a function that works like a table but with only one value?
in short: it's 1 float stored in 1 object of a separate data structure referenced by a pointer in each value object
in longer: when you create a value object with a given name. it checks to see whether a second class called vcommon has any objects that share the same name as the new value object. If not, it creates a vcommon object with that name and stores the float value inside. Then the value stores the pointer to this float and looks up that float using a pointer whenever it needs to modify or get the value (as do all of the other value objects that share the same name). The vcommon object knows how many value objects share it's name (a "reference count") and when the last value object with the same name is deleted, so is the vcommon object
current keydown arpeggiator
Seems like you are getting there…. I was not aware of the [text] object before…….
In case it's useful to you:
The idea of linked lists is that you would have 2 arrays -
1 storing the note values
1 storing a pointer to the next value to be played
for example if your arrays are
NOTE and POINTER
when the player presses C you might store
60 in NOTE (0) & 0 in POINTER(0).
if the player adds E then you would store:
64 NOTE(1) & 0 in POINTER (1) & 1 in POINTER(0)
so each time the player adds the nth note to the arpeggio, you store the note in NOTE (n) and you store a 0 in POINTER (n), and you store n in POINTER (n-1)
If the player releases a key then you just have to update the POINTER array so that the value BEFORE the released key now points to the value AFTER the released key. you don't have to bother tidying up the NOTE array until all keys have been released.
So you would search for a member of NOTE that matches the released key.
if you call that the nth member, then all you have to do is set POINTER(n-1) to the same value as POINTER(n).
This would also definitely be a useful technique if you wanted to do an up/down arpeggiator where the player can add and remove notes.
libpd on mac: clarification requested on expected behavior of cpp sample
Hi! I am running Pd-0.47-1-64bit on Mac OS 10.11.6 and libpd 0.9.2. I am trying to work with the samples/cpp/pdtest. Here's the github repo. I currently have an app that takes video and spits out a 2D array of color values for regions of interest to file. I have a pd patch that then loads those into a table and plays the corresponding pitch. I need the two (patch, c++ app) to coordinate the IPC.
I compiled the cpp code in the samples directory however, when running pdtest executable there is no patch opened. Is this by design? I was not able to find a pd-vanilla to build from source so took the most recent (pd-0.47-1-64bit.mac.tar.gz). Does libpd need to have the pd built after libpd? If so, can anyone please point me to a src file?
Here is a truncated output from running the compiled pdtest. Could someone tell me if this is what is expected?
Thank you for your help.
BEGIN Patch Test
Patch: "pd/test.pd" $0: 1003 valid: 1
Patch: "pd/test.pd" $0: 0 valid: 0
Patch: "pd/test.pd" $0: 1005 valid: 1
PD: PATCH OPENED: 1003
PD: PATCH OPENED: 1005
FINISH Patch Test
BEGIN Message Test
FINISH Message Test
BEGIN MIDI Test
FINISH MIDI Test
BEGIN Array Test
array1 len: 10
array1 0.0857145 0.328572 0.500001 0.57143 0.514287 0.47143 0.357144 0.285715 0.057143 0
array1 0 1 2 3 4 5 6 7 8 9
array1 10 10 10 10 10 10 10 10 10 10
FINISH Array Test
BEGIN PD Test
FINISH PD Test
PD: symbol test string
PD: symbol test string
PD: 1.23 a symbol
PD dollar zero: 1.23 a symbol
PD: 1.23 sent from a List object
PD: msg 1.23 sent from a List object
PD: 1.23 sent from a streamed list
PD MIDI: notein 2 60 64
PD MIDI: ctlin 2 0 64
PD MIDI: pgm 2 101
PD MIDI: midiin 1 239
PD: symbol test
PD: START MSG TEST
CPP: bang toCPP
CPP: float toCPP: 100
CPP: symbol toCPP: kaaa
CPP: list toCPP: 100 2.3 test 1 2 3 ffsfff
CPP: message toCPP: kaa 1 2.3 test ffs
PD: MSG TEST FINISH
PD: START MIDI TEST
PD: MIDI TEST FINISHED
PD: START ARRAY TEST
PD array1: 10
PD array1: 10
PD array1: 10
PD array1: 10
PD array1: 10
PD array1: 10
PD array1: 10
PD array1: 10
PD array1: 10
PD array1: 10
PD: FINISH ARRAY TEST
PD: test_abs: Hello World!
CPP MIDI: note on: 0 0 127
CPP MIDI: note on: 0 0 127
CPP MIDI: note on: 0 60 64
CPP MIDI: control change: 0 64 100
CPP MIDI: program change: 0 99
CPP MIDI: pitch bend: 0 2000
CPP MIDI: aftertouch: 0 100
CPP MIDI: poly aftertouch: 0 64 100
CPP MIDI: midi byte: 0 239
CPP: float env: 75.5457
CPP: float env: 87.9506
CPP: float env: 93.5842
CPP: float env: 88.5503
CPP: float env: 87.7612
CPP MIDI: note on: 0 0 0
CPP MIDI: note on: 0 1 127
CPP: float env: 86.8932
CPP: float env: 41.2584
CPP: float env: 0
CPP MIDI: note on: 0 1 0
CPP MIDI: note on: 0 2 127
CPP MIDI: note on: 0 19 0
CPP MIDI: note on: 0 20 127
Sending record/play/pause/stop etc. to a sequencer supporting mmc/cc
@RickyGWave Hello Ricky......
You will need a midi loopback program so that the midi output of Pd can be sent to the midi input of Propeller, unless you are using osx, in which case I think you can use the built-in midi-settings to loop the midi internally.
Try http://www.tobias-erichsen.de/software/loopmidi.html for windows.
Then you send a midi note from Pd to a named midi output.
You set the midi output in Pd under the Media tab.
In Reason (propeller?) you set the same name as a midi input, and then activate the learn function for the record button. When you send the note from Pd by clicking the message Reason will associate that note with the record button.
Need help with patch for a glitch project
@Sarabade Hello Sarabade......
If you google the wikepedia pages for all the different file formats for video and still images you will see that all of the files will have a header, which tells the operating system how to interpret the file (even the uncompressed formats like .bmp). If you glitch (corrupt) the header then the file cannot be read.
So you must not corrupt the data until you are a few (or a few thousand) bytes into the file (how many depends upon the file format...... jpg, tiff, bmp etc..)
I have found Antonio Roberts file on my computer and modded it to send out the ascii codes...... it might provide a start for your project........
JPG - binary - killer_mod.pd
Look into (right-click-open) one of the green abstraction boxes to see how you could write your new file..... and save it......... and importantly how you can avoid modifying the header.......
You cannot use [send glitch_ascii_code_list] as the header codes are already broken!!...... it is just for viewing in the terminal...........
If you try to write the actual ascii "symbols" to a message file then you will get the "closing brace" messages that you are seeing.......or worse! Pd will try to interpret some characters as "control" messages, and that will crash Pd. You will have to work with the numbers that represent the "characters" (ascii or binary) and not the "text" characters....a,b,c, etc......
Idea for Effects Stack(ing) Technique/Control ("Mother")
To begin, I apologize in advance for this Not being a complete abstraction, so please forgive me for that.
As apology, I offer my humility: 10 hours-straight work later, I know some of what i thought of is beyond my knowledge limit and capacity to continue working on.
That all being said,...
My idea (which I thought would be Very simple, yet learned that PD, no matter how sweet She is, does not behave like the linux shell) was simple:
Make a rack of a set of vradios (i chose 8 due to the cpu limit on my laptop, but more could easily be added) which each denote a set of effects;
Send the results to a shell control along with the "slot" in the stack;
Have it copy that effect into an eff(ects)/tmp folder (mapping over the dummy files that were there),
so when the adc~ > eff1 > eff2, etc., chain runs they would be loaded as copies of the desired effects abstractions.
My intention was to empower the usage of multiple instances of the same effects abstractions as well as cut the wiring required in many/my pedal rack/s I have seen to almost nil.
That Was accomplished.
And I DO like the "idea".
On the other hand, I learned, to my chagrin, 2 VERY important lessons:
- pd loads all subpatches on startup
- there is no (this is were I bow to higher minds than myself) way to "refresh" the patch, shy of closing and reopening it (because while you can do this sort of thing in linux, you can not in pd "underwrite" a subpatch and presume it will know the change has been made).
I Did pursue trying to load via "cat" the effect file-contents into a pd (sub)patch object, but could not figure out how to make that work, even with subtracting the file accouterments, i.e.#X, #N.
In closing I will say that the goal, though only partially achieved, IS one worth pursuing if it is a domain you are more knowledgeable about than myself.
I have attached a zip of my work.
a shell script to start extended (it must be started this way, if the shell object is to know where the resource folder is located;
a folder, "res", which includes: /effs (where you put your effects abstractions), /effs_tmp (with 8 dummy files, where your effs get copied to), and /helper (where Mother is located)
a Mother_effsmap.txt file, where you list your effects, by filename (including the ".pd" extension", which it cross-references the vradio index to the line number on the file to know which file to copy.
I have found that it does copy correctly, but then you are left with the stack of controls to contend with. But I have yet to figure that out and think it better to go ahead and share it.
-peace, thanks for listening, and I hope it gives you some new ideas to work with.