Electro Hobby
Audio system controller coding direction and As Done project - Printable Version

+- Electro Hobby (https://electrohobby.ca/forum)
+-- Forum: Public (https://electrohobby.ca/forum/forumdisplay.php?fid=1)
+--- Forum: Showcase (https://electrohobby.ca/forum/forumdisplay.php?fid=6)
+--- Thread: Audio system controller coding direction and As Done project (/showthread.php?tid=151)

Pages: 1 2 3


Audio system controller coding direction and As Done project - Build_it_Bob - 2016-03-20

Good day Gents,
This is a project that I need to have completed for a multi use audio system at our Community Building at Faun Lake.
The basic theory of operation is:
-system user will use 4 control buttons to select the type of function that the building will be used for that event.
-a 2 line display will indicate the selection as well as engage the mode of operation by outputting RS232 code to a Biamp SP723 auto-mixer.
-this allows complex mixing changes to be stored and re-used quickly and easily.
The display and all the selections are working just as I want them now.
What I require at this point is help with code that will pull together the selections that are made on the display.
When the "Enter" button is pushed, the register contents stores must be output to the Biamp as ascii characters that will do Preset and Button functions stored and recalled in the Biamp itself.


The possible selections are:
Button 1- Mode: Bingo or Meeting or Social
Button 2- Source: BT/Ipod or DJ Mixer or Mic Only
Button 3- Separated or Combined
Button 4- "Enter" needs to take the Mode + Source + Combine status results and output ascii as required

Example of selections we will be using:
Bingo + Mic Only + Separated
Social + DJ Mixer + Combined ( as shown in picture attached )
Meeting + BT/Ipod + Combined
***Keep in mind that all the selections are possible depending on size of group, and type of function.

My thoughts...from a code bodger perspective:
Create volatile integers for each selection type:
volatile int my_mode_is;
volatile int my_source_is;
volatile int my_combine_is;
I can call a function now that I created called my_result_is(); that displays "Engaged" when the "Enter" button is pressed.
I would update the result based on the selection displayed on the LCD display in my existing code.
Is a switch case the best method to deal with the results?
I want ( prefer) to deal with all 3 combined selections together as 1 output result.
I know an option would be to process each result separate as well.
There are behind the scenes Biamp sequences that I have to initiate together in order for the audio to transition smoothly is my main reasoning for this request.

Also: I am not familiar with code tags ...so let me know if I should be using them and how to invoke them.
Thanks for any response to this thread; all help is appreciated.
Bob D


RE: Audio controller coding direction - roman - 2016-03-20

Bob, if you are not using interrupts, do not need volatile. Won't hurt, just saying.

If I understand it correctly, you need a minimalist menu, with 4th button flushing collected settings into the mixer.

I am going to assume platform is Arduino, language is C.

You should define how are you reading buttons, how you want them to behave if user holds one (ignore/cycle options at what rate, etc), and when user presses two at once. Best would be if you posted the code you have so far.


RE: Audio controller coding direction - Build_it_Bob - 2016-03-20

Hi Roman,
I am using Arduino Pro Mini and have the menu working the way I need it to.
I will play around some more and see what I can come up with.
If I stumble too much I will post the code to see what might help.
Bob D


RE: Audio controller coding direction - darrin - 2016-03-21

(2016-03-20, 12:52 PM)Build_it_Bob Wrote: Good day Gents,
This is a project that I need to have completed for a multi use audio system at our Community Building at Faun Lake.
The basic theory of operation is:
-system user will use 4 control buttons to select the type of function that the building will be used for that event.
-a 2 line display will indicate the selection as well as engage the mode of operation by outputting RS232 code to a Biamp SP723 auto-mixer.
-this allows complex mixing changes to be stored and re-used quickly and easily.
The display and all the selections are working just as I want them now.
What I require at this point is help with code that will pull together the selections that are made on the display.
When the "Enter" button is pushed, the register contents stores must be output to the Biamp as ascii characters that will do Preset and Button functions stored and recalled in the Biamp itself.


The possible selections are:
Button 1- Mode: Bingo or Meeting or Social
Button 2- Source: BT/Ipod or DJ Mixer or Mic Only
Button 3- Separated or Combined
Button 4- "Enter" needs to take the Mode + Source + Combine status results and output ascii as required

Example of selections we will be using:
Bingo + Mic Only + Separated
Social + DJ Mixer + Combined ( as shown in picture attached )
Meeting + BT/Ipod + Combined
***Keep in mind that all the selections are possible depending on size of group, and type of function.

My thoughts...from a code bodger perspective:
Create volatile integers for each selection type:
volatile int my_mode_is;
volatile int my_source_is;
volatile int my_combine_is;
I can call a function now that I created called my_result_is(); that displays "Engaged" when the "Enter" button is pressed.
I would update the result based on the selection displayed on the LCD display in my existing code.
Is a switch case the best method to deal with the results?
I want ( prefer) to deal with all 3 combined selections together as 1 output result.
I know an option would be to process each result separate as well.
There are behind the scenes Biamp sequences that I have to initiate together in order for the audio to transition smoothly is my main reasoning for this request.

Also: I am not familiar with code tags ...so let me know if I should be using them and how to invoke them.
Thanks for any response to this thread; all help is appreciated.
Bob D

Roman is right showing the code would be the best.

Sounds like a big complex thing you got going on there Bob.
If I understand you correctly, I think switch case is a good bet, considering there aint that many possible outcomes.
You can have a method for each of the possible out comes and send  the processed ascii characters to the method that displays it then to the method that performs it.

Very interesting project Bob.  You say I have talent.  I say you have way more.
Keep us informed.  I would love to hear how this project turns out.


RE: Audio controller coding direction - Build_it_Bob - 2016-03-21

Hi Guys,
First off , thanks so much for your guidance with this. I think my issue is you are using terms that I am not familiar with.
I need to better understand  what a " method" is and "flushing collected settings into the mixer" ...I think this describes what I ended up with after all? Blush
After spending a bit more time last night I am able to select my "Mode" ( clears the screen for a new selection first) and select my "Source" .
I can then push the "Enter" button and the results of the correct Mode and Source appear on the bottom right of the 2x16 LCD  indicating that I can add the individual ascii output commands at that point in the code to control the Biamp.
I will ( time permitting) add in the code for the "Combine" selection as well and this will complete the controller side of the project .
I like what I see with this version versus my original more complex design.
-I had originally included a FM tuner with "Favorite" button to select stations.
-I am just going to connect the FM tuner to the DJ mixer as I have inputs available there.
-I have an ascii table for the Button and Preset commands for the Biamp audio auto mixer
-these devices are older technology, but they are very versatile and I like working with them.
-I am excited about incorporating the Bluetooth / Ipod remote module as this will allow music files ( including national Anthem ) to be played at the Meetings and Social events.
There is no way I could ever charge for something like this, but the learning experience has been incredible.
When I finish installing and testing the system I will follow up with the documentation and update this post.
Oh, I really thought it was neat putting the control system inside the Sparkfun cardboard box to do temporary coding and testing. Tongue
-I have a single rack space with cutouts for the 2x16 LCD and the switches on the decora blank that will go in the finished product.
Bob D


RE: Audio controller coding direction - Build_it_Bob - 2016-03-21

Good evening,
  The code is now working as required! The next step is to plug in the ascii for each of the possible scenarios to send to the Biamp SP723.
This is the easy part as I had the system working on the test bench in the past.
I can't stress enough how important I find it is to have a reliable test bed when coding. The test bed is also great when you want to add the bells and whistles...or if you need a quick replacement.
I will update this post when the Biamp is fully functional.
Bob D


RE: Audio controller coding direction - darrin - 2016-03-21

Hey Bob. A method is just what you are already using. It is a group of code that you call to perform a function. Like in your attiny rgb code. void yellowtogreen(); You can send in multiple parameters and send out 1 value.

Glad you got your code working. Its a great relief when everything works as you want it.


RE: Audio controller coding direction - Build_it_Bob - 2016-03-21

Hi Darrin,
Thanks for the explanation...I really should start to learn the proper lingo to better understand the art of programming.
It really is a relief when code works as planned; just as you stated.
Bob D


RE: Audio Audio controller coding direction and finished product - Build_it_Bob - 2016-06-05

Hello all,
  I started writing this follow up and lost the draft...so I will start again and save as I go along.
The system is now installed, tested and working just as expected. I still have to cable and install the Bluetooth module, but I am still debating the best place to locate it for versatility.
I used the system for a "General Meeting" with the Audience Wireless Mic and all sounded great!
The same night it was raining, so we did our " Movie Night" in the Community Building and I used the system in "Social Mode" and enjoyed a very easy audio set up.Again, the Wireless Mic was handy for announcements.
I demonstrated system operation and submitted a user manual so I know that others can use the system confidently. 
Our 1st Bingo will be in a few weeks , so i am looking forward to testing "Bingo Mode" out!
  Here are the drawings, schematic and pictures of the Audio control system as done.
Bob D


RE: Audio controller coding direction - darrin - 2016-06-05

Wow Bob, very nice. Glad you have almost finished it. That project looks like it took many hours of hard work. Wish I had your skills in this. Now you can relax for the summer and have a beer. Your community must of really appreciated that.