fiduciary

Author Topic: TeensySaber Software Discussion  (Read 67067 times)

0 Members and 2 Guests are viewing this topic.

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: TeensySaber Software Discussion
« Reply #75 on: June 20, 2017, 06:19:36 PM »
Sorry, missed it before.
I think maybe you want the "poweroff" sound. If I remember correctly "pwroff" is meant to be the opposite of the "boot" sound, and is not supported. (Although I suppose it could be supported with a large enough capacitor somewhere....)

That worked but is opposite of how it worked with the Serial Flash on the Prop Shield.  With my Teensy 3.2 / Prop Shield set up the pwroff01.wav played when powering off the blade and poweroff.wav didn't play.  It's not a big deal but I thought you should be aware.

Thanks for your support.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #76 on: June 20, 2017, 07:25:50 PM »
Sorry, missed it before.
I think maybe you want the "poweroff" sound. If I remember correctly "pwroff" is meant to be the opposite of the "boot" sound, and is not supported. (Although I suppose it could be supported with a large enough capacitor somewhere....)

That worked but is opposite of how it worked with the Serial Flash on the Prop Shield.  With my Teensy 3.2 / Prop Shield set up the pwroff01.wav played when powering off the blade and poweroff.wav didn't play.  It's not a big deal but I thought you should be aware.

Thanks for your support.

Actually, it seems like poweroff and pwroff are really supposed to be part of the same set of effects and chosen randomly. (I should fix that.)
However, as far as I can tell, teensysaber has always played "poweroff*.wav", never "pwroff*.wav".

 

Offline Whosle

  • No Force
  • *
  • Posts: 31
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #77 on: June 22, 2017, 10:33:41 AM »
Hi Profezzorn,

  I hate to be that guy, but I need someone to help me understand the scope of my ignorance.  I am able to follow nearly everything on your instructions for V1.  Until, I get to the actual reading of the code and trying to understand what I am supposed to actually alter. It took me a good 10 minutes to find the blade array, and it still looks like Greek to me!

 I need to know how over my head I am, and then learn accordingly. I know I should crawl before I run a marathon, but I was hoping that I could alter the details and learnt how to  customize everything after I loaded your sketch.  I would be pretty smitten with all the functionality as demonstrated on your video.
   Currently I have it on a breadboard , and I am using almost the exact components you have, except I have an adafruit 5v ready sd card adapter (its huge). I hope to eventually complete another build with a teensy 3.6.



1) Is the sketch a "template"? I see so many open/close brackets and parenthesis my mind is tellimg me that I need to be filling in these spots... Or Can I just upload the sketch and it will work?

2) If I follow your steps exactly and use the same resistors as you have in the diagrams, can I more or less just " plug and play"?  I am testing with a RGB tri cree currently, but I have the other blades being constructed (same as yours).

3) The blades array, are all the blades described in the diagrams already in the sketch ? I Can't tell if I am supposed to build my own array(s). EDIT: I looked a bit longer, and now I understand the struct/ array descriptions in the code.

4) Do you upload the sketch before you solder it all together?  Does everything need to be connected in place before I upload the sketch?

  I think that is all for now, I will try my best not to ask too many basic questions after this. Your documentation and instructions are great, and usually If I stare at something long enough, it starts to make sense. I just need a little push in the right direction.

Thanks


 
« Last Edit: June 22, 2017, 11:01:52 AM by Whosle »

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #78 on: June 22, 2017, 11:27:03 AM »
Hi Profezzorn,

  I hate to be that guy, but I need someone to help me understand the scope of my ignorance.  I am able to follow nearly everything on your instructions for V1.  Until, I get to the actual reading of the code and trying to understand what I am supposed to actually alter. It took me a good 10 minutes to find the blade array, and it still looks like Greek to me!


The good news is that in the next version of the code, the blades array will be in a separate config file and should be much easier to find.

Quote
I need to know how over my head I am, and then learn accordingly. I know I should crawl before I run a marathon, but I was hoping that I could alter the details and learnt how to  customize everything after I loaded your sketch.  I would be pretty smitten with all the functionality as demonstrated on your video.

If you can operate a text editor, you really shouldn't be that far from figuring out how to configure the blades array.
It may look like greek, but it's really not that hard, and I don't mind helping.

Quote
Currently I have it on a breadboard , and I am using almost the exact components you have, except I have an adafruit 5v ready sd card adapter (its huge). I hope to eventually complete another build with a teensy 3.6.

1) Is the sketch a "template"? I see so many open/close brackets and parenthesis my mind is tellimg me that I need to be filling in these spots... Or Can I just upload the sketch and it will work?

It's not a template, but you will need to change a few things, as the sketch is configured for a V2.3 board by default.
The minimum you'll need to change is the VERSION_MAJOR and VERSION_MINOR defines, they should be 1 and 0 instead of 2 and 3.
You'll probably also need to change the blades and preset arrays to match the blades and sound fonts you have.

Quote
2) If I follow your steps exactly and use the same resistors as you have in the diagrams, can I more or less just " plug and play"?  I am testing with a RGB tri cree currently, but I have the other blades being constructed (same as yours).

Yes, assuming you put sound fonts in the same locations on the sound card.
But you really shouldn't worry about making it exactly the same as me, changing the blades array to match what you have really is easy.

Quote
3) The blades array, are all the blades described in the diagrams already in the sketch ? I Can't tell if I am supposed to build my own array(s).

The blades array actually contains the blades that I have, and is meant to be an example of what the blades arryay can look like.
While matching your blades to mine means you don't have to change it, that's not really the intention.

Quote
4) Do you upload the sketch before you solder it all together?  Does everything need to be connected in place before I upload the sketch?

Either way.
The sketch won't really work well until motion and sd card is connected, but you can upload it at any time.
Just make sure you cut VIN/VUSB on the teensy. Once that's done, you'll need battery power to upload new sketches.

Quote
  I think that is all for now, I will try my best not to ask too many basic questions after this. Your documentation and instructions are great, and usually If I stare at something long enough, it starts to make sense. I just need a little push in the right direction.

Thanks

Don't worry about it, the more questions you ask, the better the instructions will become! :)

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: TeensySaber Software Discussion
« Reply #79 on: June 24, 2017, 07:46:16 AM »
I recently obtained several soundfont sets that all have *.lsu files.  Are these files supported by the Teensy Saber code?  If not, what would you recommend I convert them to in order to use them?

Also, can you explain the difference between monophonic and polyphonic soundfonts?  If I'm going to convert sounds from say lsu to wav are there settings I should use to make them polyphonic vs. monophonic?

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #80 on: June 24, 2017, 10:35:29 AM »
I recently obtained several soundfont sets that all have *.lsu files.  Are these files supported by the Teensy Saber code?  If not, what would you recommend I convert them to in order to use them?

Also, can you explain the difference between monophonic and polyphonic soundfonts?  If I'm going to convert sounds from say lsu to wav are there settings I should use to make them polyphonic vs. monophonic?

TeensySaber should be able to play the lsu files directly. (They really are just RAW audio files.)
However, the LSU files don't have any sort of consistent naming scheme, so you have to rename the files, or teensysaber will not be able to find them.
(See the "sound effect filenames" section on this page.)

I think LSU-based sound fonts are monophonic (meaning that only one sound play at a time, so the hum is mixed in with the sound effects.) Polyphonic sound fonts do not have the hum mixed in, so the sound board has to play the hum and the effect at the same time. Teensysaber uses the name of the files to determine if a font is polyphonic or monophonic, there are no settings.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #81 on: June 30, 2017, 08:05:34 PM »
New software update: 1.144

  • Licence change, now uses GPLv3
  • Spoken error messages
  • "batt" command speaks the voltage
  • Most of of the configuration variables are now in separate files, making it easier to have different configurations for different sabers.
  • Works with teensy 3.5
  • Automatically uses internal SD card for Teensy 3.5/3.6
  • MTP now works with SerialFlash for V1 builds.
  • Experimental support for zero-button sabers. (hand-twist turns saber on/off)
  • Support for clash string in segmented blades.
  • cleaned up touchbutton configuration
  • many many bugfixes

PS: TeensySaber V2 for sale



Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: TeensySaber Software Discussion
« Reply #82 on: July 07, 2017, 08:27:37 PM »
New software update: 1.144

  • MTP now works with SerialFlash for V1 builds.

Is there anything special I would need to do to support MTP with the PropShield SerialFlash on my V1 saber besides the #define ENABLE_SERIALFLASH statement?

Will MTP support allow me to create folders on the SerialFlash (which is not supported using Teensytransfer)?

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #83 on: July 07, 2017, 09:34:37 PM »
New software update: 1.144

  • MTP now works with SerialFlash for V1 builds.

Is there anything special I would need to do to support MTP with the PropShield SerialFlash on my V1 saber besides the #define ENABLE_SERIALFLASH statement?

Will MTP support allow me to create folders on the SerialFlash (which is not supported using Teensytransfer)?


No, nothing special. All you should need is ENABLE_SERIALFLASH and select "MTP disk (experimental)" in the usb type menu.
It will not let you make folders though. Folders are not supported by the SerialFlash library.


Offline Whosle

  • No Force
  • *
  • Posts: 31
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #84 on: July 09, 2017, 09:43:04 AM »
Hello Again,

  I have had moderate success with putting the unit together.

Serial monitor works, but there are some issues.

1) When SD card is inserted, it gets stuck reading font03 and pretty much bricks the teensy. (serial monitor won't update after scanning font03 comes up) I have tried two different soundcards, and re-sampled the sound to mono 44100. When I open the wav in audacity, it always says its at 32 bit float. At this point I am about to try a different SD card reader. This is the sd card reader I am using now, I have it connected to 5v pad.
 MicroSD card breakout board+ ID: 254 - .50 : Adafruit Industries, Unique & fun
My soundfonts directories are seperated out on sd card by: sdcard/font01
sdcard/font02
etc... There is a tracks directory in every font directory.

2) The top ID line sends out random data that is different everytime. I changed the float pullup to match my resistor (100k ohm). Currently my ID line is as follows: ID 687 volts 2.21 resistance=67272.98[/b]

3) Blade=7 simple blade changes even though I have the charging blade in. Sometimes it says blade=0 ws2811 blade with 81 Leds.
Are my resistors to blame? (alicrappa special) . I have matched the resistor values in the code.

4) Battery voltage seems ok. I had wrong pullup intially and burnt out a couple neopixels.

5) Is there a turorial on how to flash sounds to the teensy memory? and what format?
Beep and pow commands work on my simple string blade and my charging plug.

6) I can only talk to my teensy through the serial monitor if I upload a sketch. I cannot unplug it and plug it back in again, even with reset button etc. Not a huge issue, just wondering if it happens to others.

I will most likely download the  new version to try out the new serial flash menu.

At this point I am about to change out the SD card reader, but I want to test the sound via teensy serial first.

I am pretty happy I at least got it talking through the serial!

If there are formatting issues for these questions I ask, and you would like me to improve it for ease of reading, let me know.
Thanks again,
 

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #85 on: July 09, 2017, 10:24:37 AM »
Hello Again,

  I have had moderate success with putting the unit together.

Serial monitor works, but there are some issues.

1) When SD card is inserted, it gets stuck reading font03 and pretty much bricks the teensy. (serial monitor won't update after scanning font03 comes up) I have tried two different soundcards, and re-sampled the sound to mono 44100. When I open the wav in audacity, it always says its at 32 bit float. At this point I am about to try a different SD card reader. This is the sd card reader I am using now, I have it connected to 5v pad.
 MicroSD card breakout board+ ID: 254 - .50 : Adafruit Industries, Unique & fun
My soundfonts directories are seperated out on sd card by: sdcard/font01
sdcard/font02
etc... There is a tracks directory in every font directory.
I usually have the tracks directory in the root folder of the sdcard. If you have it in the font directory, you'll need to put names like "font01/tracks/march.wav" in the preset array, but that should work just fine.

I haven't tried using that SD card reader myself, but I don't see a reason why it wouldn't work. I assume that you have CS connected to pin 0?
The kind of problems you're having sounds a lot like what happens when the SD card isn't connected correctly.

You can try commenting out #define ENABLE_SDCARD and see if it works better.

Quote
2) The top ID line sends out random data that is different everytime. I changed the float pullup to match my resistor (100k ohm). Currently my ID line is as follows: ID 687 volts 2.21 resistance=67272.98[/b]

This can happen right after re-programming because neopixels have little capacitors in them which push some of the
current back down. It usually works better when the circuit is unpowered before the blade is connected.
Not sure why you would change the pullup resistor though. In a V1 configuration, the pullup resistor is internal (meaning that it's inside the teensy).

Quote
3) Blade=7 simple blade changes even though I have the charging blade in. Sometimes it says blade=0 ws2811 blade with 81 Leds.
Are my resistors to blame? (alicrappa special) . I have matched the resistor values in the code.

No, probably the neopixels are to blame. (I assume you have one in your charging blade, is that correct?)
I recommend using fairly small (a few Kohm) blade ID resistors for neopixel blades.

Quote
4) Battery voltage seems ok. I had wrong pullup intially and burnt out a couple neopixels.

Eh? Not sure how you can burn neopixels by having the wrong pullup...

Quote
5) Is there a turorial on how to flash sounds to the teensy memory? and what format?
Beep and pow commands work on my simple string blade and my charging plug.

Generally, the sounds go on the SD card.
If you have a prop shield, you can also put them on the serialflash memory on the prop shield.
With the latest teensysaber software, you should be able to just drag-n-drop files onto the serialflash, assuming you have the latest teensyduino software and choose "MTP disk (experimental)" for USB type.

Quote
6) I can only talk to my teensy through the serial monitor if I upload a sketch. I cannot unplug it and plug it back in again, even with reset button etc. Not a huge issue, just wondering if it happens to others.

That's kind of weird.
Pushing the reset button puts the teensy in programming mode, so you won't be able to talk to it until you either program it or disconnect it from power and plug it in again, so that part is not so weird.

Quote
I will most likely download the  new version to try out the new serial flash menu.

At this point I am about to change out the SD card reader, but I want to test the sound via teensy serial first.

I am pretty happy I at least got it talking through the serial!

If there are formatting issues for these questions I ask, and you would like me to improve it for ease of reading, let me know.
Thanks again,

A little more context would help, as it seems that your build isn't the same as mine.
Also, pictures is always a good idea.

Offline Whosle

  • No Force
  • *
  • Posts: 31
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #86 on: July 09, 2017, 04:17:25 PM »
Profezzorn,

Thank you for the quick reply.

Quote
   I haven't tried using that SD card reader myself, but I don't see a reason why it wouldn't work. I assume that you have CS connected to pin 0?
The kind of problems you're having sounds a lot like what happens when the SD card isn't connected correctly.
 

  I have CS connected to pin 0. I tried hooking it up to 3v pad, with no luck. Adafruit says short wires are Ideal, so I will try that before I break down and purchase the same sd card reader from PJRC. (Unless you have an extra one you can sell me one along with a teensy saber V2!). :smiley:

Quote
In a V1 configuration, the pullup resistor is internal (meaning that it's inside the teensy).
I changed the external float pullup as described by your tutorial, you have a 23 k ohm, I used a 100 K ohm. Did I misread \misunderstood this?

Quote
Eh? Not sure how you can burn neopixels by having the wrong pullup...

My hair-brained theory as to why I popped 2 8mm strawhat neopixels (near end of blade), is that I had 10 k ohm in the code when I actually had 100 k ohm.This gave a false voltage reading on battery. The red and orange stripes on the resistors are tough to differentiate in my basement lab. I swore a few times when I saw it in daylight.

I have 4 pics online on my deviantart profile. I hope it's not too weird to link to it, since  photobucket went paywall/ransomware.

Whosle (J H) | DeviantArt

Teensy Saber by Whosle on DeviantArt

Teensy Saber by Whosle on DeviantArt
 
My biggest concern now , I used a couple of cheap wires to help with color coding. The green, blue and yellow wires all have fairly brittle copper strands.

Let me know if you want more pics to see my build. I have nearly the same ingredients, I am using a protected 3.7v for testing, before I move on to the (repected!) Samsung unprotected one you linked on your page.

I have an microusb charger card in the charging blade setup.

Thanks.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #87 on: July 09, 2017, 04:58:55 PM »
Profezzorn,

Thank you for the quick reply.

I have CS connected to pin 0. I tried hooking it up to 3v pad, with no luck. Adafruit says short wires are Ideal, so I will try that before I break down and purchase the same sd card reader from PJRC. (Unless you have an extra one you can sell me one along with a teensy saber V2!). :smiley:


I do actually have an extra PJRC sd card adapter which I can sell to you.
Of course, if you use the TeensySaberV2, you won't need it. :)

Try shorter wires, it actually matters. (Also double-check your wiring, I have mixed up din/dout more times than I care to admit...)
I'd check it for you, but I can't see what is hooked up to what from the pictures.
You might also want to try one the sd card example sketches to just try the sd card by itself.
Last, but not least, please try commenting out #define ENABLE_SD It's not a permanent solution, but if it works without the sd card, then the problem is definitely with the sd card. :)

Quote

My hair-brained theory as to why I popped 2 8mm strawhat neopixels (near end of blade), is that I had 10 k ohm in the code when I actually had 100 k ohm.This gave a false voltage reading on battery. The red and orange stripes on the resistors are tough to differentiate in my basement lab. I swore a few times when I saw it in daylight.


I only know of three ways to burn neopixels: 1) reverse the voltage  2) solder them too hot 3) over-voltage (which should be impossible with a 3.7v battery.)


Quote
I have 4 pics online on my deviantart profile. I hope it's not too weird to link to it, since  photobucket went paywall/ransomware.

Anytyhing is better than photobucket.

Quote

Whosle (J H) | DeviantArt

Teensy Saber by Whosle on DeviantArt

Teensy Saber by Whosle on DeviantArt
 
My biggest concern now , I used a couple of cheap wires to help with color coding. The green, blue and yellow wires all have fairly brittle copper strands.

I like using ribbon cable, then I tear off as many wires as I need. The bundles are much easier to keep track of than individual cables.

Quote
Let me know if you want more pics to see my build. I have nearly the same ingredients, I am using a protected 3.7v for testing, before I move on to the (repected!) Samsung unprotected one you linked on your page.

I have an microusb charger card in the charging blade setup.

Thanks.

Looks like you don't have a resistor between the neopixel data line and the connector though. 100-300ohm is usually recommended and may help stabilize the blade ID thingy.


Offline Whosle

  • No Force
  • *
  • Posts: 31
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #88 on: July 09, 2017, 07:35:53 PM »
Profezzorn,

 I failed to mention that when the sdcard isn't inserted, the sketch moves forward and I can access help menu etc.

If I try the CD command it gets stuck on reading font03.
 
I will try everything you suggested and triple check my wiring.

Quote
I do actually have an extra PJRC sd card adapter which I can sell to you.
Of course, if you use the TeensySaberV2, you won't need it. :)

I will get back to you on the next 2 days on the teensysaber V2 after these next few tries. Local shop just picked up more teensy3.2. I have a 3.6 and another prop shield which I was planning on starting after this one (seemed easier),that was before reading your release notes on new software, I am thinking about starting it.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #89 on: July 09, 2017, 09:08:32 PM »
Profezzorn,

I failed to mention that when the sdcard isn't inserted, the sketch moves forward and I can access help menu etc.

If I try the CD command it gets stuck on reading font03.
 
I will try everything you suggested and triple check my wiring.

Guess there is no need to comment out ENABLE_SD then, as we already know that's the problem.
First of all, make sure you run the last version of the TeensySaber software, it has some bugfixes that may be relevant.
Second, try renaming "font03" on the sd card, or change the preset array so that the font isn't found. Then try typing "dir" in the serial monitor.

Basically, there are three things that could be going wrong:
1. There is something wrong with the SD card itself. (either corruption, or maybe it's exfat or something that the SD library doesn't understand.) Maybe try a different card or an empty sd card.
2. Signalling problems, either the wires are too long, or not hooked up correctly. Signalling problems will usually cause hangs, but they can be
   somewhat random.
3. Playback problems: After scanning the directory, it will try to play the "boot" sound, if this crashes, we could end up with the same type of problem. If you delete the boot sounds, you should be able to rule this out.

 

retrousse