create chromatic scale (or any other kind) from number range?
Newbie user here...
I was wondering if anyone knew of any externals or existing patches that would be able to take a floating point range of numbers (between 0 and 5), and scale that into a "virtual ribbon" control (like using the slider to control pitch instead of the keyboard).
Ultimately, I'll be trying to hook up a Paia theremax theremin's CV outputs (thus 0-5 range) to a make controller (ordered and on the way) to get the voltages into max/msp. The theremin has a logarithmic pitch scale, and I would like to put it through max to get a linear pitch scale (so it will be much more playable) out through midi. It would be great is Max could process the audio (pitch shifting) to get the audio to correspond with the Maxified linear pitch scaling. And once I get that working, apply scales to the midi output to get an autoharp "effect" (i.e. wave an arm through the volume antenna's sensing area and play a scale easily, so easily even I could play it. :)
Feel free to flame me if it's in the manuals on how to do something like this (i.e. converting a range of numbers into a scale).
It would be so great to get the thermin working as just another sensor in the Make controller and Max.
This will be my first real project with Max, so I expect many many pitfalls and posts here for my Maxamin. I'm just hoping that some of the small pieces of my big picture are floating around the web, waiting for me to grab n use.
Thanks for reading. :)
Tutorials..
..then, for example, try [scale] or [expr] and [gizmo~] to start experimenting. Your answer is allready in your question, the documentation and 'search' function of the list should get you going.
I would love to do it, but I don't have a theremin, it sounds like a wonderful idea!
Thanks for the tips.
If I'm successful enough, maybe I'll post it on youtube when I'm done.
Once you have the pitch determined (and continually being determined with something like fiddle~) and can reasonably quantify it, you're golden. I'd use a "table lookup" for the pitches to be remapped, though scale and expr are definitely nice to mess with too. The table or any other function-based (input X, get out a settable or changeable Y) interface object will let you make and use whatever scales you want, whenever you want.
In my experience, Max's power is in the real-time changing of stuff, which can be as sophisticated as you want, as well as being able to easily recall your crafted presets (also whatever you want), and being able to generate new stuff based on your current stuff, with whatever level of control or lack of control you want. It's all about the interaction between real-time action and pre-existing data sets, and how you manipulate them, which patterns you choose to use, when, and how easily (or not) they can be accessed. It's also a lot different if you're going to be the main person using your patch (so you can design and tweak complicated stuff knowledgeably without worrying too much about interface and usability) or if you're making something for others (tradeoffs between sophistication and intuitiveness are common, though that's an art form in itself that I'm sure most Maxers are continually honing ;)
It's often as much about GUI and documentation, and even basic screen space and encapsulation decisions, as being able to "do" or program some function at all (which you generally can, in some form, often freakishly quickly). Start experimenting with the objects, read the "see also" at the bottom of each Help patch, and let the possibilities grow piece by piece as you see how things can fit together...
So, yeah, after that tangent, look into table, multislider, mtr, and most importantly pattr. Well worth the effort up front. The basic preset hooks up to table and multislider easily enough, but using pattr only takes a bit more time, do it... using pattr has all the functionality of a preset, but a lot more (interpolation of many flavors....)
have fun!
--CJ
Don K schrieb:
> Feel free to flame me if it's in the manuals on how to do something
> like this (i.e. converting a range of numbers into a scale).
flame, flame, flame flaming yourself won't prevent you from being
flamed... ;-)
As a general recipe, before posting, type any relevant word of your
question into an object box and see if somethings coming up. (In your
case it will be [scale]) Very helpfull in your case is [mtof] and [ftom]
for converting freqency (logarithmically) into midi (linear) or vice
versa...
You'll have fun...
Stefan
--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com
If you download the patch from the article below, there is a scale_maker.js object which does what you want.
If the numbers you are receiving are between 0. and 5. then you would want to scale them from 0. 127.
Chris
I'm so happy to see that the Max community is so giving and helpful. You guys have pointed me on the right track, and I think that maybe, just maybe, my first real Max patch will be something I actually grow into something very cool and useful.
I got the hardware side of things working. The Make controller is working pretty well, but I need to smooth out the input. It could be some line noise, but the data is a bit jumpy, and if I turn up the metro, I loose sensitivity, but if i put a low value in, I get a good amount of sensitivity, but somewhat high frequency noise.
I have a feeling the hard part is left for me (I did a pretty good job of hacking patches and help files together to create my TheremaxSP patch.
Here's a hardware test in action if you're curious what I'm doing with the theremin and Max/MSP.
And now on to picking apart the Wii patches and looking at that scale maker js object. Thanks everyone.
stuttering input has always been a problem for me when working with Arduino or other microcontrollers. I'm not sure how commercial controllers do it with knobs etc., every potentiometer dial or distance sensor I've used has stutter. It's pretty evident why it happens but it would be nice to get some ideas on how to manage it. I've tried averaging groups of values in and it helps but it still is jerky. Bad for pitch control, OK for volume, but still (overall) kind of problematic. Anyone know a good solution? Also have tried low-pass filters, they help but aren't to commercial-level quality.
--CJ
I've got some stuttering issues as well. I can turn the metro down and that helps, but without some sort of temporal subsampling, something beyond what I can hear, I'm afraid it might be unavoidable without some sort of creative trick/solution.
Like the auditory version of when you slow down video/film lower than it's original shot framerate, but with more factors. I come from a graphics background, so it's easier for me to think of sound in terms of computer graphics.
What bit does the Arduino work at? Is it an 8bit device? 0-255?
The Make controller samples the values of voltage and spits out a range between 0 and 1023 (it's a 10bit device). I know the human eye can roughy see about 16-24 bits of information. And I think so can the ears. This could add to that glitch too.
I haven't calibrated my CV outs from my theremin to fit in that whole range, nor am I sure the board will let me calibrate it's analog to digital conversion. I'm using between the ranges of about 0 and 800 now, so I have to boost my CV out a little in the thermin's circuitry. I'll look into that this weekend when I have time.
so, the 800 usable values (they're ints and not floats) are squashed into a range of about 3-4 octaves through Max. I think that this aliasing is then multipled by the speed limit of the metro object and our ability to hear faster than metro can bang out and complexity of my patch. I don't know if the stuttering/aliasing I'm hearing could go away without doing some temporal antialiasing of some sort. Someone has a post about auditory flow (like the sound version of optical flow which is used in time warping in graphics and looks excellent). Would this be something granular synthesis would be good for? Might work with the thermin better than percussive instruments tho.
But maybe the glitch is part of this medium? Inherit in the digital world of art. :)
By 'stuttering' do you mean the 'zipper noise' from the
discontinuities in the control data? If so, a good way of overcoming
that is using [line] to smooth the leaps/transitions over a specified
period of time. This, of course, usually means outputting floats, so
that may limit its applicability in some cases.
Here's an abstraction I use to smooth incoming controller data.
Save as 'control-smooth.mxb':
And here's a 'help patch' which demonstrates its use.
Save as 'control-smooth.help':
On Dec 7, 2007, at 11:32 AM, Seejay James wrote:
>
> stuttering input has always been a problem for me when working with
> Arduino or other microcontrollers. I'm not sure how commercial
> controllers do it with knobs etc., every potentiometer dial or
> distance sensor I've used has stutter. It's pretty evident why it
> happens but it would be nice to get some ideas on how to manage it.
> I've tried averaging groups of values in and it helps but it still
> is jerky. Bad for pitch control, OK for volume, but still (overall)
> kind of problematic. Anyone know a good solution? Also have tried
> low-pass filters, they help but aren't to commercial-level quality.
>
> --CJ
----
Steven M. Miller
Professor, Contemporary Music Program
College of Santa Fe
Home
SFIFEM
Atrium Sound Space
OVOS
CMP
Thanks for your abstraction Steven.
I'll give it a try with my theremin patch tonight. I was thinking some sort of curve function might help. I've used things like linstep and hermite curves in CG before to smooth things in graphics. I love this forum! :)
>
> What bit does the Arduino work at? Is it an 8bit device? 0-255?
> The Make controller samples the values of voltage and spits out a
> range between 0 and 1023 (it's a 10bit device). I know the human
> eye can roughy see about 16-24 bits of information. And I think so
> can the ears. This could add to that glitch too.
I've had a chance to play with IpSonCompact:
I used it for few weeks, and I've been testing it with sensor input
only. It works beautifully, much much nicer then Arduino IMHO...
Also, it is 12bit thingie, so it can give you 4096 values at a very
fast rate. Another nice thing is that it's incredibly easy to use in
Max since it uses OSC protocol and connects through ethernet port.
On Dec 7, 2007, at 9:37 PM, Don K wrote:
> I've used things like linstep and hermite curves in CG before to
> smooth things in graphics.
You could also try lbyl (look before you leap) from CNMAT collection
(you can find it through www.maxobjects.com)
I think the look-before object would help me in this case, thanks for the info. I was able to eliminate some stutter (yes, I'm referring to the zipper noise) in the Arduino code (only sends data if it goes more than 1 up or down). Helps, but not totally. I think with line it should be fine. Arduino's analog is 10-bit, but I scale it to 256 so serial gets bytes... that's more than enough resolution for my needs.
Thanks for the insight, will look into it.
--CJ
Also, you might consider doing median filtering on the Arduino or in
Max. Will definitely cost you some CPU cycles what with sorting,
etc., but can save a lot of headache, and substantially reduce jitter.
Peter McCulloch
On Dec 8, 2007, at 5:35 PM, Seejay James wrote:
>
> I think the look-before object would help me in this case, thanks
> for the info. I was able to eliminate some stutter (yes, I'm
> referring to the zipper noise) in the Arduino code (only sends data
> if it goes more than 1 up or down). Helps, but not totally. I think
> with line it should be fine. Arduino's analog is 10-bit, but I
> scale it to 256 so serial gets bytes... that's more than enough
> resolution for my needs.
>
> Thanks for the insight, will look into it.
>
> --CJ
Hello, I found a huge list of scales in the max device
http://www.maxforlive.com/library/device/2433/live-stepper
And I would like to use it for filtering a pitchbend message 0-127.
So if the 14 isnt in the list, it must become a 15, not just dont be played.. (for example)
Is there an "simple" way for this ?
no simple way, no. even for a single major or minor scale you´d need already more variable than what fits into [expr], so you will have to create patch of several processes.
i would suggest that you use translation tables for that kind of thing.
[zl nth] or [coll] are perfect for that kind of thing.
to translate a chromatic scale to a given scale in th eway you described, you´d make a table like that:
[loadbang]
[list 0 2 2 4 4 5 7 7 9 9 11 11]
[zl nth]
and then play 1,2,3,4,5,6,7,8,9,10,11 from it.
I used this
from the monome device.. it looks to work but I m not sure.. it makes changes but in my system it s not really a beauty
yeah odonjohn, that's basically:
[M4L.PitchScale.bpatch] - it comes with Maxforlive.
allright :) what would we do without these easyways ^^
general advice for all complex scaling and mapping problems: go over a normalized 0.-1. range, this makes you see things more clear.
general advice when the target is musical tuning tables: work on (linear) note numbers (in floating point, for example 0.-127. but you may also exceed or limit that range), then use mtof.