Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 25 of 25

Thread: Audio GUI for T4

  1. #1
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909

    Audio GUI for T4

    I have started to customize the GUI for the Teensy4, hoping that Paul will adopt the changes.

    https://frankboesing.github.io/T4_Audio_Design_Tool/

    Click image for larger version. 

Name:	2020-03-22 13_36_53-Start.png 
Views:	53 
Size:	91.8 KB 
ID:	19444

    I've introduced several different colours.
    All objects with the same color use the same device, means: you cannot use two objects with the same color.

    I haven't done much with the info panel yet - it's still a big TODO.

    Please test it all, and post problems here - or much better: - do a pullrequest. Thanks a lot.
    Repo: https://github.com/FrankBoesing/T4_Audio_Design_Tool
    Last edited by Frank B; 03-23-2020 at 04:49 PM. Reason: Added link to preview - chipaudette: thanks!!

  2. #2
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    244
    Frank,

    Since you've already got your code on GitHub, you can serve it live straight from GitHub using the "Pages" feature of GitHub.

    For example, I've got a floating-point fork of the Audio library and I also extended the Audio GUI to go along with the floating-point fork. I serve the GUI via GitHub Pages.

    My GUI is live at this address: https://tympan.github.io/Tympan_Audio_Design_Tool/

    And, if you want to see how I set it up on GitHub: https://github.com/Tympan/Tympan_Audio_Design_Tool

    If you want to serve it live this way, and if you choose to follow my model, the steps are something like:

    1) Move the Teensy Audio GUI code to its own repo, not mixed in with the rest of the Audio library
    2) In GitHub, go to your new repo, go under "settings", and activate GitHub Pages

    I think that's all that I had to do to make it work!

    Chip

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    Wow, that works - thank you very much!
    https://frankboesing.github.io/T4_Audio_Design_Tool/

  4. #4
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,532
    Quote Originally Posted by Frank B View Post
    Wow, that works - thank you very much!
    https://frankboesing.github.io/T4_Audio_Design_Tool/
    are you going to add MQS output to GUI?

  5. #5
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    Oops - yes

  6. #6
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    I've added MQS

  7. #7
    Senior Member
    Join Date
    Dec 2016
    Posts
    126
    Having played with this, it seems like a neat thing would be to have only one GUI, with check boxes for including specific libraries, like Chip's floating point, and radio buttons for the processor, T3, T4, etc. The use of colors could show the add-ons, like float. Then the GUI would be checking more inconsistencies, like integer data going to float processes, as well as providing the objects for the code.

    But thanks to both Frank B and Chip for these GUI's. Bob

  8. #8
    Senior Member
    Join Date
    Dec 2016
    Posts
    126
    I notice that "Import" does not bring in the Patch Cords, and not always the objects. This is true for both of the external GUI's. "Export" seems fine.

  9. #9
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    The general interest in a updated GUI for the two Teensy-4 models is obviously zero. I will end the topic here and archive the project on Github.

  10. #10
    Administrator Paul's Avatar
    Join Date
    Oct 2012
    Posts
    374
    Frank, did you save a copy of this work?

    Now that 1.52 is released, I've been working to update the design tool. Here's the current work in progress.

    https://www.pjrc.com/teensy/gui2/

    If you still have a copy of this, I'd really like to double check that I didn't forget or overlook anything. If your copy documented stuff like pinouts, might be nice to compare.

  11. #11
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    Hi Paul, yes.
    But it is not of much use.

    Click image for larger version. 

Name:	2020-05-24 23_12_04-Start.png 
Views:	7 
Size:	11.2 KB 
ID:	20257

    I've added some minor changes:
    1) All in- and outputs which use the same device - for example all which use I2S1 - have the same color. This means you can't use more than one.
    Click image for larger version. 

Name:	2020-05-24 23_02_43-Cortana.png 
Views:	7 
Size:	12.4 KB 
ID:	20253
    2) In addition they have this Information in the Info-Panel and Mouse-Over (text in red):
    Click image for larger version. 

Name:	2020-05-24 23_01_32-Cortana.png 
Views:	4 
Size:	7.6 KB 
ID:	20254Click image for larger version. 

Name:	2020-05-24 23_02_17-Start.png 
Views:	4 
Size:	6.8 KB 
ID:	20255



    Next, I wanted to add some Javascript to print an alert or prvent adding an object in this case. But I got distracted..
    Attached Files Attached Files

  12. #12
    Junior Member
    Join Date
    May 2020
    Posts
    8
    Hi all, sorry to interject, but I was wondering if there are any plans to allow users of the Audio library to use 3.3V as the reference voltage when using AudioInputAnalog objects (ADC input). It seems relevant to ask due to the topic of this thread.

  13. #13
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    @Paul: It would involve creating a pin - or device array, setting the element to "true" if in use and before inserting the object it would be neccessary to check that flag.
    From the description quite easy
    But a quite a bit of work, though.

    Re: Pins:
    I don't remember.... I don't think that I added much of documentation - I was more interested in other things (see above) and planned to add documentation later.

  14. #14
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    @audeophilic - yes you asked this before.
    You simply can't change the voltage reference on the T4/T41, if I remember correctly.

  15. #15
    Junior Member
    Join Date
    May 2020
    Posts
    8
    I don't mean to question your thought process, but I don't believe that is true. I'm not entirely sure how the settings are configured for the ADC in input_adc.h/cpp, but using analogRead I am able to read the full spectrum. According to the specs of the T4 chip, the ADC accepts input of up to 3.3v, and in fact this is the default.

    Again, I apologize, as I don't mean to derail the post, but I'm sure there has got to be a way to do it within the library. Consider it a feature request, or even something I can help to develop. I would love to discuss it on my thread though.

  16. #16
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    ok, quite possible that I'm wrong.
    Too much details of the different models to remember...

  17. #17
    Junior Member
    Join Date
    May 2020
    Posts
    8
    Quote Originally Posted by Frank B View Post
    ok, quite possible that I'm wrong.
    Too much details of the different models to remember...
    I know that feeling, haha

  18. #18
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,110
    Quote Originally Posted by Frank B View Post
    t would involve creating a pin - or device array, setting the element to "true" if in use and before inserting the object it would be neccessary to check that flag.
    From the description quite easy
    But a quite a bit of work, though.
    Yes, a lot of work indeed. I will look at trying this in a couple days.

  19. #19
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,110
    @Frank - Now I see what you were trying to do with the colors and device info. Detecting compatibility between the many inputs and outputs is something I've wanted to do for a very long time. I've actually thought quite a lot about how I want to do this. It's more complex than just which device is used, but I have some ideas about how to do this well.... The big problem (for me) has been the Javascript coding. I'm slow with Javascript.

    I will try to add I/O compatibility metadata soon. When we have the necessary metadata, maybe this will feel easier?

    On the GUI, the way I want to see this work is warning icon to automatically appears on all objects on the canvas which are detected to be incompatible with any other. Visually, something like this:

    Click image for larger version. 

Name:	incompatible.png 
Views:	10 
Size:	19.2 KB 
ID:	20311

    Clicking the warning icons would bring up a dialog or panel with an explanation of why these can't work together.

  20. #20
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,110
    I've added the compatibility metadata with these commits.

    https://github.com/PaulStoffregen/Au...2da8577558d456
    https://github.com/PaulStoffregen/Au...56bc22d7c39518

    The concept is each input & output object requires access to multiple resources. Access can be exclusive or shareable with others. When shared, all objects must use the same setting.

    Here are the resources for regular I2S input and output, which obviously work together.

    Code:
    {"type":"AudioInputI2S",         "resource":"I2S Device",    "shareable":true,  "setting":"I2S Master"},
    {"type":"AudioInputI2S",         "resource":"Sample Rate",   "shareable":true,  "setting":"Teensy Control"},
    {"type":"AudioInputI2S",         "resource":"IN1 Pin",       "shareable":false},
    
    {"type":"AudioOutputI2S",        "resource":"I2S Device",    "shareable":true,  "setting":"I2S Master"},
    {"type":"AudioOutputI2S",        "resource":"Sample Rate",   "shareable":true,  "setting":"Teensy Control"},
    {"type":"AudioOutputI2S",        "resource":"OUT1A Pin",     "shareable":false},
    They both use the "I2S Device" resources with the same "I2S Master" setting. Likewise, they both use "Sample Rate" with the same setting. Each exclusively uses different pins, so no conflicts.

    However, if another I2S output is dragged onto the canvas, because the OUT1A pin is used exclusively, a duplicate copy will conflict. Both the new output and old output would get the yellow triangle warning. But the I2S input would not get a triangle, because there is no conflict.

    If a PT2811 output is then added, it would conflict in multiple ways.

    Code:
    {"type":"AudioOutputPT8211",     "resource":"I2S Device",    "shareable":true,  "setting":"PT8211 Protocol"},
    {"type":"AudioOutputPT8211",     "resource":"Sample Rate",   "shareable":true,  "setting":"Teensy Control"},
    {"type":"AudioOutputPT8211",     "resource":"OUT1A Pin",     "shareable":false},
    It also uses the OUT1A pin exclusively, so it conflicts with the other outputs. But it also shares "I2S Device" with setting "PT8211 Protocol". So it will cause a conflict with all the outputs and the input using "I2S Device" with setting "I2S Master". All of them will get triangles cause the I2S device is used differently.

    While this is much more complex than just specifying which device is used, I believe it is the simplest way that can represent the many ways different combinations of inputs and outputs can and can't work together.

    So far I've done no Javascript, other than creating this JSON metadata. Odds are slim I'll have time to work on JS code to actually do anything. I'm also not great with Javascript, so could really use help.

    @Frank - any chance you might try to create JS code which uses this metadata? My hope is to have those little yellow triangles appear when conflicts exist, and eventually to have those icons clickable for a human readable description of the conflict. That description might require adding friendly names for the resource names? But just getting the icons to appear & disappear would be a huge improvement.

  21. #21
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    Quote Originally Posted by PaulStoffregen View Post
    @Frank - any chance you might try to create JS code which uses this metadata?
    Paul, I'm gonna go have a look.
    But it's gonna take time because I'm busy with moving arrangements and I have to renovate.


    I don't know what happens where in this huge code, and I have to get used to it. That's why I had switched to the colors.
    But I'll give it a try.


    *And I don't like Javascript...

  22. #22
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    So,

    adding pt8211, i2s1, spdif1, adat1, mqs1

    will conflict here:

    Code:
    Conflict: spdif1 setting['SPDIF Protocol'] and i2s1 setting['I2S Master'] 
    Conflict: shareable 'OUT1A Pin'  spdif1 and i2s1 
    Conflict: pt8211_1 setting['PT8211 Protocol'] and i2s1 setting['I2S Master']
    Conflict: pt8211_1 setting['PT8211 Protocol'] and spdif1 setting['SPDIF Protocol'] 
    Conflict: shareable 'OUT1A Pin'  pt8211_1 and i2s1 
    Conflict: shareable 'OUT1A Pin'  pt8211_1 and spdif1 
    Conflict: adat1 setting['ADAT Protocol'] and i2s1 setting['I2S Master']
    Conflict: adat1 setting['ADAT Protocol'] and spdif1 setting['SPDIF Protocol'] 
    Conflict: adat1 setting['ADAT Protocol'] and pt8211_1 setting['PT8211 Protocol'] 
    Conflict: shareable 'OUT1A Pin'  adat1 and i2s1 
    Conflict: shareable 'OUT1A Pin'  adat1 and spdif1 
    Conflict: shareable 'OUT1A Pin'  adat1 and pt8211_1
    Is this correct, or is something missing?
    If yes, that code ist working - it just writes to the javscript console now.
    Adding the Icons is a bit more work for me, since I have to figure out how that works..

    Not today. too late.
    Last edited by Frank B; 05-27-2020 at 09:52 PM.

  23. #23
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,909
    You may want to add a resource "Teensy Model" - some things do not work on T3 and vice versa.
    But this needs a global setting - a radio or checkbox or ..

    Edit:
    Code attached. Open the Javascript-Console to see the output.

    Have to sleep now... tztztz
    Last edited by Frank B; 05-28-2020 at 07:02 AM. Reason: rmv attachment as there is a pullrequest now.

  24. #24
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,110
    Progress is being made. Here's links to the github activity, in case anyone following this thread is interested.

    https://github.com/PaulStoffregen/Audio/pull/346/files

    https://github.com/PaulStoffregen/Au...949353c6e3464e

  25. #25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •