-
robertesler
posted in extra~ • read more@kroklop92217 glad you figured it out! Good luck with creating the rest of your external.
-
robertesler
posted in extra~ • read more@kroklop92217 your lock is implemented fine, but I would just surround each case with a lock and unlock instead of locking the entire function, I don't think it matters much, but it's cleaner to read:
case 0: //read from timrax pthread_mutex_lock(&x->mutex); xpos = va_arg(args, int); ypos = va_arg(args, int); va_end(args); pthread_mutex_unlock(&x->mutex); return x->m_state[xpos][ypos];The problem potentially could be the call to
matrix_rw()in the perform function. You want to read and write all data in the DSP thread via the object's dataspace (the struct that holds all our variables, etc), so instead of:t_float stat = matrix_rw(x, 0, 2, 0, 0); //read for(int u = 0; u < len; u++) { *sig_out++ = *(sig_in++) * stat; }You would want:
for(int u = 0; u < len; u++) { *sig_out++ = *(sig_in++) * x->stat; }And write the value of the x->stat float in the OSC handler (make sure to add the variable to your struct before):
x->stat = matrix_rw(x, 1, 3, x->posx, x->posy, x->val); //writeThis may not solve the issue entirely as there could be other things going on too. Make sure the value of
statorx->statis what you expect it to be. You can always usepost("%d", x->stat);in the perform function to debug that kind of stuff.
If that doesn't do it, then something else is happening, so maybe post all your code again and I can try building the external and see if I get the same results. -
robertesler
posted in extra~ • read moreHi @kroklop92217. No worries, Pd's external API is tricky to figure out at times.
Have you tried removing the symbol fromvoid simple_matrix_tilde_osc_recv(t_simple_matrix_tilde *x, t_symbol *s)and replacing it with a float input?
This way you could check if your signal is working properly by just feeding it 0 or 1.
So to test change that function to this:void simple_matrix_tilde_osc_recv(t_simple_matrix_tilde *x, t_float *f)and thisclass_addfloat(simple_matrix_tilde_class, simple_matrix_tilde_osc_recv);Then just create two messages [0 ( and [1 ( , connect them to your first inlet and see if this does what you want. If so, then chances are there are problems with your OSC handling. You could be having issues with Pd trying to access the matrix value out of sync with the OSC thread, which could give you bad data. There may be other things going on too.
You probably should lock the data in the OSC receiver, via a mutex so that the DSP thread cannot read it unless it has the lock. This would mean refactoring your code a bit. I don't have time to do that at the moment but if you need help gtting started, just write back. -
robertesler
posted in libpd / webpd • read moreIf you are set on using just the native iOS UI tools this solution probably won't work, But I maintain a cordova plugin for libpd, you can find it here: https://github.com/robertesler/cordova-pd. There are instructions on how to use it on the README page. With cordova you can use HTML5/Javascript for your UI and interface with a Pd patch. Cordova will allow you to create an iOS platform which generates an Xcode project.
Otherwise, the examples on the pd-for-ios still 'should' work. I haven't tested all of them for at least a year, but that is also worth a shot if you really need to use native iOS UI tools.
Good luck! -
robertesler
posted in libpd / webpd • read moreGetting 3rd party externals with libpd on iOS is not that straight forward. Because iOS doesn't allow dynamically linked libraries, you have to statically link them. So you have to include all of the source code for each external in your Xcode project and then called their
external_setup()function in the ApplicationDelegate.m or somewhere in your code. You can see more about this here: https://github.com/libpd/pd-for-ios/wiki/ios
As for abstractions like out~.pd, those can be put with your patch in the Resources, or sub folders and use the [declare] object. They work as expected since they are just text files.
This doesn't mean the externals will work as expected, they may have bugs or other issues on the iPhone chips (arm64), or have other issues when actually running on a device. -
robertesler
posted in libpd / webpd • read moreHi @mcbublick. Are you using the examples included in the repo? Are you testing on a device or emulator?
That message means that the externals were probably not included with the application. So there may be a step missing in the Android project.
Is it just one external that is not created, or is it multiple? If so which ones?
You could also use the Android Studio APK Analyzer to look at the .apk file and see if there is a /lib folder with all the proper dynamic libraries like libpd.so, libbob.so, libpique.so, etc.
I haven't tried the repo examples in a long time so I can't say whether they still work or not. -
robertesler
posted in technical issues • read moreHi @sadielcuentas,
I don't know if there are alsa drivers for ARM architectures, but the Linux kernel used by Andronix won't be able to use them anyway. You have to install the Ubuntu Studio audio package:sudo apt-get install ubuntustudio-audio
After that in Pure Data choose "portaudio" in the Media menu. It should default to pulseaudio. Also make sure you have started pulseaudio in the terminal before starting Ubuntu:pulseaudio --start
This version of Linux is very limited with which audio software you can use, anything that relies on Jack or ALSA won't work. So no Audacity or Ardour. But I have gotten Pd, Cecilia, LMMS, REAPER and Processing working so far, among others. -
robertesler
posted in technical issues • read moreI don't know if you figured this out or not. For me Pd-l20rk was not on the MacOS list of applications with permission to access the microphone. Pd-l20rk did not prompt for microphone access for whatever reason. Since I'm on a university machine, my only choice was to open Pd-l2ork via the command line. This worked but now the only way to ensure microphone permissions is to open it via Terminal.
I put the direct path to the executable in the command line:/Applications/Pd-L2Ork.app/Contents/MacOS/nwjs -
robertesler
posted in technical issues • read more@sadielcuentas I don't know if you figured this out yet. I was able to get Pd to work using Andronix with Ubuntu 20.0.4. At first it didn't work as you documented. However, after I ended up installing ubuntustudio-audio it ended up working.
I had to choose "portaudio" in the Media menu then it saw pulse audio as the output. I can only get sound out at the moment. I don't know if input is even an option but at least it works somewhat.
I hope this helps someone.