fiduciary

Author Topic: TeensySaber Software Discussion  (Read 67324 times)

0 Members and 6 Guests are viewing this topic.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #210 on: January 09, 2018, 03:58:03 PM »
Update, re-soldered my blade connections and now no more random on LEDs, so that's good, and all my effects are working.

I think I may have some font issues though.  I'm using a polyphonic font and I'm getting 2 things don't seem right.

1) The hum fades out when power button is clicked, but the Amplifier does not turn off, I can hear it.  When I hit Aux and it goes to the next preset, then the Amp turns off.  Previously we thought it was because Motion was turned off and preventing the fade out, but that part is actually working now.  Is that something with the font do you think, or code? 


I think that might be a bug in my code, not your fault.

Quote

2) I'm getting 'Wrong Format' on my swing files, which is weird because they are no different than all the other files, and they play just fine in windows media player.

Here is some snippets of Serial Monitor logs:

Sdcard found..
ID: 224 volts 0.72 resistance= 9240.00
blade= 0
WS2811 Blade with 144 leds
Scanning sound font: fonts done
Activating polyphonic font.
unit = 0 vol = 0.50, No sounds found: boot
Amplifier off.
Motion setup ... done.
Welcome to TeensySaber, type 'help' for more info.

EVENT: Power-Pressed
EVENT: Power-Released
EVENT: Power-Shortclick
Ignition.
unit = 0 vol = 0.50, Playing fonts/hum/hum01.wav
channels: 1 rate: 22050 bits: 16
unit = 1 vol = 0.50, Playing fonts/out/out02.wav
channels: 1 rate: 22050 bits: 16

//Power button to turn off
EVENT: Power-Pressed ON
EVENT: Power-Released ON
EVENT: Power-Shortclick ON
unit = 1 vol = 0.50, Playing fonts/in/in02.wav
channels: 1 rate: 22050 bits: 16
Battery voltage: 3.87

//whatison
Saber bases: Off
Audio splicer: Off
Beeper: Off
Talker: Off
Wav player 0: On (eof =  0 volume = 0.00)
Wav player 1: Off (eof =  1 volume = 0.50)
Wav player 2: Off (eof =  0 volume = 0.50)
Wav player 3: Off (eof =  0 volume = 0.50)
Wav player 4: Off (eof =  0 volume = 0.50)
Wav player 5: Off (eof =  0 volume = 0.50)

//aux button to change presets
EVENT: Aux-Pressed
EVENT: Aux-Released
EVENT: Aux-Shortclick
DISPLAY: blue
Scanning sound font: fonts done
Activating polyphonic font.
unit = 0 vol = 0.50, Playing fonts/font.wav
channels: 1 rate: 22050 bits: 16
Amplifier off.

//whatison
Saber bases: Off
Audio splicer: Off
Beeper: Off
Talker: Off
Wav player 0: Off (eof =  1 volume = 0.50)
Wav player 1: Off (eof =  0 volume = 0.50)
Wav player 2: Off (eof =  0 volume = 0.50)
Wav player 3: Off (eof =  0 volume = 0.50)
Wav player 4: Off (eof =  0 volume = 0.50)
Wav player 5: Off (eof =  0 volume = 0.50)


EVENT: Power-Pressed
EVENT: Power-Released
EVENT: Power-Shortclick
Ignition.
unit = 0 vol = 0.50, Playing fonts/hum/hum01.wav
channels: 1 rate: 22050 bits: 16
unit = 1 vol = 0.50, Playing fonts/out/out03.wav
channels: 1 rate: 22050 bits: 16
Battery voltage: 3.71

unit = 1 vol = 0.50, Playing fonts/swng/swng06.wav
Wrong format.
EVENT: Clash ON
unit = 1 vol = 0.50, Playing fonts/clsh/clsh13.wav
channels: 1 rate: 22050 bits: 16
EVENT: Clash ON
unit = 2 vol = 0.50, Playing fonts/clsh/clsh03.wav
channels: 1 rate: 22050 bits: 16
unit = 3 vol = 0.50, Playing fonts/swng/swng01.wav
Wrong format.
unit = 3 vol = 0.50, Playing fonts/swng/swng04.wav
Wrong format.
unit = 3 vol = 0.50, Playing fonts/swng/swng07.wav
Wrong format.

"wrong format" generally means that the wav file is not saved as PCM.
Where did this font come from? Can I download and try it? Or could you send it to me at hubbe@hubbe.net?



Offline spearson

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #211 on: January 09, 2018, 04:11:44 PM »
I bought it off of saberfont.com. 

I'll send it to you, I just noticed (using VLC) that the swng fonts are 44100 32bit, which may be the issue according to your troubleshooting page.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #212 on: January 09, 2018, 04:26:12 PM »
I bought it off of saberfont.com. 

I'll send it to you, I just noticed (using VLC) that the swng fonts are 44100 32bit, which may be the issue according to your troubleshooting page.

Could be, although I don't think you would get that error message for 32bit files.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #213 on: January 22, 2018, 11:44:13 PM »
New TeensySaber software version: 1.191

ChangeLog (since 1.175)
o SmoothSwing V2 support!!! - Demo: SmoothSwing v2 Multiple Font Demo - YouTube Many thanks to Thexter for his excellent work on this algorithm.
o Better wav reader - skips comments and handles 24-bit wav files
o Cylon - back-and-forth effect
o Clash sensitivity is reduced when swinging.

Same Bat time, same Bat channel:
Teensy Saber OS


Offline bobi-one

  • No Force
  • *
  • Posts: 43
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #214 on: January 23, 2018, 01:25:59 AM »
New TeensySaber software version: 1.191

ChangeLog (since 1.175)
o SmoothSwing V2 support!!! - Demo: SmoothSwing v2 Multiple Font Demo - YouTube Many thanks to Thexter for his excellent work on this algorithm.
o Better wav reader - skips comments and handles 24-bit wav files
o Cylon - back-and-forth effect
o Clash sensitivity is reduced when swinging.

Same Bat time, same Bat channel:
Teensy Saber OS
Pure Epic awesomeness. Do you still change the swingl and swingh files as before? Maybe I will automate it in a bash script, to make  configurable variety of swings.

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #215 on: January 23, 2018, 08:20:31 AM »
New TeensySaber software version: 1.191
Cool, all good stuff!

Ditto bobi-one, do I need to redo the swingl and swingh files?

Since you asked me to remind you, did you add code for inverting the X (and possibly other) axis?

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #216 on: January 23, 2018, 10:02:57 AM »
Additional info on SmoothSwing V2 is on the Teensy Saber OS page near the bottom - Teensy Saber OS

Looks like V2 now supports more than one swingl.wav and swingh.wav file (ie. swingl01.wav, swingl02.wav)

I guess I'll start with my swingl.wav and swinh.wav I made based on profezzorn's instructions:

Code: [Select]
sox hum.wav swingh.wav speed -180c rate -v
sox hum.wav swingl.wav speed 150c rate -v

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #217 on: January 23, 2018, 11:01:48 AM »
Additional info on SmoothSwing V2 is on the Teensy Saber OS page near the bottom - Teensy Saber OS

Looks like V2 now supports more than one swingl.wav and swingh.wav file (ie. swingl01.wav, swingl02.wav)

I guess I'll start with my swingl.wav and swinh.wav I made based on profezzorn's instructions:

Code: [Select]
sox hum.wav swingh.wav speed -180c rate -v
sox hum.wav swingl.wav speed 150c rate -v


For smoothswing V2 you'll want multiple swingl/swingh pairs.
(Although multiple swingl/swingh is good for smoothswing v1 as well, but in a different way.)
I've been using something like this:

Code: [Select]
sox hum.wav swingl01.wav pitch -200 tremolo 12 60 overdrive 15 75
sox hum.wav swingh01.wav pitch 150 tremolo 12 60 overdrive 15 75

Then you change a few of the parameters to make swingl02/swingh02, etc.
A formant filter to change the tonal quality of the hum would be even better, but sox doesn't have that.
Also, taking a the hum from a different font may be better than using the hum from the same font.
However, Thexter's sounds are much better than mine, and hopefully other people will start experiment and add their own tricks when creating these files.

And no, I did not add code for the orientation yet, as I couldn't decide on the best way to do it, thanks for the reminder.


Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #218 on: January 23, 2018, 04:42:24 PM »
Feedback:

On the Teensy Saber OS page it says the file is somoothsw.ini, should be smoothsw.ini

lightsaber.ino on GitHub at line 172 is:
Code: [Select]
const char version[] = "$Id$";I think it needs more Id info like 1.175:
Code: [Select]
const char version[] = "$Id: lightsaber.ino,v 1.175 2017/12/10 01:16:22 hubbe Exp $";

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #219 on: January 23, 2018, 07:05:22 PM »
Feedback:

On the Teensy Saber OS page it says the file is somoothsw.ini, should be smoothsw.ini

lightsaber.ino on GitHub at line 172 is:
Code: [Select]
const char version[] = "$Id$";I think it needs more Id info like 1.175:
Code: [Select]
const char version[] = "$Id: lightsaber.ino,v 1.175 2017/12/10 01:16:22 hubbe Exp $";

Thank you, the typo is fixed.
The $Id$ thing comes from CVS, and the cvs-to-git script I'm using doesn't support it unfortunately.
If/When I move all development to github, I will stop using the $Id$ thing and just update the version manually.

Offline KanyonKris

  • Padawan Learner
  • **
  • Posts: 72
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #220 on: January 25, 2018, 11:56:19 AM »
For smoothswing V2 you'll want multiple swingl/swingh pairs.
Are the swingl/swingh pairs selected randomly or does the order mean something? I'm wondering if smoothswing V2 selects the lower pairs (ie swingl01.wav, swingh01.wav) for slow swings and higher pairs (ie swingl05.wav, swingh05.wav) for faster swings. If smoothswing V2 doesn't work this way, should it? Then the pairs could have more aggressive sound as the pair numbers go up.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #221 on: January 25, 2018, 12:08:01 PM »
For smoothswing V2 you'll want multiple swingl/swingh pairs.
Are the swingl/swingh pairs selected randomly or does the order mean something? I'm wondering if smoothswing V2 selects the lower pairs (ie swingl01.wav, swingh01.wav) for slow swings and higher pairs (ie swingl05.wav, swingh05.wav) for faster swings. If smoothswing V2 doesn't work this way, should it? Then the pairs could have more aggressive sound as the pair numbers go up.

They are selected randomly.
It's possible that there is a better way to select swing sounds, but I guess that would be called SmoothSwing V3. :)
Not sure how well it would work though, as it's very difficult to know how aggressive the swing is going to be in the beginning of the swing. Also, I'm not sure that it's actually better than random. I mean, if you do the same swing over and over, do you want it to sound the same?

Offline spearson

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #222 on: January 28, 2018, 06:37:22 PM »
Two questions on smooth swing,

1) What is a good length of a hum file to use?  I have some hums from a different font and the hum file is only 2 seconds long.  This causes a strange speaker pop/crackle every 2 seconds when there is no swinging (like sitting stationary on the desk).

2) The files are named swingl and swingh, these seem to coincide with monophonic font names, should I do something different if I have a polyphonic font(swngl and swngh), or does that not matter?  If it doesn't matter, can my swingl and h files be made from mono font even though I have a polyphonic font?

Offline spearson

  • No Force
  • *
  • Posts: 20
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #223 on: January 28, 2018, 07:19:24 PM »
volHum and volEff are set at 15 and 16, what does 15/16 represent, a percentage out of 100?  I have my overall volume at 1750, and my effects are ear piercing, the hum volume is perfect, and the swinging I wish I could get louder.  I've been playing with changing volHum and volEff (via config file) but it doesn't seem to have an effect.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #224 on: January 28, 2018, 08:58:21 PM »
Two questions on smooth swing,

1) What is a good length of a hum file to use?  I have some hums from a different font and the hum file is only 2 seconds long.  This causes a strange speaker pop/crackle every 2 seconds when there is no swinging (like sitting stationary on the desk).

2) The files are named swingl and swingh, these seem to coincide with monophonic font names, should I do something different if I have a polyphonic font(swngl and swngh), or does that not matter?  If it doesn't matter, can my swingl and h files be made from mono font even though I have a polyphonic font?

1. Generally speaking, longer is better, because it makes the sound less repetitive. Beyond 20 seconds it probably doesn't matter though.
The pop/crackle isn't a good thing though. My best guess is that you get an underflow on the main hum while the other two hums are re-opened.
Things to try that may fix it:

a) Try a different sd card (I mostly use Sandisk.)
b) Make sure your sounds are 16-bit mono. (24/32-bit and stereo are a waste of sd card bandwidth.)
c) Try making the hums different lengths. This will make them loop around at different times.
d) Increase the buffer in BufferedWavPlayer (I've been considering doing this myself...)

Note to self: add sd card bandwidth latency/bandwidth testing command to teensysaber...

2. The SmoothSwing V1/V2 is implemented separately from the font renderer, which means that it works with both polyphonic and monophonic fonts. However, with monophonic fonts, clashes and blast effects will be be toned down while swinging, with polyphonic fonts they will not, as they are played separately.

volHum and volEff are set at 15 and 16, what does 15/16 represent, a percentage out of 100?  I have my overall volume at 1750, and my effects are ear piercing, the hum volume is perfect, and the swinging I wish I could get louder.  I've been playing with changing volHum and volEff (via config file) but it doesn't seem to have an effect.

No, 16 is the max.
Smoothswing V2 volume is controlled by smoothsw.ini, in particular SwingSensetivity, SwingSharpness and MaxSwingVolume.
More info here: Teensy Saber OS

 

retrousse