electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
  PHOBoS presents Sim Biosys (EM mix)
  PHOBoS Tales of the Golden Teacher
  PHOBoS presents Music by Hrastprogrammer (feat. Terence McKenna)
  Faux Pas Quartet and friends Music From Last Thursday
Please visit the chat
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
max/msp > arduino > cv
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [6 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
jnuaury



Joined: Feb 28, 2008
Posts: 162
Location: chicago
Audio files: 9

PostPosted: Sun Aug 10, 2008 2:28 pm    Post subject: max/msp > arduino > cv
Subject description: this has been wrecking my brain a bit
Reply with quote  Mark this post and the followings unread

awhile back i was using max to control some electromechanical stuff through the arduino using this "maxuino" code

http://www.parasitaere-kapazitaeten.net/max_msp/pduino_for_max


arduino pulse width is normally at 490Hz which is not good enough for cv control... i recently came across this link where someone is actually using the arduino for dsp in a guitar pedal

http://www.instructables.com/id/Lo_fi_Arduino_Guitar_Pedal/

i dont think ill be needing to "stack" the pwm outs as it will be for CV instead of audio purposes but ive been trying to take the pwm frequency override code from the guitar pedal link and shove it in the maxuino code


i listened to the pwm out and it definitely wasnt 490Hz anymore but it seemed to act pretty wonky and i was getting some weird hiccups and freakouts when i tried adjusting the PWM value




has anybody tried similar things with greater success?
i wonder if serial communications and high pwm rates is just too much for the arduino
Back to top
View user's profile Send private message AIM Address
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Tue Aug 12, 2008 8:10 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hi jnuaury,

I'm not quite sure what you're trying to do--can you give me a little more information? I haven't had any trouble using PWM outputs for analog voltages--the pulse width doesn't really matter much when you use a lowpass filter to smooth the output. But what you wrote makes me think you're looking for something different.

One note, for sure--if you're trying to generate audio waveforms directly from PWM, and if the "maxduino" code does something with the timer interrupts in the Arduino, then I would expect some irregularities in the PWM. I don't have Max/MSP, so I can't really see what it's trying to do. If it's *lots* of serial data, then I would expect glitches.

I've mostly been using parallel DACs (both chips and discrete resistor versions) for control voltage output, though, because they're more accurate for note control voltages.

Thanks,

Ole
Back to top
View user's profile Send private message
skrasms



Joined: Feb 21, 2008
Posts: 121
Location: Portland, OR

PostPosted: Wed Aug 13, 2008 3:24 pm    Post subject: Re: max/msp > arduino > cv
Subject description: this has been wrecking my brain a bit
Reply with quote  Mark this post and the followings unread

jnuaury wrote:
awhile back i was using max to control some electromechanical stuff through the arduino using this "maxuino" code

http://www.parasitaere-kapazitaeten.net/max_msp/pduino_for_max


arduino pulse width is normally at 490Hz which is not good enough for cv control... i recently came across this link where someone is actually using the arduino for dsp in a guitar pedal

http://www.instructables.com/id/Lo_fi_Arduino_Guitar_Pedal/

i dont think ill be needing to "stack" the pwm outs as it will be for CV instead of audio purposes but ive been trying to take the pwm frequency override code from the guitar pedal link and shove it in the maxuino code

i listened to the pwm out and it definitely wasnt 490Hz anymore but it seemed to act pretty wonky and i was getting some weird hiccups and freakouts when i tried adjusting the PWM value

has anybody tried similar things with greater success?
i wonder if serial communications and high pwm rates is just too much for the arduino


490 Hz sounds incredibly slow for decent CV control, even with nice filtering. It's not even 9-bit for DC, let alone signals that are actually changing. I don't use the Arduino, but I see it has SPI support for some better options.

You could look into getting an SPI-controlled digital potentiometer that connects from +5V to ground and outputs on the wiper. Using the arduino to control the resistance would give you a cheap D/A (most likely 8-bits).

Here is a whole guide on an Arduino controlling a digipot: http://www.arduino.cc/en/Tutorial/SPIDigitalPot


OR you could go all out and get an SPI-controlled D/A chip from someplace like Analog Devices.

Hope that gives you some ideas!

_________________
Software and Hardware Design
Back to top
View user's profile Send private message
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Wed Aug 13, 2008 3:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

skrasms wrote: "...490 Hz sounds incredibly slow for decent CV control..."

It sounds wrong, actually--the default for analogWrite() is supposed to be 30kHz. It's also possible to change the PWM freqency, so the PWM speed itself probably shouldn't be an issue.

In addition, while the default PWM setting is for 8-bit, evil mad scientist labs had a nice piece on using 10-bit PWM. It looks like you could use up to 16-bit, but there would be various tradeoffs.

SPI using the provided shiftOut() function, however, is very slow. For playing notes, I've found that using digitalWrite() to control parallel DACs and/or latches works much better.

You can also use direct port manipulation to write all of the values in a given port (there are three predefined ports) at once, but there are disadvantages to using this approach. (Namely, that the only port available that a.) doesn't conflict with the analog inputs, and b.) doesn't conflict with Serial in, is 6-bit.

Thanks,

Ole
Back to top
View user's profile Send private message
okvern



Joined: Feb 05, 2008
Posts: 78
Location: Seattle, Washington
Audio files: 5

PostPosted: Wed Aug 13, 2008 4:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

I goofed slilghtly in the above--the conflict I was thinking of isn't serial in--it's that digital outs 2 and 3 can be used as interrupt lines in Arduino 011 and newer, and I need them for that purpose.

Thanks,

Ole
Back to top
View user's profile Send private message
fluxa



Joined: Jul 04, 2008
Posts: 2
Location: shanghai

PostPosted: Tue Jun 02, 2009 9:17 pm    Post subject: Arduino CV
Subject description: CVAirSequencer
Reply with quote  Mark this post and the followings unread

Here there is an example how to generate CV using AS3-Arduino.
http://www.reigndesign.com/blog/from-bytes-to-beats-digital-to-analog-conversion...

Also an open source sequencer that works with Arduino + SoundLab Mini Synth.

http://code.google.com/p/cvairsequencer/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: State Machine
Page 1 of 1 [6 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Microcontrollers and Programmable Logic
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use