Android processing and Purr data communication
Hi!
I have a new problem,
Everthing is working but not when I want to use the accelerometer of the phone, that's really weird.
Processing is receiving but not PD
Processing code:
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import oscP5.;
import netP5.;
import controlP5.*;
ControlP5 controlP5;
OscP5 oscP5;
NetAddress myRemoteLocation;
Context context;
SensorManager manager;
Sensor sensor;
AccelerometerListener listener;
float ax, ay, az;
void setup() {
fullScreen();
frameRate(25);
// create a new instance of oscP5.
// 12000 is the port number you are listening for incoming osc messages.
oscP5 = new OscP5(this, 12000);
myRemoteLocation = new NetAddress("192.168.137.1", 12011);
controlP5 = new ControlP5(this);
context = getActivity();
manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
sensor = manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
listener = new AccelerometerListener();
manager.registerListener(listener, sensor, SensorManager.SENSOR_DELAY_GAME);
textFont(createFont("SansSerif", 30 * displayDensity));
}
void draw() {
background(0);
text("X: " + ax + "\nY: " + ay + "\nZ: " + az, 0, 0, width, height);
}
class AccelerometerListener implements SensorEventListener {
public void onSensorChanged(SensorEvent event) {
ax = event.values[0];
ay = event.values[1];
az = event.values[2];
print(ax);
print(ay);
print(az);
}
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
}
void mousePressed() {
/* in the following different ways of creating osc messages are shown by example */
//OscMessage myMessage = new OscMessage(int(knobValue));
//myMessage.add();
OscMessage myMessage = new OscMessage("/test");
myMessage.add(ax);
myMessage.add(ay);
myMessage.add(az);
/* send the message */
oscP5.send(myMessage, myRemoteLocation);
}
PD code:
[import mr peach] -----> [udpreceive 127.0.0.1 12000]--------->[unpackOSC]------->[routeOSC /test]---->[number]
I've already try like that too :
[import mr peach] -----> [udpreceive 127.0.0.1 12000]--------->[unpackOSC]------->[routeOSC /test]----> [unpack f f f]-------->[number]
Thanks in advance
[mymembrane~] - Acoustic Drum Synthesizer
@metaphysician Sure thing, ask away here or in a private chat. My discord username is Mike Moreno#1780
[mct~] is additive synthesis using different envelope curves for each harmonic.
[piano~] is pretty straight forward, just 3 karplus-strong operators a little bit detuned.
I still want to make a better, more realistic piano sound, but in order to do this I need to understand how to create inharmonicity using allpass filters.
Judging from an spectrograph of a piano sound, the upper harmonics seem to be gradually shifting from the fundamental frequency, there's even a little bit of pitch modulation. Here's a good reference using additive synthesis min 1:46
Le Grand Incendie de Londres
Hi guys, here is my new solo project. Interaction between synthesis sounds (karplus strong) and piezo feedback. The feedback sounds are actually produced via fft cross synthesis between the feedback itself and the synthesis sounds. The idea is to create an "organic" quality from synthesis sounds. I'll be touring with this project, contact me if you're interested!
PdDroidParty MIDI in/out
@bamboomusic Well..... it's a maybe..... post Android 6.0...... https://source.android.com/devices/audio/midi
You could ask chris(at)mccormick(dot)cx ...... DroidParty author.
If not, then you could create a network over usb when you plug the Android OTG to your computer.
And if you get no-where with that then you could buy an OTG >> Ethernet adapter to plug to your computer........... but a s/h wireless Access Point..... (WRT54 series or similar) is probably cheaper.
David.
PdDroidParty MIDI in/out
@bamboomusic As I understand PdDroidParty it is for running a Pd patch on an android device.
You will need it to send OSC messages over the network to control a patch on your computer that deals with the midi.
Look to use [netsend -u -b] and [oscformat] on the Android patch (if they are included in the list of vanilla objects that will work with PdDroidParty)....... and [netreceive -u -b] and [oscparse] on your computer.
Then use the incoming OSC messages to control the midi objects on your computer.
You can just use [netsend] and [netreceive] and work with lists.... but OSC messages are more human readable.
The really simple solution is to buy a copy of the "TouchOSC" app for Android. Your Android interface will be much prettier and easier to build. It can send OSC and midi messages and has some ready-built templates for many DAWs. Once purchased (I think it is about $5-$6) you can put it on all your Android devices.......... https://hexler.net/software/touchosc-android
David.
Audio Settings for multichannel with MOTU 828 mk3
Hi Matthieu,
I see your post is a little bit old but I'm experiencing the exact same problem now with my setup.
I'm using a Windows 7 machine with a MOTU 828x sound card connected via USB to the PC and Pd 0.48.1 vanilla.
Here what I've done:
- I've checked the "Use Stereo Pairs for Windows Audio" inside the "MOTU Audio Console";
- opened PD and selected "standard MMIO" as driver from the "Media" menù;
- now here's the list of outputs as it appears from the drop-down menu of "Media/Audio Setting.../Output device":
- MOTU Analog 3-4
- Loudspeakers (devide High ...
- MOTU Main-Out 1-2
- MOTU ADAT optical A 3-4
- Digital Output MOTU Audio
- MOTU ADAT optical A 1-2
- MOTU Analog 1-2
- MOTU ADAT optical A 7-8
- MOTU ADAT optical B 3-4
- MOTU Analog 7-8
- MOTU Analog 5-6
- Digital Output
- MOTU SPDIF 1-2
- MOTU ADAT optical B 1-2
- MOTU ADAT optical A 5-6
- MOTU Phones 1-2
As you see this list is pretty messed up and the names of logical consecutive output channels are not consequential. I would like to have 8 analog outputs from my MOTU so I selected the first item on the list (MOTU analog 3-4) then specified a total of 22 channels.
I'm obliged to set 22 as the total number of output channels because in my list MOTU Analog 5-6 are the last analog elements present. Because items in the list represent pairs of channels, this item corresponds to logical channel 21 and 22.
- Then I created the dac object this way:
[dac~ 13 14 1 2 21 22 19 20]
Here's an image
This way I'm able to hear sound on all analog outputs of the MOTU even if I'm experiencing variuous 'clicks' and a series of "resyncing audio" messages inside the PD console...
I confess, this method is the only way I'm able to make this setup work but it seems to me to be pretty messy and not intuitive at all.
What seems to be even worse is that analog audio outputs inside the device list seems to change their order at each computer restart, so every time I have to restart from scratch.
- Is there some easier solution to this problem?
- Maybe a preference file I can create for PD to load at each startup containing all these settings?
- or there may be a way to programmatically select correct "analog outputs" from the device list in my patch (even if string parsing doesn't seem to be so easy in PD to me).
- Would launching PD from console, maybe from an ad-hoc script, solve the problem?
Thank you so much for your support
M
Ofelia Jump On Click Slider
@cuinjune sorry, i forgot to add the synth patch. [Additiv-syntes] is this synth from Max Björverud (slightly modificated, i will upload it later): https://patchstorage.com/additive-synthesis/ i have some ideas for generating (poly)rhythm and melody, saving and sequencing patterns that i want to implement. some more general things: it would be nice if it is possible to type numbers into the numbox, like in pure data. and i was wondering if its possible to continue the audio stream if you drag the ofWindow in "pure data mode" (like it works as a standalone application / does not matter if it is not possible). i was thinking about modularity and ofelia and had the idea of making more complex gui objects like sequencer or synth modules that are draggable and connectable (with fake patch cords ?), also "dynamic patching" could be nice, so that it is possible to create and destroy modules. another way would be to use several standalone applications and make them communicate via osc or midi (but then its not possible to pass audio signals from one application to another). it would be very nice to use the ofelia gui elements as "gop`s" inside pure data, but i know its not possible. or the best concept is perhaps to to use ofelia to build stand alone applications where the connection between modules is fixed and everything happens in one window (like a "groovebox") or just to create visuals like with gem? i am not sure if it makes sense, just some brainstorming
Lissa Executable / ofxOfelia compile error (Solved)
Here is the Executable: https://we.tl/guYbiuftrX
Lissa.exe is the Executable, and in the path /data/pd is the pd patch. The left mouse button pressed on the ofelia window changes the pattern, the right the texture and the soundlength. + and - changes the number of edges. Also Audio is working (but no midi). For sound synthesis I borrowed and modified this synth: https://patchstorage.com/additive-synthesis/
i like the sound but i think about changing it or making it slower without slowing down the animation.
@cuinjune thanks for ofxOfelia, nice work. I think now I understand the concept.
have fun
16 parameters for 1 voice, continued...
@whale-av hey, so I made this patch, it doesnt have abstractions, i havent practiced them yet, but would this be considered additive synthesis? 5 sinewaves, different frequencies, and start at the same volume but end differently...additive synthesis.zip :0,
for additive synthesis each sine must be at a different frequency and volume right? so I could be making glissandi in pitch and volume and it would still be considered additive synthesis?
how to start with libpd (and processing or something else) on windows 10 64bit?
i want to start with libpd to build more efficient guis than with pure data alone.
pure data is my first programming language but i am willing to learn something else for using libpd.
it would be nice if i cannot compile only mobile versions but also for windows, linux or mac os.
so i thought libpd with processing could be a good starting point.
but its not as easy to get started as mentioned on the github page:
"If you just want to use libpd with Processing, then you can unpack the file pdp5.zip into the libraries folder of Processing. On my Mac, that folder is Documents/Processing/libraries."
https://github.com/libpd/puredatap5
especially ProtoDROM sounds interesting: https://makezine.com/2012/09/24/protodrom-prototyping-with-pure-data-and-processing/
does anybody run puredatap5 on a windows os, and knows how to make it work?
or is there a programming language/enviroment like unity or android studio that works better/easier on windows with libpd?
here is some additional information i found about libpd and processing.
https://forum.pdpatchrepo.info/topic/9814/pd-processing-in-android-mode-is-it-possible
http://robertesler.com/libpd-with-processing/
https://forum.pdpatchrepo.info/topic/6741/how-do-you-package-pure-data-with-processing/4
http://futurewerk.tumblr.com/