fiduciary

Author Topic: Announcing the Teensy Saber open source sound board  (Read 91557 times)

0 Members and 1 Guest are viewing this topic.

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: Announcing the Teensy Saber open source sound board
« Reply #255 on: May 23, 2017, 08:15:47 PM »
Quote
What font(s) are you using?
I'm doing some work on the sound code right now, and I've realized that the volume
is a bit of a mess. Originally I lowered the volume of the hum to make room to make it
louder when you swing the saber around, which might be part of the problem.

The other problem may be that NEC fonts have some volume settings which I have not implemented
yet, so I need to look into that.

I am using several some are NEC and some are plectar they are listed below.

LB-FormIV (NEC)
L-Kylo (NEC)
L-CW-GG (PLectar)
LB-E7 Graflex  (NEC)
JS-GraflexIVHD (Plectar)
NS-MasterWindu  (Plectar)
JS-MPPHD (Plectar)
LB-SkywalkerROTJ (NEC)

I plan to get more eventually as well. This is what I have bought so far. I have some default Niagon electronics ones as well.

below is the font setup in the code.
Code: [Select]
{ "Boot", "tracks/Ftheme.wav", &style_charging },
//{ "Fonts", "Tracks/Cantina.wav", &style_pov },
//{ "Fonts", "Tracks/Cantina.wav", StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>() },
  { "Fonts/EssEpII", "Tracks/Cantina.wav", StyleRainbowPtr<300, 800>() },
  { "Fonts/standIs", "Tracks/Gintro.wav", StyleNormalPtr<WHITE, RED, 300, 800>() },
  { "Fonts/ATEasy", "Tracks/Cantina.wav", StyleNormalPtr<YELLOW, BLUE, 300, 800>() },
  { "Fonts/Grievous", "Tracks/Gintro.wav", StyleFirePtr<GREEN, CYAN>() },
  { "Fonts/Kylo", "Tracks/Kintro.wav", StyleFirePtr<RED, YELLOW>() },
  { "Fonts/Yoda1", "Tracks/Cantina.wav",
    StylePtr<InOutHelper<SimpleClash<OnSpark<GREEN> >, 300, 800> >() },
  { "Fonts/Windu", "Tracks/Cantina.wav",
    StylePtr<InOutSparkTip<SimpleClash<MAGENTA, WHITE>, 300, 800> >() },
  { "Fonts/MPP", "Tracks/Vader.wav", StyleNormalPtr<RED, WHITE, 300, 800>() },
  { "Fonts/ROTJ", "Tracks/Cantina.wav", StyleNormalPtr<Gradient<BLUE, CYAN>, WHITE, 300, 800>() },
  { "Fonts/Graflex7", "Tracks/SIntro.wav",
    StylePtr<InOutSparkTip<SimpleClash<BLUE, WHITE>, 300, 800> >() },
  { "Fonts/Graflex4", "Tracks/Ftheme.wav", StyleNormalPtr<CYAN, WHITE, 300, 800>() },

That would make sense. Speaking of sound code, I know you were implementing a potential lockup. I notice some sound fonts come with a spin sound. S when you continually spin the saber it initiates the sound. Is that something you are thinking of implementing?


Quote
I should probably make the time minimum time between clashes a bit longer.
As it is it is only 0.1s. You can easily change it yourself too, just find the line that
says:
Code: [Select]
if (t - last_clash < 100) return; and change it. (100 is in milliseconds.)

Thank you, I will change that fora  longer delay time. Hopefully that fixes the double preset.

Quote
Interesting. That's what happen when you use a pseudo-random generator without seeding it.
Ideally I'd use the motion chip to get some random data to feed into the random generator, but the motion chip takes a little while to initiate, so I might have to look for another source of randomness.

I will post updates as problems are worked out.

Alright, not a big deal right now but would be nice to hear different ones.

Thank you again for your development and continued support.

Regards,

GMcIvor
« Last Edit: May 23, 2017, 08:27:39 PM by gmcivor »

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #256 on: May 23, 2017, 08:34:09 PM »

LB-FormIV (NEC)
L-Kylo (NEC)
L-CW-GG (PLectar)
LB-E7 Graflex  (NEC)
JS-GraflexIVHD (Plectar)
NS-MasterWindu  (Plectar)
JS-MPPHD (Plectar)
LB-SkywalkerROTJ (NEC)


Is the hum quiet on all of these fonts, or just some of them?
I'm going to go buy some (but not all) of these, so I want to make sure that I get ones that reproduce the problem you have.

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: Announcing the Teensy Saber open source sound board
« Reply #257 on: May 23, 2017, 08:40:48 PM »
Quote
Is the hum quiet on all of these fonts, or just some of them?
I'm going to go buy some (but not all) of these, so I want to make sure that I get ones that reproduce the problem you have.

My saber is at work, but if I remember correctly it is all of them. I will check first thing in the morning when I arrive (730am). And I will specially let you know which ones.

A couple I could hear but they were quiet, others were alot quieter.

Which sound fonts did you purchase on yours? Maybe I will buy a couple and see if their is a difference from yours as well.

Regards,

GMcIvor
« Last Edit: May 23, 2017, 09:38:47 PM by gmcivor »

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: Announcing the Teensy Saber open source sound board
« Reply #258 on: May 24, 2017, 08:02:34 AM »
Good Morning,

Alright so hear is the information I gathered. Sometimes it skips playing the Font sound when a new font is selected. The ones listed could be louder are okay, but Id like to see the volume go up. The other ones are quiet or barely audible.

JS-GraflexIVHD (Plectar)
hum and clash

LB-E7 Graflex  (NEC)
hum

LB-SkywalkerROTJ (NEC)
hum 1 Hum2 is a soundtrack/hum that is okay.

JS-MPPHD (Plectar)
hum and clash could be louder

NS-MasterWindu  (Plectar)
hum is super quiet could barely hear
clash could be louder

LB-FormIV (NEC)
hum and clash audible but could be louder sometimes hard to hear.

L-Kylo (NEC)
hum and clash could be louder

L-CW-GG (PLectar)
hum and clash could be louder

What are a couple you have purchased you know are happy with and sound great? Maybe I will buy them and do some testing as well...

Regards,

GMcIvor

« Last Edit: May 24, 2017, 08:23:23 AM by gmcivor »

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #259 on: May 24, 2017, 10:22:33 AM »
I'm going to do some tuning on the sound volume over the next few days.
The current state of things is that in a NEC font, the hum is played more quietly than everything else, and in a plecter font, everything is played fairly quietly. The reason for this is to avoid clipping when he volume is increased, which happens when you swing the saber around.

What I'm going to do is actually to reduce the volume of NEC effects and sound tracks so that everything is at the same level initially, and then I'm going to tune the dynamic compressor to produce louder sounds in general.

One of the fonts I use a lot is the JS-Graflex IV HD. It's pretty quiet on my test bench,
but  not on my actual saber, so clearly what speaker you use matters.

Anyway, expect another update in a day or two.

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: Announcing the Teensy Saber open source sound board
« Reply #260 on: May 24, 2017, 10:30:33 AM »
I'm going to do some tuning on the sound volume over the next few days.
The current state of things is that in a NEC font, the hum is played more quietly than everything else, and in a plecter font, everything is played fairly quietly. The reason for this is to avoid clipping when he volume is increased, which happens when you swing the saber around.

What I'm going to do is actually to reduce the volume of NEC effects and sound tracks so that everything is at the same level initially, and then I'm going to tune the dynamic compressor to produce louder sounds in general.

One of the fonts I use a lot is the JS-Graflex IV HD. It's pretty quiet on my test bench,
but  not on my actual saber, so clearly what speaker you use matters.

Anyway, expect another update in a day or two.

okay sounds good, yeah you don't want clipping in the sounds when you are moving your saber around.

Yeah I think that is the font I have listed as well. I am using the 28mm bass boosted speaker from the custom saber shop.

I look forward to hearing the update when it comes.

Thanks again.

Regards,

GMcIvor

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #261 on: May 24, 2017, 05:48:53 PM »
Profezzorn,
First let me apologize if this question has been asked before...

I am working on the V1 electronics this evening and have run into a question.  I have soldered the headers to the Prop Shield as your instructions describe.  Your instructions mention not connecting the 3.3V pin through to the SD adapter (because... "It's easier to just feed it 5 volts") but it doesn't mention the AGND pin.  As far as I can tell both the 3.3V and AGND pins are not shown connected through to the SD adapter in your circuit diagram. Both the 3.3V and the AGND pins appear to be connected through to the SD adapter in your photo titled "When it's all hooked up, it should look something like this".  Should I connect these pins through or not?

Thanks in advance for your help.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #262 on: May 24, 2017, 07:00:07 PM »
Sorry about the confusion.

On that side of the SD adapter, only the 5v pad is actually connected. The rest are not connected to anything, so it doesn't matter if you put pins there or not.  (See this page: SD Adaptor, to use SD flash cards with Teensy, Arduino and other AVR boards, note that SW is also not connected to anything since the resistor is not populated by default.)

I recommend connecting them simply to hold the sd adapter better in place.

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #263 on: May 24, 2017, 07:06:43 PM »
Thanks.  That makes perfect sense.  I should have checked the PJRC.com info myself.

Again, thanks for all your help.  My Teensy Saber is getting closer to being complete.  :grin:

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #264 on: May 24, 2017, 09:47:20 PM »
I'm going to do some tuning on the sound volume over the next few days.
The current state of things is that in a NEC font, the hum is played more quietly than everything else, and in a plecter font, everything is played fairly quietly. The reason for this is to avoid clipping when he volume is increased, which happens when you swing the saber around.

What I'm going to do is actually to reduce the volume of NEC effects and sound tracks so that everything is at the same level initially, and then I'm going to tune the dynamic compressor to produce louder sounds in general.

One of the fonts I use a lot is the JS-Graflex IV HD. It's pretty quiet on my test bench,
but  not on my actual saber, so clearly what speaker you use matters.

Anyway, expect another update in a day or two.

Ok, I did exactly this, and I think the sounds are now roughly three times louder than before, while still leaving a little room for swings, clashes and background music. As before, it's not very well tested yet, but it's uploaded to github:
https://raw.githubusercontent.com/profezzorn/TeensySaber/master/lightsaber.ino

I'll probably have time to do proper testing this weekend, and then I can upload it to hubbe.net.

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: Announcing the Teensy Saber open source sound board
« Reply #265 on: May 26, 2017, 02:20:31 PM »
I thought of a couple questions as I was thinking of ways to pitch to students.

1) well, this isn't one but will a spin mode be implemented ? Some sound founts have that sound. 

2) When will the V2 boards be available ? I think these boards will make it easier for students to complete the sabers. Less places for things to go wrong.

3) I looked through the code and couldn't find it, but is their a way to change the POV to display something other then starwars? Like students names or our school name or something if kids wanted to change it or to promote it to other students?

Regards,

GMcIvor 

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #266 on: May 26, 2017, 02:50:00 PM »
I thought of a couple questions as I was thinking of ways to pitch to students.

1) well, this isn't one but will a spin mode be implemented ? Some sound founts have that sound.

Probably. It's not high on my list, and it's not clear to me how you distinguish a swing motion from a spin motion. As always, if someone else wants to implement it and send me a patch I'd be happy to include it (after some testing).
 
Quote
2) When will the V2 boards be available ? I think these boards will make it easier for students to complete the sabers. Less places for things to go wrong.

Very soon. I'm considering selling some of the ones I made myself, and I expect to have ~20 for sales within two weeks. Unfortunately I cannot promise a steady supply.

Quote
3) I looked through the code and couldn't find it, but is their a way to change the POV to display something other then starwars? Like students names or our school name or something if kids wanted to change it or to promote it to other students? 

The POV is controlled by a gargantuan array of numbers inside lightsaber.ino.
It would probably be better to read it from the SD card, but I'm not sure if that would slow it down or not....

Either way, I wrote a tool that computes that array from an input image, and I've been meaning to open-source that tool so that you could switch out the array for something else. I just haven't gotten around to it yet. Maybe I will have time to do that this weekend.


Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: Announcing the Teensy Saber open source sound board
« Reply #267 on: May 26, 2017, 09:18:29 PM »
Quote
Probably. It's not high on my list, and it's not clear to me how you distinguish a swing motion from a spin motion. As always, if someone else wants to implement it and send me a patch I'd be happy to include it (after some testing).

Makes sense, I'm sure someone will, but their are more things on the priority list that are probably better for the teensysaber overall.
 
Quote
Very soon. I'm considering selling some of the ones I made myself, and I expect to have ~20 for sales within two weeks. Unfortunately I cannot promise a steady supply.

That's awesome! I'm excited for these to become available. Will it be one per person or any ideas of a purchase cap? Understandable, over the summer, I might biuld your test rig and try building some of the boards (for the new semester and new sabers) myself to see if I can. On the test rig, it says you need two of the boards, but the bottom one is unpopulated of parts. What purpose does the bottom board serve?


Quote
The POV is controlled by a gargantuan array of numbers inside lightsaber.ino.
It would probably be better to read it from the SD card, but I'm not sure if that would slow it down or not....

Either way, I wrote a tool that computes that array from an input image, and I've been meaning to open-source that tool so
that you could switch out the array for something else. I just haven't gotten around to it yet. Maybe I will have time to do

oh wow, sounds like a lot numbers. No rush, was just an idea. I am happy to wait to when ever that happens, not a big deal right now. For more in the future.

Regards,

GMcIvor
« Last Edit: May 27, 2017, 10:19:36 AM by gmcivor »

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: Announcing the Teensy Saber open source sound board
« Reply #268 on: May 27, 2017, 12:14:43 PM »
The pre-run teensysaber v2 is now live: TeensySaber V2 for sale

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: Announcing the Teensy Saber open source sound board
« Reply #269 on: May 28, 2017, 08:44:09 PM »
Profezzorn,
So I've gotten to the point where I have my Teensy Saber electronics working (sort of).  There are two issues I can't seem to figure out. 

The first is that the "aux2" button doesn't seem to trigger.  It's not a wiring issue either because I've jump'ed the Teensy pins to GND and both other buttons ("pow" [pin 16] and "aux" [pin 15]) function but the "aux2" button (pin 17) doesn't seem to do anything (it doesn't show being triggered in the serial monitor either). I'm assuming that this is preventing me from selecting the next preset.  I can however use the "next pre" command in the serial monitor and step through all my presets.  I did change the touch button to a normal button using the change I found in an earlier post (see below).

  // CONFIGURABLE, use "monitor touch" to see the range of
  // values from the touch sensor, then select a value that is
  // big enough to not trigger the touch sensor randomly.
            // power_(powerButtonPin, 1700, "pow"),
            power_(powerButtonPin, "pow"),
            aux_(auxPin, "aux"),
            aux2_(aux2Pin, "aux2") {}

Any ideas what is wrong?  Am I expecting the buttons to function correctly?  If not, how should I step through the presets?

My second issue is most likely a blade array configuration issue.  My blade is a pair of 144 LED WS2811 compatible RGB strips.  I've tested them all individually using a test rig I built using an Arduino Uno and every LED lights and changes colors correctly.  I've configured my BladeConfig as follows...

BladeConfig blades[] = {
#ifdef ENABLE_WS2811
  {   10000, WS2811BladePtr<144, WS2811_800kHz | WS2811_GRB>(), CONFIGARRAY(my_presets) },
#endif
};

I've configured "my_presets" as follows...

Preset my_presets[] = {
  { "", "", StyleNormalPtr<GREEN, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<BLUE, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<CYAN, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<RED, YELLOW, 300, 800>() },
  { "", "", StyleNormalPtr<MAGENTA, WHITE, 300, 800>() },
  { "", "", StyleNormalPtr<YELLOW, RED, 300, 800>() },
  { "", "", StyleNormalPtr<WHITE, RED, 300, 800>() },
};

So here's my issue...  I am getting a sparkling rainbow of colors when the blade animates on and off.  The sparkling rainbow appears in the portion of the blade that shouldn't be lit.  Any idea what could be wrong and how to correct it?

You should also note that I'm using the SerialFlash on the Prop Shield to store my single Soundfont (I do not have the SD Adapter connected and instead connected MISO, MOSI and SCK through to the Teensy 3.2 so I could access the SerialFlash).  This is why I left the directory/folder name blank in all my presets.  I also don't have any music tracks loaded... just the following in the root folder of the SerialFlash...

\teensytransfer>teensytransfer -l
   47404 clash1.wav
   49580 clash2.wav
   56492 clash3.wav
   37676 clash4.wav
   78636 clash5.wav
   30508 clash6.wav
   23980 clash7.wav
   25644 clash8.wav
   28076 poweroff1.wav
   75820 poweron1.wav
   28332 swing1.wav
   43436 swing2.wav
   89516 swing3.wav
   23980 swing4.wav
   25644 swing5.wav
   54316 swing6.wav
   23852 swing7.wav
   22444 swing8.wav
   89134 hum1.wav

All of these sound effects work without issue.

Thanks in advance for your help.

 

retrousse