how does [list drip] actually work?
it's a recursive thing: I'll walk through part of an example:
say the list has 5 elements.
The list comes in, and goes into the open spigot.
so at this point the [t a a a a] is sending a list of 5 elements. the following is what happens to the right [list-split] at this moment:
the first 2 elements of the list are sent back to the upper trigger, and go back into the spigot, where they are split again into lists of length 1. element 1 goes back into the upper trigger and out of the outlet, and then the second does as well.
All of this happens before the list of 5 elements is even sent to the left [list split], because of the trigger. A similar thing occurs:
the last 3 elements of the 5-element list are sent to the upper trigger and into the open spigot, and then the first element of that is split off and sent out the outlet. Then the last 2 elements are sent through the spigot and split, and are sent out in order.
The crucial thing to understand is the recursive nature; it has to do with the depth-first message passing in pd.
The first half of the list is split off before the second half, and sent to be split in half again before the second half of the original list is even processed. So it goes the first half of the first half of the first half, etc. until the first element is sent to the outlet. Then it goes back up the "stack" to the second halves of the lists that it missed in doing the first half every time (this happens because of the triggers). So after the first element is sent, the second element is sent. After that, elements 3 and 4 (in a list since they weren't even processed to be split yet) are split and sent out in order. then elements 5-8, which are still in a list, are sent back and processed in the same manner.
Hopefully that's somewhat clear..
(rambling extra stuff:)
From a "computer science" perspective, you could say that you process the first half and put the second half on a "stack" , and then go into the first half, split it in half, put the second half on the "stack", etc. And then after the 1st element is put out, repeat that process for each thing on the top of the stack until you end up with 1 element:
in "pseudocode" (with a datatype "list" and an assumed stack):
function splitlist (list inlist) {
list firsthalf;
list secondhalf;
if length(inlist) == 1 then {
output(inlist); -- pass the element
if stack exists then {
secondhalf = popstack(); -- get the next thing on the stack
splitlist(secondhalf); -- call the function recursively
}
} else {
firsthalf, secondhalf = split(inlist); -- split the list, pass to variables
pushstack(second half); --- push the second half onto the stack
splitlist(firsthalf); -- call the function recursively
}
}
I think that in reality most of this is taken care of in the computer's call stack, though not completely sure on how the memory for the lists is dealt with
use of threads for i²c I/O external : looking for a good strategy
@nau Hi, same boat (I don't know much about Pd internal functions & pthread), but maybe you can try to see if this external (really similar to my template, but this time to fetch real data for my HiCu project).
Look for m_clock / m_interval and clock_delay.
// ==============================================================================
// gac.c
//
// pd-Interface to [ 11h11 | gac ]
// Adapted by: Patrick Sebastien Coulombe
// Website: http://www.workinprogress.ca/guitare-a-crayon
//
// Original Author: Michael Egger
// Copyright: 2007 [ a n y m a ]
// Website: http://gnusb.sourceforge.net/
//
// License: GNU GPL 2.0 www.gnu.org
// Version: 2009-04-11
// ==============================================================================
// ==============================================================================
#include "m_pd.h"
#include <usb.h> //http://libusb-win32.sourceforge.net
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pthread.h"
#include "../common/gac_cmds.h"
// ==============================================================================
// Constants
// ------------------------------------------------------------------------------
#define USBDEV_SHARED_VENDOR 0x16c0 /* VOTI */
#define USBDEV_SHARED_PRODUCT 0x05dc /* Obdev's free shared PID */
#define DEFAULT_CLOCK_INTERVAL 34 /* ms */
#define OUTLETS 11
#define USBREPLYBUFFER 14
unsigned char buffer[USBREPLYBUFFER]; //accessible everywhere
// ==============================================================================
// Our External's Memory structure
// ------------------------------------------------------------------------------
typedef struct _gac // defines our object's internal variables for each instance in a patch
{
t_object p_ob; // object header - ALL pd external MUST begin with this...
usb_dev_handle *dev_handle; // handle to the gac usb device
void *m_clock; // handle to our clock
double m_interval; // clock interval for polling edubeat
double m_interval_bak; // backup clock interval for polling edubeat
int is_running; // is our clock ticking?
void *outlets[OUTLETS]; // handle to the objects outlets
int x_verbose;
pthread_attr_t gac_thread_attr;
pthread_t x_threadid;
} t_gac;
void *gac_class; // global pointer to the object class - so pd can reference the object
// ==============================================================================
// Function Prototypes
// ------------------------------------------------------------------------------
void *gac_new(t_symbol *s);
void gac_assist(t_gac *x, void *b, long m, long a, char *s);
void gac_bang(t_gac *x);
void gac_bootloader(t_gac *x);
static int usbGetStringAscii(usb_dev_handle *dev, int ndex, int langid, char *buf, int buflen);
void find_device(t_gac *x);
// =============================================================================
// Threading
// ------------------------------------------------------------------------------
static void *usb_thread_read(void *w)
{
t_gac *x = (t_gac*) w;
int nBytes;
while(1) {
pthread_testcancel();
if (!(x->dev_handle)) find_device(x);
else {
nBytes = usb_control_msg(x->dev_handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
EDUBEAT_CMD_POLL, 0, 0, (char *)buffer, sizeof(buffer), DEFAULT_CLOCK_INTERVAL);
if(x->x_verbose)post("thread read %i bytes", nBytes);
//post("%i b", nBytes);
}
}
return 0;
}
static void usb_thread_start(t_gac *x) {
// create the worker thread
if(pthread_attr_init(&x->gac_thread_attr) < 0)
{
error("gac: could not launch receive thread");
return;
}
if(pthread_attr_setdetachstate(&x->gac_thread_attr, PTHREAD_CREATE_DETACHED) < 0)
{
error("gac: could not launch receive thread");
return;
}
if(pthread_create(&x->x_threadid, &x->gac_thread_attr, usb_thread_read, x) < 0)
{
error("gac: could not launch receive thread");
return;
}
else
{
if(x->x_verbose)post("gac: thread %d launched", (int)x->x_threadid );
}
}
//--------------------------------------------------------------------------
// - Message: bootloader
//--------------------------------------------------------------------------
void gac_bootloader(t_gac *x)
{
int cmd;
int nBytes;
unsigned char bootloaderbuffer[8];
cmd = 0;
cmd = EDUBEAT_CMD_START_BOOTLOADER;
if (!(x->dev_handle)) find_device(x);
else {
nBytes = usb_control_msg(x->dev_handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
cmd, 0, 0, (char *)bootloaderbuffer, sizeof(bootloaderbuffer), DEFAULT_CLOCK_INTERVAL);
}
}
//--------------------------------------------------------------------------
// - Message: bang -> poll gac
//--------------------------------------------------------------------------
void gac_bang(t_gac *x) {
int i,n;
int replymask,replyshift,replybyte;
int temp;
for (i = 0; i < OUTLETS; i++) {
temp = buffer[i];
switch(i) {
case 0:
replybyte = buffer[8];
replyshift = ((0 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
case 1:
replybyte = buffer[8];
replyshift = ((1 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
case 2:
replybyte = buffer[8];
replyshift = ((2 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
case 3:
replybyte = buffer[8];
replyshift = ((3 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
case 4:
replybyte = buffer[9];
replyshift = ((0 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
case 5:
replybyte = buffer[9];
replyshift = ((1 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
case 6:
replybyte = buffer[9];
replyshift = ((2 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
case 8:
temp = buffer[10];
replybyte = buffer[13];
replyshift = ((0 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
case 9:
temp = buffer[11];
replybyte = buffer[13];
replyshift = ((1 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
case 10:
temp = buffer[12];
replybyte = buffer[13];
replyshift = ((2 % 4) * 2);
replymask = (3 << replyshift);
temp = temp * 4 + ((replybyte & replymask) >> replyshift);
break;
}
outlet_float(x->outlets[i], temp);
}
}
//--------------------------------------------------------------------------
// - The clock is ticking, tic, tac...
//--------------------------------------------------------------------------
void gac_tick(t_gac *x) {
clock_delay(x->m_clock, x->m_interval); // schedule another tick
gac_bang(x); // poll the edubeat
}
//--------------------------------------------------------------------------
// - Object creation and setup
//--------------------------------------------------------------------------
int gac_setup(void)
{
gac_class = class_new ( gensym("gac"),(t_newmethod)gac_new, 0, sizeof(t_gac), CLASS_DEFAULT,0);
// Add message handlers
class_addbang(gac_class, (t_method)gac_bang);
class_addmethod(gac_class, (t_method)gac_bootloader, gensym("bootloader"), A_DEFSYM,0);
post("bald-approved gac version 0.1",0);
return 1;
}
//--------------------------------------------------------------------------
void *gac_new(t_symbol *s) // s = optional argument typed into object box (A_SYM) -- defaults to 0 if no args are typed
{
t_gac *x; // local variable (pointer to a t_gac data structure)
x = (t_gac *)pd_new(gac_class); // create a new instance of this object
x->m_clock = clock_new(x,(t_method)gac_tick);
x->x_verbose = 0;
x->m_interval = DEFAULT_CLOCK_INTERVAL;
x->m_interval_bak = DEFAULT_CLOCK_INTERVAL;
x->dev_handle = NULL;
int i;
// create outlets and assign it to our outlet variable in the instance's data structure
for (i=0; i < OUTLETS; i++) {
x->outlets[i] = outlet_new(&x->p_ob, &s_float);
}
usb_thread_start(x); //start polling the device
clock_delay(x->m_clock,0.); //start reading the buffer
return x; // return a reference to the object instance
}
//--------------------------------------------------------------------------
// - Object destruction
//--------------------------------------------------------------------------
void gac_free(t_gac *x)
{
if (x->dev_handle) usb_close(x->dev_handle);
freebytes((t_object *)x->m_clock, sizeof(x->m_clock));
while(pthread_cancel(x->x_threadid) < 0)
if(x->x_verbose)post("gac: killing thread\n");
if(x->x_verbose)post("gac: thread canceled\n");
}
//--------------------------------------------------------------------------
// - USB Utility Functions
//--------------------------------------------------------------------------
static int usbGetStringAscii(usb_dev_handle *dev, int ndex, int langid, char *buf, int buflen)
{
char asciibuffer[256];
int rval, i;
if((rval = usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, (USB_DT_STRING << 8) + ndex, langid, asciibuffer, sizeof(asciibuffer), 1000)) < 0)
return rval;
if(asciibuffer[1] != USB_DT_STRING)
return 0;
if((unsigned char)asciibuffer[0] < rval)
rval = (unsigned char)asciibuffer[0];
rval /= 2;
/* lossy conversion to ISO Latin1 */
for(i=1;i<rval;i++){
if(i > buflen) /* destination buffer overflow */
break;
buf[i-1] = asciibuffer[2 * i];
if(asciibuffer[2 * i + 1] != 0) /* outside of ISO Latin1 range */
buf[i-1] = '?';
}
buf[i-1] = 0;
return i-1;
}
//--------------------------------------------------------------------------
void find_device(t_gac *x) {
usb_dev_handle *handle = NULL;
struct usb_bus *bus;
struct usb_device *dev;
usb_init();
usb_find_busses();
usb_find_devices();
for(bus=usb_busses; bus; bus=bus->next){
for(dev=bus->devices; dev; dev=dev->next){
if(dev->descriptor.idVendor == USBDEV_SHARED_VENDOR && dev->descriptor.idProduct == USBDEV_SHARED_PRODUCT){
char string[256];
int len;
handle = usb_open(dev); /* we need to open the device in order to query strings */
if(!handle){
error ("Warning: cannot open USB device: %s", usb_strerror());
continue;
}
/* now find out whether the device actually is gac */
len = usbGetStringAscii(handle, dev->descriptor.iManufacturer, 0x0409, string, sizeof(string));
if(len < 0){
post("gac: warning: cannot query manufacturer for device: %s", usb_strerror());
goto skipDevice;
}
post("::::::%s", string);
if(strcmp(string, "11h11") != 0)
goto skipDevice;
len = usbGetStringAscii(handle, dev->descriptor.iProduct, 0x0409, string, sizeof(string));
if(len < 0){
post("gac: warning: cannot query product for device: %s", usb_strerror());
goto skipDevice;
}
if(strcmp(string, "Gac") == 0)
break;
skipDevice:
usb_close(handle);
handle = NULL;
}
}
if(handle)
break;
}
if(!handle){
post("Could not find USB device 11h11/gac");
x->dev_handle = NULL;
} else {
x->dev_handle = handle;
post("Found USB device 11h11/gac");
}
}
Cheers
Effect Send and Return
I'm trying to make a bank of sends and returns for effects. The sends and returns are all in one patch, and I'm using the send~ and receive~ objects to send the original signal from a drum machine to another patch containing the effects, and back again.
I want to be able to switch the relative positions of each effect module in the signal path so have tried to use the [makefilename] object to alter the ID of the send and return coming into and going out of the effect module. However, this doesn't seem to work ~ i get all sorts of unwanted feedback delay effects and whining when changing the position of the effect.
If i set the send~ name manually it's ok, it's just when I try to change the position automatically. Possibly something to do with not being allowed multiple send~s to a single receive~?
Pls refer attached patches
Compiling externals on OSX
Hi, I tried Icoon's and Enrico's methodes but it doesn't work.
I copied the code from Johannes (helloworld) in a new C file in XCode. Then I did what enrico explains ; but when I type "make", the terminal answers a lot of errors. I probably forgot something, but what?
cc -arch i386 -arch ppc -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-switch -I../../src -o helloworld.o -c helloworld.c
helloworld.c:11:19: error: m_pd.h: No such file or directory
helloworld.c:12: error: syntax error before ‘*’ token
helloworld.c:12: warning: type defaults to ‘int’ in declaration of ‘helloworld_class’
helloworld.c:12: warning: data definition has no type or storage class
helloworld.c:14: error: syntax error before ‘t_object’
helloworld.c:14: warning: no semicolon at end of struct or union
helloworld.c:15: warning: type defaults to ‘int’ in declaration of ‘t_helloworld’
helloworld.c:15: warning: data definition has no type or storage class
helloworld.c:16: error: syntax error before ‘*’ token
helloworld.c:17: warning: function declaration isn’t a prototype
helloworld.c: In function ‘helloworld_bang’:
helloworld.c:18: warning: implicit declaration of function ‘post’
helloworld.c:11:19: error: m_pd.h: No such file or directory
helloworld.c:12: error: syntax error before ‘*’ token
helloworld.c:12: warning: type defaults to ‘int’ in declaration of ‘helloworld_class’
helloworld.c:12: warning: data definition has no type or storage class
helloworld.c:14: error: syntax error before ‘t_object’
helloworld.c:14: warning: no semicolon at end of struct or union
helloworld.c:15: warning: type defaults to ‘int’ in declaration of ‘t_helloworld’
helloworld.c:15: warning: data definition has no type or storage class
helloworld.c:16: error: syntax error before ‘*’ token
helloworld.c:17: warning: function declaration isn’t a prototype
helloworld.c: In function ‘helloworld_new’:
helloworld.c:22: error: ‘x’ undeclared (first use in this function)
helloworld.c:22: error: (Each undeclared identifier is reported only once
helloworld.c:22: error: for each function it appears in.)
helloworld.c:22: error: syntax error before ‘)’ token
helloworld.c: In function ‘helloworld_setup’:
helloworld.c:26: warning: implicit declaration of function ‘class_new’
helloworld.c:26: warning: implicit declaration of function ‘gensym’
helloworld.c:27: error: ‘t_newmethod’ undeclared (first use in this function)
helloworld.c:27: error: syntax error before ‘helloworld_new’
helloworld.c:30: warning: implicit declaration of function ‘class_addbang’
helloworld.c: In function ‘helloworld_bang’:
helloworld.c:18: warning: implicit declaration of function ‘post’
helloworld.c: In function ‘helloworld_new’:
helloworld.c:22: error: ‘x’ undeclared (first use in this function)
helloworld.c:22: error: (Each undeclared identifier is reported only once
helloworld.c:22: error: for each function it appears in.)
helloworld.c:22: error: syntax error before ‘)’ token
helloworld.c: In function ‘helloworld_setup’:
helloworld.c:26: warning: implicit declaration of function ‘class_new’
helloworld.c:26: warning: implicit declaration of function ‘gensym’
helloworld.c:27: error: ‘t_newmethod’ undeclared (first use in this function)
helloworld.c:27: error: syntax error before ‘helloworld_new’
helloworld.c:30: warning: implicit declaration of function ‘class_addbang’
lipo: can't figure out the architecture type of: /var/folders/Wl/WlZVlPp0Hvu7Q99UrPbdWE+++TI/-Tmp-//ccig9hRY.out
make: *** [helloworld.d_fat] Error 1
flaco
Arduino, ultrasonics and Pd: HELP needed for degree project!
Dear Pd'ers… I'm fairly new to Pd and have been using it during my 'Audio Production' degree at SAE college in London. I'm here to ask for help on my final degree project, which aims to control objects within Pd by way of proximity sensors connected to Arduino.
I have had moderate success, first using a Sharp GPD12 IR sensor connected to an analog port on an Arduino Diecimila, then a Devantech SRF02 connected via I2C to Arduino. I have managed to get Pure Data reading the sensor values using the Pure Data example included in SimpleMessageSystem (http://www.arduino.cc/playground/uploads/Code/SimpleMessageSystem.zip)... and only altering the number of the comport the Arduino appears on.
On the Arduino end, I have added the SimpleMessageSystem library, and am using the following sketch to run one or both of the sensors depending on whether or not I omit the SRF02 or GPD12 parts of the code.
// top //
#include <Wire.h>
#include <Servo.h>
#include <SimpleMessageSystem.h>
int sensorPin = 0;
int sensorValue = 0;
Servo servo1;
#define sensorAddress 0x70
#define readInches 0x50
#define readCentimeters 0x51
#define readMicroseconds 0x52
#define resultRegister 0x02
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void sendCommand (int address, int command) {
Wire.beginTransmission(address);
Wire.send(0x00);
Wire.send(command);
Wire.endTransmission();
}
void setRegister(int address, int thisRegister) {
Wire.beginTransmission(address);
Wire.send(thisRegister);
Wire.endTransmission();
}
int readData(int address, int numBytes) {
int result = 0;
Wire.requestFrom(address, numBytes);
while (Wire.available() < 2 );{
}
result = Wire.receive() * 256;
result = result + Wire.receive();
return result;
}
void loop()
{
// SRF02 READING //
sendCommand(sensorAddress, readInches);
delay(70);
setRegister(sensorAddress, resultRegister);
int sensorReading = readData(sensorAddress, 2);
Serial.println(sensorReading);
delay (200);
// GPD12 READING //
sensorValue = analogRead(sensorPin);
int range = (6787 / sensorValue);
Serial.println(range);
delay(200);
}
// bottom //
Pure data is picking up the sensor's output as a decimal number, through the serial port, correctly, and showing this as a number in the SPECIAL CHARACTER section of the Pd patch, which I can then use to control various Pd parameters, like a slider for example.
If printing both sensor readings to the serial, the Pd patch will pick up the two sensor values alternately, but there seems no way of differentiating the two sensors within Pd, as they both come through the serial. I have tried prepending the serial print at the Arduino stage with a tag such as "IR" or "UL" for each sensor, but this simply ends up in nothing coming through in Pd.
Using one sensor gives the ability to control parameters with a fairly narrow detection range, but for the final version I would like to incorporate 4 or 5 sensors in order that I can cover nearly a full 360 degree range.
After a bit of research I have gone and bought 4 x Maxsonar EZ0's. They've got a wider range than the Devantech sensors, and can operate via I2C, serial or PWM. A number of people online seem to mention the improved stability when operating via PWM, so I thought this could be kinda useful.
I am going to London Hackspace tomorrow to get help with wiring up the sensors to my Arduino Diecimila, but for now, my main problem seems to be how to achieve greater communication between Pure Data and the sensors. It's all very good and well being able to take the decimal readout from an analog input to give one set of values in Pd, but I would like to know how to either to read (and trigger) each sensor discretely via PWM, or to somehow differentiate between each sensor's analog output, so that I can have the different sensors controlling different objects within Pd.
As well as SimpleMessageSystem, I looked at using the Pduino object. But to be honest, it is either not working properly (I have noticed reported issues with bugginess), or I am being stupid, as it has totally boggled my brain. In theory though, it seems like it should be able to do what I want, ie. send and receive commands between Arduino and Pd.
****************************************
So…. my questions for anyone out there with a knowledge of using Arduino + multiple sensors (preferably Maxsonar EZ's) with Pd are:
What is most appropriate for my project?
- Simple Message System or Pduino?
- analog or PWM?
And how do I get proper communication between the two platforms so I can discern discrete values from each sensor?
I'd really like to get a discussion going with this as (a) it would really help me in my degree (which ends in about 4 weeks!!!) and (b) I really want to share what I am doing, especially as the discussions on Arduino/Pd communication on the various forums seem a little patchy (at least for noobs like me). I also hope to continue my research in the future, sharing any findings I make with the community…
****************************************
PS. In the sharing spirit, please check out the Radio Tuner patch I've just posted over on the patch section of this forum - it's my first successful attempt at Pd... I hope you enjoy
"Morphine" - fx-morphing engine
for some reason, the list of error messages became even longer......
mix.switch.nice 101
... couldn't create
init.post.dollarg
... couldn't create
flow.receive
... couldn't create
flow.send
... couldn't create
list.split 1
... couldn't create
flow.send
... couldn't create
flow.send
... couldn't create
flow.receive
... couldn't create
[makesymbol] part of zexy-2.2.3 (compiled: Feb 25 2009)
Copyright (l) 1999-2008 IOhannes m zmölnig, forum::für::umläute & IEM
flow.@parse
... couldn't create
flow.receive
... couldn't create
init.dollar.zero.top
... couldn't create
flow.receive
... couldn't create
flow.receive
... couldn't create
list.build
... couldn't create
[demultiplex] part of zexy-2.2.3 (compiled: Feb 25 2009)
Copyright (l) 1999-2008 IOhannes m zmölnig, forum::für::umläute & IEM
init.make.unique
... couldn't create
flow.receive
... couldn't create
flow.receive
... couldn't create
flow.send
... couldn't create
list.split 1
... couldn't create
list.split 1
... couldn't create
list.length
... couldn't create
flow.send
... couldn't create
flow.send
... couldn't create
wahwah~: an audio wahwah, version 0.1 (ydegoyon@free.fr)
expr, expr~, fexpr~ version 0.4 under GNU General Public License
mix.switch.nice 101
... couldn't create
init.post.dollarg
... couldn't create
flow.receive
... couldn't create
flow.send
... couldn't create
list.split 1
... couldn't create
flow.send
... couldn't create
flow.send
... couldn't create
flow.receive
... couldn't create
flow.@parse
... couldn't create
flow.receive
... couldn't create
init.dollar.zero.top
... couldn't create
flow.receive
... couldn't create
flow.receive
... couldn't create
list.build
... couldn't create
init.make.unique
... couldn't create
flow.receive
... couldn't create
flow.receive
... couldn't create
flow.send
... couldn't create
list.split 1
... couldn't create
list.split 1
... couldn't create
list.length
... couldn't create
flow.send
... couldn't create
flow.send
... couldn't create
mix.switch.nice 101
... couldn't create
init.post.dollarg
... couldn't create
flow.receive
... couldn't create
flow.send
... couldn't create
list.split 1
... couldn't create
flow.send
... couldn't create
flow.send
... couldn't create
flow.receive
... couldn't create
flow.@parse
... couldn't create
flow.receive
... couldn't create
init.dollar.zero.top
... couldn't create
flow.receive
... couldn't create
flow.receive
... couldn't create
list.build
... couldn't create
init.make.unique
... couldn't create
flow.receive
... couldn't create
flow.receive
... couldn't create
flow.send
... couldn't create
list.split 1
... couldn't create
list.split 1
... couldn't create
list.length
... couldn't create
flow.send
... couldn't create
flow.send
... couldn't create
mix.switch.nice 101
... couldn't create
init.post.dollarg
... couldn't create
flow.receive
... couldn't create
flow.send
... couldn't create
list.split 1
... couldn't create
flow.send
... couldn't create
flow.send
... couldn't create
flow.receive
... couldn't create
flow.@parse
... couldn't create
flow.receive
... couldn't create
init.dollar.zero.top
... couldn't create
flow.receive
... couldn't create
flow.receive
... couldn't create
list.build
... couldn't create
init.make.unique
... couldn't create
flow.receive
... couldn't create
flow.receive
... couldn't create
flow.send
... couldn't create
list.split 1
... couldn't create
list.split 1
... couldn't create
list.length
... couldn't create
flow.send
... couldn't create
flow.send
... couldn't create
error: inlet: expected '' but got 'symbol'
... you might be able to track this down from the Find menu.
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'list'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'list'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'list'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'list'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'list'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'list'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'list'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'symbol'
error: inlet: expected '' but got 'list'
i'd really love to check out, what you have build there!
\#DEFINE
you could just use symbols, and instead of sending directly to logic from every subpatch, send to a master receiver that converts from the names into the messages you want to send to logic
something like:
subpatch1: ...--"lp1RecOn"--[send LOGIC]
subpatch2: ...--"lp1RecOn"--[send LOGIC]
subpatch3: ...--"lp2RecOn"--[send LOGIC]
subpatch4: ...--"lp2RecOn"--[send LOGIC]
etc
master:
[receive LOGIC]
|
[route lp1RecOn lp2RecOn etc]
| |
"1 1 1" "6 24 100"
| |
... whatever you need to send to logic
(I use [route] instead of [select] here because otherwise you need to have all the identifiers be symbols, like "symbol lp1RecOn", which quickly gets tedious to type)
side note: be careful with the "shifting multiple values into one number" trick, it works until you get to large enough output numbers (about 16 million) at which point rounding errors creep in and it gets ugly, not to mention Pd likes to truncate numbers even more roughly when converting between floats and strings...
Synthesis metal bars sound
HI,
i'm working on an installation based on this apllication made in java
i communique with pd via OSC
for each collision pd receive a bang with two parameters
height tube
position tube
i'm looking for synthesis metal bars sounds to transform this "thing" into a musical instrument
there is samples here
http://obiwannabe.co.uk/html/sound-design/sound-design-audio.html
http://obiwannabe.co.uk/sounds/effect-clonk-002-bar.mp3
http://obiwannabe.co.uk/sounds/effect-clonk-002-bar.mp3
http://obiwannabe.co.uk/sounds/effect-clonk-004-iron.mp3
http://obiwannabe.co.uk/sounds/effect-clonk-006-bar.mp3
What kind of simple patch should i have to make for this goal?
au revoir
Denis
ALSA
below you'll find my lsmod info. echomixer, the alsa-toolkit utility for echo audio products did work after doing [ # alsaconf ] however, I tried to test my config simply by doing this;
# aplay -vv *
ALSA lib confmisc.c:670:(snd_func_card_driver) cannot find card '0'
ALSA lib conf.c:3500:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:391:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3500:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1070:(snd_func_refer) error evaluating name
ALSA lib conf.c:3500:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:3968:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2143:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:550: audio open error: No such device
So therer is still a missing piece.
Module Size Used by
snd_layla24 36356 0
snd_seq_oss 40084 0
snd_seq_midi 9792 0
snd_seq_midi_event 8160 2 snd_seq_oss,snd_seq_midi
snd_seq 60456 5 snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_rawmidi 28992 2 snd_layla24,snd_seq_midi
snd_seq_device 9708 4 snd_seq_oss,snd_seq_midi,snd_seq,snd_rawmidi
firmware_class 11744 1 snd_layla24
snd_pcm_oss 52032 0
snd_mixer_oss 20704 1 snd_pcm_oss
snd_pcm 91396 2 snd_layla24,snd_pcm_oss
snd_timer 26500 2 snd_seq,snd_pcm
snd 65908 9 snd_layla24,snd_seq_oss,snd_seq,snd_rawmidi,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
soundcore 11204 1 snd
snd_page_alloc 11304 2 snd_layla24,snd_pcm
ALSA
Dunno what snd_pcm is returning there, but you should see a separate driver for the Layla24
like this
$ lsmod
snd-seq-midi 5152 0 (unused)
snd-virmidi 2080 0
snd-seq-virmidi 5128 0 [snd-virmidi]
snd-seq-midi-event 6240 0 [snd-seq-midi snd-seq-virmidi]
snd-seq 48784 0 [snd-seq-midi snd-seq-virmidi snd-seq-midi-event]
snd-layla24 149732 3 <--------*here*
snd-pcm 85860 2 [snd-layla24] <---and pcm is using it
You don't have to recompile kernel or anything, find a driver and use insmod
Apparently there's a utils package at Alsa Project website for the Echo Layla24 that sets up everything. Have you tried that one?
also, there's an ALSA Wiki up now that may help you