Welcome to %s forums

BrainModular Users Forum

Login Register

starting project : marimba drumpads.

How do you use usine?
Post Reply
Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 24 Jan 2012, 14:57

Hi there Usiners!

Have you ever tried to work with an arduino or something similar? I need some info for deciding what is best : arduino or pic.

I'm trying to create something like drumpads triggers but with a similar shape of marimba/xylophone keys, so it could be easier to play with basslines too by using drumsticks or mallets Or even better, a continuously tone-shifting percusive surface, so maybe not midi related but OSC.

And of course interfacing with usine through some simple usb interface (usb to rs232 interface?)

I should be using piezoelectrics for detection and arduino or pic for the capture and processing.

Then a dumb serial interface through usb , and finally arriving to the Usine interface, but not sure if going through hid or osc.

Does osc requires a previous aditional virtual udp port implementation? like some osc-monome library maybe?

The idea is going for cheap, not costly materials.:)

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 24 Jan 2012, 15:58

cool project, I've also an arduino, waiting for experimentation since 1 year, but no time for it.
i suppose could be a good deal with piezo.
the last audio to midi patch is really effective too, was recently think about use it with volume/frequency filter to create some kind of advanced detector , inspired by Ircam works

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 24 Jan 2012, 16:58

i experimented with arduino, but not with usine (for and R&D about egr valve)

arduino itself is cool to code as it's c++ (like the SDK :)), but actually, there is no easy way to connect it to usine

ideally, a simple serial COM user module could permit to exchange raw data with the arduino, but there is no module like that actually
so, you'll have to make some work on the arduino side to make it speak MIDI or OSC to usine...
or make this serial COM user module (it's a pretty wanted feature for some people ;))

but wait, why don't you pass directly the audio in usine and process it ? no need of arduino in fact
Martin FLEURENT - Usine Developer - SDK maintainer


User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 24 Jan 2012, 20:00

yes, cleverconcqueso and it became this good project
http://madronalabs.com/hardware

but Floego talk about cheap, not costly materials :)

headphoner
Member
Posts: 225
Contact:

Unread post by headphoner » 24 Jan 2012, 22:03

Low cost solution is pduino

You will have to modify the pd patch for send midi or osc from pd to usine

i made an installation with 11 photoresistors, it worked.

Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 24 Jan 2012, 23:43

Awesome guys! thanks everyone for the feedback! :cool:

Here's my thoughs:

1- Audio port looks like a good idea (thanks martignasse and nay!) because of the rather quick time for implementation: piezo or microphones connected to stripes of different sizes of a certain material will give diferent sounds (when beaten) that could be identified and assigned for a given Midi note (by Usine), and there's no need of tuning the stripes because this part could be done in Usine too!
Only thing left: down how much different sounds can the whole system recorgnize (6, 12, 20?) I just don't know (nay?). Or maybe give arduino the load to process (and separate) each signal before it goes to the sound port? could it be multitouch or not?

2-Com port (rs232) could be a crazy good idea because arduino can do this almost directly. But certainly Usine doesn't have a Com module (and I don't know how it could be built?). So I need a usb to COM converter and do this through USB, luckily there's a lot of that cheap interfaces out there (but have to use a soft driver in windows). And now I can deal with HID rather than COM like headphoner says with the pduino (thanks!).

3-USB port can be done the same way as 2, or by using an arduino UNO (which add to the cost).

4- Initially I tried using a webcam to make the detection of lightning leds connected to Piezos, but the latency was really bad :-(

The following is what inspired me the initial idea:

http://www.thebox.myzen.co.uk/Hardware/ ... quare.html
this looks great but the construction seems uphill for me. Uses pic processor.

http://www.alternatemode.com/malletkat_express.shtml
looks like an scorching awesome instrument but is so costly!

next I saw this:
http://highfellow.org/synpad
cleverconqueso and nay-seven do you find this rather near to what you posted?
and it just gave me the idea to built a monolitic marimba pad. This thing could process position and intensity through piezos placed at the edges of a rectangular pad, then you'll have to calculate the position based on comparing the peak voltage intensity of the many piezos at a given time.

so much great ideas to think about! :D

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 25 Jan 2012, 00:20

Floego wrote:2-Com port (rs232) could be a crazy good idea because arduino can do this almost directly. But certainly Usine doesn't have a Com module (and I don't know how it could be built?). So I need a usb to COM converter and do this through USB, luckily there's a lot of that cheap interfaces out there (but have to use a soft driver in windows). And now I can deal with HID rather than COM like headphoner says with the pduino (thanks!).

3-USB port can be done the same way as 2, or by using an arduino UNO (which add to the cost).
the UNO have an usb port, but the drivers make it appear like a COM port to the PC, so it's really plug and play
unfortunatly, usine hasn't a COM module
a COM user module shouldn't be difficult to create, but the real challenge is to implement a communication protocol (firmata or other) between the arduino and usine.
Martin FLEURENT - Usine Developer - SDK maintainer

Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 25 Jan 2012, 06:49

martignasse wrote:the UNO have an usb port, but the drivers make it appear like a COM port to the PC, so it's really plug and play
unfortunatly, usine hasn't a COM module
a COM user module shouldn't be difficult to create, but the real challenge is to implement a communication protocol (firmata or other) between the arduino and usine.
hmmm, I don't have an arduino uno, so I didn't know that :/

I though about SLIP protocol through COM being able to do the trick because arduino has a library to use it, but it just doesn't work with win7, only winxp! :(

User avatar
GDLive
Member
Posts: 133
Location: Landes / Sud Ouest / France
Contact:

Unread post by GDLive » 26 Jan 2012, 21:02

Arduino like other pic embedded with usb com port could generate midi messages (which are serial messages).
If you use a specific com port driver which allows you to set the correct bitrate, you just have to use virtual midi port to receive it.

It seems that the synpad you linked uses this solution. (I imagine)

I did this when I was setting my LABC before switching to real midi signal in order to play robustly with every computer.

User avatar
GDLive
Member
Posts: 133
Location: Landes / Sud Ouest / France
Contact:

Unread post by GDLive » 26 Jan 2012, 21:03

And if you have midi messages, you could use uSine...

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 26 Jan 2012, 21:25

GDLive wrote:Arduino like other pic embedded with usb com port could generate midi messages (which are serial messages).
If you use a specific com port driver which allows you to set the correct bitrate, you just have to use virtual midi port to receive it...
And if you have midi messages, you could use uSine...
so... i ask 'hardly' for a wiki page about this kind of setup :P

... specific com port...correct bitrate...virdual midi port...
...and what about the arduino code side ?

at this point, you've said too much or not enough :D

i have no doubt it could make some user very happy around here ! :cool:
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
GDLive
Member
Posts: 133
Location: Landes / Sud Ouest / France
Contact:

Unread post by GDLive » 26 Jan 2012, 22:33

yes, I said too much... ;) very busy this time. After a break, I'm back to :
1 - mettre à jour mon site avec le projet
2 - profiter de cette occase pour reprendre la guideline in english for the usiners.
(Je voulais pas commencer à communiquer sur plusieurs forum/sites à la fois je m'attendais à une pluie de questions => si je fais un tuto d'un côté, je mettrais le lien de l'autre, ce sera plus simple et moins chronophage )

I'll try to advance on those two points very soon.

ok, go to sleep, wake up in a few hours..:cool:

Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 26 Jan 2012, 23:08

GDLive wrote:And if you have midi messages, you could use uSine...
yeah, I know I could use midi to communicate with Usine, but I'd like to try to process raw data with Usine, data provided by the piezo/mic through arduino serial interface, the original wave shape, not the detected peaks of the waves, etc.

Is it possible for Usine to process that amount of raw data in realtime? Or would I have to process the parameters with some arduino library before that?

I have not get an arduino just yet, so I'm only guessing for the best possible method.

Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 26 Jan 2012, 23:29

martignasse wrote:so... i ask 'hardly' for a wiki page about this kind of setup :P

... specific com port...correct bitrate...virdual midi port...
...and what about the arduino code side ?

at this point, you've said too much or not enough :D

i have no doubt it could make some user very happy around here ! :cool:
what is needed for anyone to try to build a com port module in Usine? I'm just a novel on this.:P

A possible protocol for a com port with arduino compatibility could be built around:
1-pduino (pure data) coupled with firmata (as headphoner suggested)
2-arduinome serial, which sends raw data from an arduinome to the COM port of a computer.

in both cases, the send/receive protocol is rather well documented.

or maybe built a module just for serial communication with arduino? :cool:

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 27 Jan 2012, 01:00

GDLive wrote:yes, I said too much... ;) very busy this time...
...I'll try to advance on those two points very soon
well, i have just no time too, but it's just because I have to turn [large]6[/large] time my neurons in my brain... :D
Floego wrote:what is needed for anyone to try to build a com port module in Usine? I'm just a novel on this.:P
or maybe built a module just for serial communication with arduino? :cool:
if it's just for raw serial com : the usine SDK and a couple of c++ source files for the serial/com part, already existing on the net :)
but I'd like to try to process raw data with Usine, data provided by the piezo/mic through arduino serial interface, the original wave shape, not the detected peaks of the waves, etc.
i smell that raw serial com is not enough, it should be coupled with a protocol on both side (like firmata) to be able to be generic
-arduino have to tell to usine : i send some raw audio data
-usine have to understand that what is coming from serial is some raw audio data
... or wath else kind of data
Is it possible for Usine to process that amount of raw data in realtime? Or would I have to process the parameters with some arduino library before that?
-at max, serial com rate is 115 000 bits per second
- usine, for just one audio operation at 44100Hz*16bit deal with 705 600 bits per second
i think you have the answer ;)
but the less you send from the arduino (mean do the max on board), the best for what you can process on the usine side


so, here we are... is there anybody out there (copyright 1979!) ?
Martin FLEURENT - Usine Developer - SDK maintainer

caco
Member
Posts: 306
Contact:

Unread post by caco » 27 Jan 2012, 13:26

Csound to the rescue!!

Csound can communicate with arduino via its new serial opcodes added in version 5.14. Maybe use my Csound4Usine user module to run Csound inside Usine, get the data from the arduino and pass it out of Csound4Usine into your patch :)

Should also be able to manipulate the data easily in Csound beforehand if you wish

There is also an example video by Matt Ingalls demonstrating arduino / csound combination in action - http://gallery.me.com/mattingalls#100119

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 27 Jan 2012, 14:03

Cool ! waiting for a native module,could be a good alternative !
you have an arduino to test caco..? I've a diecimilla here...:)

caco
Member
Posts: 306
Contact:

Unread post by caco » 27 Jan 2012, 14:18

nay-seven wrote:Cool ! waiting for a native module,could be a good alternative !
you have an arduino to test caco..? I've a diecimilla here...:)
Sadly not, creating my hardware via the arduino is on my 'to do' list but so many other projects to do first. Am excited to see what can be done with arduino / csound / usine all hooked up together :)

headphoner
Member
Posts: 225
Contact:

Unread post by headphoner » 27 Jan 2012, 18:04

Hi,

First try csound4usine arduino

Com port open!

one photoresistor values send from arduino to usine via csound4usine

Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 27 Jan 2012, 21:34

Hello headphoner, what is your arduino model? that's really great news! :)
Thanks caco for pointing out the great csound's capabilities! :)

This is just going better and better :cool:

headphoner
Member
Posts: 225
Contact:

Unread post by headphoner » 27 Jan 2012, 21:48

Hi,

i,ve got a Arduino Duemilanove ATmega328

I have to do more test with more sensors

Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 27 Jan 2012, 22:29

I have only found the arduino_uno and the arduino_pro on here.
The PRO does not have any usb_to_serial interface onboard but is half cheaper than the UNO (40€ versus 80€)

User avatar
GDLive
Member
Posts: 133
Location: Landes / Sud Ouest / France
Contact:

Unread post by GDLive » 28 Jan 2012, 16:55

Considering what is written before, Csound could be a great thing for serial adaptation.
As far as I'm concerned, I was only imagining using arduino as a controller, no audio through this card ; that's true that midi is not the answer to interact with the card and audio events.

You have arduino clones that are cheapest. I use a seeeduino.

headphoner
Member
Posts: 225
Contact:

Unread post by headphoner » 28 Jan 2012, 22:15

Hi,

In fact i'm not sure that csound is a good solution now.

Cpu is very high

Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 29 Jan 2012, 18:21

GDLive wrote:Considering what is written before, Csound could be a great thing for serial adaptation.
As far as I'm concerned, I was only imagining using arduino as a controller, no audio through this card ; that's true that midi is not the answer to interact with the card and audio events.

You have arduino clones that are cheapest. I use a seeeduino.
I just bought an arduino pro, the only I could afford right now. So next week I'll be experimenting with this board and Usine and tell.

headphoner wrote:Hi,

In fact i'm not sure that csound is a good solution now.

Cpu is very high
:/
what kind of test did you do?

headphoner
Member
Posts: 225
Contact:

Unread post by headphoner » 29 Jan 2012, 19:24

hi,

it seems that a buffer is overloaded.

i made a test with one photoresistor and one led, very simple.


a link to explain!?

serial opcodes synchronous?

caco
Member
Posts: 306
Contact:

Unread post by caco » 29 Jan 2012, 22:27

How much of a slow down in Csound did you experience? If you increase ksmps so that there are less k-rate passes does the slowdown reduce?

headphoner
Member
Posts: 225
Contact:

Unread post by headphoner » 30 Jan 2012, 08:08

Hi,

Cpu is going to 20% in winxound with ksmps = 500
Cpu is going to 100% in usine with ksmps = 256

Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 08 Feb 2012, 22:08

Hello Usiners :)

I have been doing some test with a piezo connected to an analog pin of an arduino pro board 16MHz/5V.

The arduino is connected to my desktop pc through the rs-232 port , not usb.

In order to avoid overloading of the com port, I made some threshold filtering for the values sent to the desktop pc from arduino.

The result in csound for usine seems to be just fine, about 2% of cpu loading when triggering an usine sampler module with the signal received by the COM port. :)

At the weekend I'll try to summarize what I have been done, including the arduino and csound code.

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 08 Feb 2012, 23:03

cool news !
but many Pc units don't have more rs-232 port..?

Floego
Member
Posts: 319
Location: Venezuela
Contact:

Unread post by Floego » 08 Feb 2012, 23:32

nay-seven wrote:cool news !
but many Pc units don't have more rs-232 port..?
Yes I know, I'll try to find some usb adapter soon and make some testing too.
Maybe the serial-to-usb driver won't affect the results that much?
In the worst case it couldn't be csound's or usine's fault but the driver...

bb96
New member
Posts: 1
Contact:

Unread post by bb96 » 16 Aug 2012, 18:39

wow

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests