Show Posts
Pages: 1 2 [3]
31  Forum 2005-2010 (read only) / Syntax & Programs / Re: Trivial array question. on: April 30, 2009, 01:41:47 pm
RE realtime editing: I think this will be the first step for at least getting the hardware going. I can this way send parameters from my laptop while I'm selecting the photoresistors for proper depth and response time.

Thanks a million I have a lot to work with!!!

Tonight I'll breadboard up the synth+active filters on their own 9VDC board so I can get everything in one place.
32  Forum 2005-2010 (read only) / Syntax & Programs / Re: Trivial array question. on: April 30, 2009, 12:10:35 pm
So cool! I have been reading up on structs just now. I guess this is a little ambitious for a beginner programmer.

so anyway, I've been playing around with the arduino for a while, seeing how it could fit in to my synth/gadget hobby. I just built this analog synth:



and it does some fun self-sequencing. But I thought it would be really interesting to mate it with the arduino. So I'll take the synth core and set it up with photoresistors to control with the arduino.

What I had in mind was a box with a pot, a button, and an LCD display

(because I am SICK of doing all the switches and knobs by hand!!!).

the user would see a prompt to enter the parameters for the first beat. using the pot, they could scroll through the parameters, and dial in the 0-4095 step value for whatever part of the synth they were controlling.

here's sort of a flow chart:

enter parameters for beat.

(option to playback with tempo)

enter parameters for next beat.

(playback automatically plays sequence of beats, freeing pot up for tempo adjustment)

so that's it. user could stop at one beat, or 7 if they wanted to. Maybe have a few loop options, like reverse looping and stuff.

maybe if I can squeeze a little more code into it have a generative part that sort of randomizes the values and spits them out at every tempo click.
33  Forum 2005-2010 (read only) / Syntax & Programs / Re: Trivial array question. on: April 30, 2009, 11:19:36 am
Okay, I'm beginning to get it:

const byte NUMBER_OF_BEATS = 4; //change to suit your needs

---Here I can run a routine to have the user twist the pot to get a number of beats? Even if I'm limited to 10-20 beats total, I'd like to be able to select measures of any length----

//this data structure uses 9 bytes as opposed to six ints which is 12. 25% saved!
typedef struct {
 byte tempo : 12;
 byte frequency : 12;
 byte shape : 12;
 byte sineVCA : 12;
 byte squareFreq : 12;
 byte squareVCA : 12;
} Beat;

-----This is VERY cool: from what I see, you're naming the exact value of bits in each variable?----

//initialize the Beats
Beat currentBeat[NUMBER_OF_BEATS] = {
 { 1 , 440 , 0, 0, 0, 0 },
 { 1 , 880 , 0, 0, 0, 0 },
 { 1 , 220 , 0, 0, 0, 0 },
 { 1 , 440 , 0, 0, 0, 0 }
};

-----okay, I see what is going on here; I guess when I'm entering the parameters  I reach in here and assign array values that I can copy to my to my 12 bit variables for each beat; but it's still a little mysterious as to how it works----

void setup(){
 Serial.begin(9800);
}

void loop(){
 //demonstrate usage
 for (byte i=0; i<NUMBER_OF_BEATS; i++){
   Serial.print(currentBeat.tempo); //use the Beat at index i to access the tempo field
   Serial.print(" ");
   Serial.print(currentBeat.frequency); //use the Beat at index i to access the tempo field
 }
}

-------I still definitely have to figure out a workflow for handing the data around----------
34  Forum 2005-2010 (read only) / Syntax & Programs / Re: Trivial array question. on: April 30, 2009, 11:01:28 am
Wow! I don't even know where to begin with this. I suppose I'll pull it apart and find out what each piece does.

This is how learning happens; many thanks!!!
35  Forum 2005-2010 (read only) / Syntax & Programs / Re: Trivial array question. on: April 30, 2009, 10:29:52 am
Thank you! In this case each variable will be 0-4095, for the output range of the TLC5940. the number of beats would be a smaller number, I just want to avoid presetting it, and locking down the number of steps.

so the first dimension would hold 5 (12 bit?) values, and the second dimension would contain a value set by the current beat being programmed. I could use 'byte' here quite easily.

I'm still getting errors setting up my array

"
error: declaration of 'currentBeat' as multidimensional array must have bounds for all dimensions except the first
"

but it's still a zygote.
36  Forum 2005-2010 (read only) / Syntax & Programs / Re: Trivial array question. on: April 30, 2009, 10:14:54 am
here's pretty much where I'm @:

I've got a few variables I want to encode:


int tempo = 0;
int frequency = 0;
int shape = 0;
int sineVCA = 0;
int squareFreq = 0;
int squareVCA = 0;
int beatNumber = 0;

I want to make an array like this:

int currentBeat [][];

but have it include {frequency, shape, sineVCA, squareFreq, squareVCA} on one side, and {beatNumber} on the other.

I'm kind of just grasping how to set this stuff up. Maybe my bullheaded wranglings will be of use to someone else.
37  Forum 2005-2010 (read only) / Syntax & Programs / Trivial array question. on: April 30, 2009, 09:26:32 am
Hello, n00b here.

I'm working on an anolog synth controller/sequencer, using the arduino to send a series of pulses to LEDs that drive photoresistors on the synth.

I've got an LCD display and TLC5940 LED driver (incredible, to someone familiar with analog electronics) all playing nice.

So I want to run the whole sequencer with one pushbutton and one potentiometer. I've got routines for twisting the pot to get various menu options on the LCD, and to scroll through all 4096 brightness values pretty easily.

Now what I want to get into is setting each beat. I'm thinking a 2d array, something like

int sequenceArray [numberOfParameters][numberOfBeats];

then, after the parameters for each beat have been entered,

numberOfBeats ++;

does this make sense to anybody?

If I can get some rudimentary code going I'll open up the synth design, pretty fun sine/triangle/square with dynamic filtering and VCAs.

Thanks in advance!
38  Forum 2005-2010 (read only) / Interfacing / Re: 1.95 YMZ284 software conrolled synth IC on: November 27, 2010, 12:53:38 pm
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1270232518

I guess I'll add this here, just want to keep track of this stuff in one place.
39  Forum 2005-2010 (read only) / Interfacing / Re: 1.95 YMZ284 software conrolled synth IC on: November 27, 2010, 12:06:49 pm
Duh, just reread your post. SO SWEET!

*scuttles off to rig up a synth shield...

Thanks, again! If you feel at all like sharing anything like a bit of code, otherwise it'll be worth it for me to learn from re-inventing the wheel I suppose.

Kudos!
40  Forum 2005-2010 (read only) / Interfacing / Re: 1.95 YMZ284 software conrolled synth IC on: November 27, 2010, 12:02:28 pm
Hi! Sounds great on the shield, just getting back to these chips. How'd you decide to do the wiring? I also have a few SN 'complex sound generator' ICs, some bucket-brigade delays, and a few top-octave generators... but the first step would be controlling these synth chips; did the 8 bit data bus go straight into the arduino digital pins?  Anyway, GREAT work! I'd love to put together a similar shield but I have lingering questions about the wiring. Just got a boarduino mounted to a breadboard, so things are easier that way.
41  Forum 2005-2010 (read only) / Interfacing / Re: 1.95 YMZ284 software conrolled synth IC on: December 17, 2009, 09:23:26 am
electronics goldmine has them for 1.95 if I recall. I bought a bag just in case, as they're so cheap.
42  Forum 2005-2010 (read only) / Interfacing / 1.95 YMZ284 software conrolled synth IC on: December 17, 2009, 09:15:00 am
I'm wondering if this has any potential as a shield; thought I'd throw it out here and see what anybody thinks. If it's -relatively- easy to implement it'd make a fun software controlled synth shield.

I build synths and stuff, so the hardware part's no problem; I have a couple of custom shields now, but the setup of this IC in particular is, um, a little advanced por moi.

Without further ado:

http://pdf1.alldatasheet.com/datasheet-pdf/view/82065/YAMAHA/YMZ284.html

^datasheet

This was used in several early 'sound design' products. Ultimately I'd like to drive it from sensor data via the 'duino.

Anyway, any and all input is appreciated.
cheers,
\greg

Pages: 1 2 [3]