Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - XRAD

Pages: [1] 2 3
1
Show and Tell / Re: Tamiya Gepard(Cheetah) SPAAG
« on: September 21, 2018, 09:38:25 AM »
Gepard is one of my favorite models.  Nice work with the 3D.   See if you can build a cool  vibration system and LED lighting to go with it...maybe a off weighted high rpm motor....





2
I have another thought regarding sound file processing:

If you are at full throttle(FT) and in the FT loop, and drop to idle (let go of stick,not throttle down slowly), then 'play decel wav' would be straightforward.

If you are at half throttle (or in any of the  accel track loops) and drop to idle, you will only need 1/2 (or at the proportionate location)  of the 'play decel wav.'    Same with 'play acceleration wav'  if so inclined. 

The question is how to locate and buffer any point in a .wav file while playing the other tracks. This calculation would really only need to be done when you have entered a track loop for a time long enough to allow a calculation as to where to enter the 'play decel wav'  and probably not necessary for any of the lower rpm accel wav tracks.  Say 25% throttle and greater could use this 'play decel wav' interrupt. 

Alternative: you will not have to calculate where to enter the 'decel' track! If you are at accel wav 3, you may be at half throt, and therefore only need 1/2 of the decel track, so you can just use a' 1/2 decel track .wav'....

And if you are throttling up or down slowly, you could just run through the standard accel step wavs blending one into the other as you already plan.  The more accel steps, the smoother this will be,,,,

3
Show and Tell / Re: XRAD'S Elefant
« on: September 06, 2018, 04:51:21 PM »
THX Luke and Johnnyvd! Appreciate the comments.    :)    Looks a lot better with some paint and some washes,,,,

4
Show and Tell / Re: Using the Openpanzer TCB for LCM-3 Landing Craft
« on: September 06, 2018, 10:42:41 AM »
the OPTCB works great with the Benedini mini sound board for tank engine sounds (for throttle up/down), and for lights, and MG sounds, and many other sounds.  http://www.benedini.de/html/sound.html 

However, I have not listened to all Benedini sound files (http://www.benedini.de/html/demo.html#Sounds)  for boats (he has some boat sounds). He probably has 50 cal sounds since he has the Sherman.   You can email Benedini for more info. He is quick to respond.  You can also add you own sounds to Benedini mini and trigger them with the OPTCB

Remember to read this:
http://openpanzer.org/wiki/doku.php?id=wiki:tcb:tcbinstall:rx

Using the OPTCB for twin engine boat would be a cool project since you can mix power to the motors if you wanted on one stick (2 channel, for RIGHT F/R and LEFT F/R), or just run them on a single channel for F and R.  You can assign the other stick to rudder.

The OPTCB allows you to control many channels for anything such as rotating and elevation of guns, ramp control, break-out boards, shields, etc.  The OPTCB is VERY flexible for all different set-ups AND the OPConfig is easy to use (real reason I bought one).  No point in having a great control board if you can't easily change something.  For example, you could assign 2 of the pots on the RadioLink AT10II to control 50 cal rotation and elevation, and use the MG to fire on a momentary switch (top right on the RadioLink), and the sticks for motors and rudders.

I am using the RadioLink 12 channel AT10II  sbus system. works without issue with the OPTCB. Download the OPTCB configurator and play around with it to get an idea of what you can do.

5
Show and Tell / Re: XRAD'S Elefant
« on: September 06, 2018, 10:00:44 AM »
Some more details....

6
Luke, I spent a few hours revisiting 15 files of your sound card code. You have designed an all inclusive set-up and have control for just about every major factor I can think of. I really like the non-repeat sound sections, and the test routines.  Although I did see (-1) no play last played track, I did not see a [random()] sound call/function. Since you have so many sound .wav for engine at each step, and squeaks, this might be a neat addition (as a GUI selection).  Or maybe it's in the code and I missed it...

One other thought would be to add into the OPTCB sound GUI a way to look at the .wav SD files so that you could test/play each one individually (not necessarily sending .wav back through the OP sound board serial connect to laptop speaker, but output via the Sound board amp and speaker, similar to the sequential play in test routine, instead selecting one track at a time).  Although playing all tracks in a row with small delay is helpful to test them (w/the ground pin 1 on startup), it is hard to keep track of which file is which sound without a visual representation of the SD card contents. So when the SD card is inserted into the OP sound board, it might be a cool option to see the files and play each one (and it would be another distinction for your sound board over any other).

Anyway, great job!!  Will definitely purchase when complete!

7
Luke , I know you are decided on hardware. Not trying to switch your mind here but I am experimenting with Teensy 3.2 serial control of Robertsonics tsunami(3.3v logic). The tsunami is wayyyyy more powerfull than we would ever need for an RC tank or car, but maybe not for an animatronic figure or robot or other interactive purpose. It can play 32 C10 micro SD wav tracks at same time with built in level matching, fade, and pitch control.  His old wav board had a built in amp, this one does not. It is a bit on the large size at ~8x8cm and relatively expensive(could be made smaller easily by eliminating the numerous analog inputs and outputs).  There is only 10-15msecs delay before track play.  The robersonics old wav board is half the price and a bit smaller, and is polyphonic too...but lacks some of the new Tsunami functions.  Plenty of free control code for the robersonics boards available. 

8
Thx Luke,  tell me I am wasting time, it's OK.  I just read through your code on Github:

Code: [Select]
     if (FX[i].SDWav.isPlaying() && (FX[i].SDWav.positionMillis() >= (FX[i].soundFile.length - TRACK_OVERLAY_FADE_TIME_MS)))
                    {   
                        FadeRepeatOverlaySound(TrackOverlaySound[GetOverlaySoundNumBySpeed()],TO_TR_KEEP_MOVING);    // Fade in and start repeating
                    }
                    break;
and your track 'mixing'   code...

and the 2 track engine sounds so no 'break' in the loop

You already have all this!  Glad I was only starting my UNO code!

10 accel/decel segments should be more than enough. I counted only maybe 4-5 on the Benedini.  The only thing I notice w/ SD card playback is the 'break' during loops. this would happen anytime the stick position is maintained longer than the playback time on accel decel sound files...such as holding mid throttle.  So if stick maintained for (x)millis, you may consider that another track of same level throttle sound is faded in and overlapped before the baseline mid throttle file is completed, and they would just repeat until throttle change.   So for every throttle position that is not idle or full throttle or the return to stick neutral decel sound, there has to be x2 tracks of same rpm sound.   Unless, you can access a file again while it is playing so that the data can be preloaded into a buffer. 

One other thought was using an interrupt to processor to identify 'pwm' delta throttle and save on processing loops.  Not sure if this is needed w/sbus.......

9
So I am going to try this as time allows:

servo signal (throttle up/down)  TO ('pwm' decoder? if needed) TO adafruit feather express(or arduino AVR or whatever processor I can find in my spares box) TO wt588D TO amp. OR I might use adafruit FX 16mb board if I can find mine. Adafruit hardware and arduino code/libraries is fairly easy to work with.

So there is a bit of code to figure out as the chinese instructions example code is limited for the wt588d. I can use something like this (happens to be for a light saber but same idea). Just need to set up the servo signal interface. The WT588D_Send_Command(byte address) can be used for sound track playback and defined in the wt588d.h . Its going to take a bit of time to get it sorted.  I need to get a few of the wt588d-u :

Code: [Select]
#define WT588D_SDA 0 //Module pin "P03" or pin # 10
const int xpin = A0;                  // x-axis of the accelerometer
const int ypin = A1;                  // y-axis
const int zpin = A2;                  // z-axis (only on 3-axis models)
int oldtime;
int newtime;

void setup() {
  pinMode(WT588D_SDA, OUTPUT); 
  oldtime = analogRead(xpin) + analogRead(ypin) + analogRead(zpin); //establish a baseline read for the ADXL

void loop()
{
delay (50);
newtime = analogRead(xpin) + analogRead(ypin) + analogRead(zpin);
 
if
  (newtime - oldtime >= 40 || newtime - oldtime <= -40 ) // if there was movement...
 {
  WT588D_Send_Command(2); // Play swing sound
  delay (200); // wait a tick
}
  else
  {
  delay (20); // wait a tick
  }
 oldtime = analogRead(xpin) + analogRead(ypin) + analogRead(zpin); // sample the new movement of the ADXL
 delay(10);
 Serial.print(oldtime);
 Serial.print("\t");
 Serial.print(newtime);
 Serial.print("\t");
 Serial.print(newtime - oldtime);
 Serial.println();
 
 delay (50);
 }

void WT588D_Send_Command(byte addr) {
    digitalWrite(WT588D_SDA, LOW);
    delay(5);

    for(int i = 0; i < 8; i++)  {
        digitalWrite(WT588D_SDA, HIGH);
        if(bitRead(addr, i)) {
            delayMicroseconds(600);
            digitalWrite(WT588D_SDA, LOW);
            delayMicroseconds(200);
        } else {
            delayMicroseconds(200);
            digitalWrite(WT588D_SDA, LOW);
            delayMicroseconds(600);
        }
    }
    digitalWrite(WT588D_SDA, HIGH);
    delay(100);
} //end WT588D_Send_Command


wt588d.h:

#ifndef _WT588D_H_
#define _WT588D_H_

#include <Arduino.h>

#ifdef __SAM3X8E__
typedef volatile RwReg PortReg;
typedef uint32_t PortMask;
#else
typedef volatile uint8_t PortReg;
typedef uint8_t PortMask;
#endif


class WT588D {
   
 public:
    WT588D(uint8_t resetPin, uint8_t chipSelectPin, uint8_t serialClockPin,
           uint8_t serialDataPin, uint8_t busyPin);
   
    void  begin(void);
   
    void    setVolume(uint8_t volume);
    void    playSound(uint8_t playListNumber);
    void    startLoopSound(void);
    void    stopLoopSound(void);
    boolean  isBusy(void);
   
 private:
    int8_t rstPin, csPin, sclPin, sdaPin, bsyPin; // pin numbers
    PortReg *csport, *sclport, *sdaport, *bsyport;
    PortMask cspinmask, sclpinmask, sdapinmask, bsypinmask;

    boolean  waitForBusy(uint32_t timeout = 200L);
    void     sendCommand(uint8_t cmd);
};

#endif // _WT588D_H_

10
It would be nice to just swap an SD card, but I think that flash memory is easy to use too.  Cable vs card. Still have to plug something in.  Or, another solution! you can use both SD  and Flash. Flash for throttle/idle/accel/decel and SD for everything else. That way you can maintain a background engine sound and overplay with MG cannon voices etc...and keep the design pretty simple, and use a micro SD socket for all the non-engine sounds.

OK did some more testing. Using the WAV files for my decel and idle, I loaded them to a WT588D (see below).  The Wt has 10-40msec transition and a built in fade which helps smooth the sound. I did not add fade in or out to the base sound files. Here are WT588D specs (cost 2$!!) and you can easily add 10 throttle transition steps up and down, decel, idle, and full throttle, and run it in serial mode:

http://radiocom.dn.ua/image/data/pdf/WT588D_WT.pdf

http://www.ars-informatica.ca/eclectic/programming-the-wt588d-sound-module-part-3-three-line-serial-mode/

And there is the version with built in programmer module :
http://www.icstation.com/wt588d-voice-sound-module-mini-interface-32mbit-sound-speaker-module-8ohm-voice-playback-module-p-13084.html

There are a few good SPI controlled sound cards. Adafruit has several WAV shields (control via atmega328 vs 128 however).  I have used several of ladyada's FX sound boards and they are very fast and easy to program. I think that the playback hardware is out there now.  Serial control and ease of use by general population is the only issue.

I love this board too(but it does not run a background sound and only plays one sound at a time). It reads memory very fast and the sound quality and amp section are fantastic:
http://www.thecustomsabershop.com/Blaster-Core-Sound-Module-V5-P1182.aspx

With audacity, you can make good sound files and save to 16Hz wav mono. The resolution on audacity allows for creating/identifying  subtle breaks in the sound bite where needed.  Definitely needs an external amp as the built in amp is only 0.5watt or something.

My 9 second sound idle sound bite in loop. smooth transition at 1 sec, 9 sec, 19 sec in first vid.  My sound bites in series in second vid. You can hear the transition, but you can't discern an audible gap in the transition:

LOOP:
feature=youtu.be

SERIES:
feature=youtu.be







11
Hi Luke.

Agree with everything you said.  Taking the 'stepped throttle' approach, the best sound to my ear is by adding a subtle delay/overlap between steps. For example, a  .2 second overlap as you go from one file to the next sound works well.  Not sure how many steps you would plan,  but these engines did not rev too high, so you could get away with 5-10 steps.  Below is visual of the blended soundtrack I made above, and then the highlighted section in second pic is .2 sec of overlap between idle change to throttle up.  I added a fade-out to end of the idle bite, and a fade-in to the throttle up sound bite.  Each bite has a ~.2 sec fade-in at beginning, and a fade-out at end .

You would have to plan to play each sound bite a fraction of a second longer after stick position change, latch the sound, as the new sound bite plays.  Now, I would think that idle, since it is probably going to be in a loop , can't have the fade-out effect.  Therefore, how to hide the broken record.   The sound track can be developed so that the the milisec delay on repeat can be buried into the track on a backfire or intermittent 'tick' AND can be better hidden by two overlapping idle tracks.  One can be longer than the other so that there is aliasing of the sound 'breaks.' I have made loops for WT588D chip and you really can't hear the break when I hide it. But I do not know the access speed of your set-up.

However, you can't put a hard fade into the sound bites as they would end up playing if the throttle position is held longer than the sound bite.  Therefore, you would have to write into the program a way to add a .2 sec fade-in and fade-out(could be by amplification) to each bite while latching the ending bite and playing the new bite.

Or forget the fade in/out and just use the latch-delay-overlap method.

Also, you may want to add an overall throttle up delay. By this I mean that the engine can only accelerate so fast. So that all throttle steps have to play sequentially (at least for a minimal amount of time) to get to full speed, rather than skipping steps to match stick position. this is more realistic.  Similar delay on throttle down as the stick returns . Only go to decel sound bite if stick returns to center.

Playback delay-overlap is going to be key here.   

So now this gets more complex in the programming. I still think you can create a throttle specific sound generator with pitch change just to fill the gap during accel and decel.  And overplay it with good idle and full throttle and decel sounds.  I have one of these and it does not sound too bad for 20$.

https://www.ebay.com/p/RC-Car-Truck-Engine-Sound-Module-Accelerator-Linkage-Sound-Set-10-Kinds-Sounds/628225464?iid=123008845993&chn=ps

 I think is a stepped generated sound and not stepped bites because it is the same rhythm different pitch and speed for 10 different engines. Or it could be stepped bites with pitch/speed change??  One of the sounds is pretty good and I use it in my defender.  You can hear it here:



12
OK , Thx Shad. trying zip file. Here is Jagdpanther HL230 decel idle accel decel clip I made up. Altered to mono 16 bit and amplified to -4 to -6dB.  And there is overlap, fade, and pitch change as needed.  Took 10min to make so not the best, but you get the idea.  The hard part is not editing the sound files to get same levels and clarity and density, but actually getting a good recording to start with. I added an 88mm firing at the end....

Now this is good for sound 'bites' but not for the throttle sound. to match the throttle stick position, the acceleration algorithm has to be somewhat linear, changing playback pitch and speed as needed (perhaps 10 times , or infinitely,  min to max throttle) to match the stick.  I don't think that using multiple sound bites throughout the throttle range is the best option. Using a baseline acceleration clip to overlap with the linear acceleration sound pattern will hide some of the digital sound. But the throttle sound will have to be a combination of increased playback speed and pitch change for best sound.

Or you would need a separate 'sound generator' just for throttle up-down positions, but this gets to be a bit much.

13
made some audacity files trying to match the Benedini and improve the Taigen sounds.  There is an obvious correlation between throttle stick position and playback speed. This accelerated playback usually sounds terribly electronic (whether a linear speed change algorithm or accessing WAV files at certain throttle points). However, by changing pitch -5% or so for every ~50% increase in playback speed to a certain point (60-70% of full throttle). There is now a very nice engine sound. This works better at the lower 'rpm's' than the higher ones because natural engine frequency increases at higher rpm's.  So pitch delta would have to be increased, then decreased as rpm increases. This could be linear to make it easier.  See pic.

I have tried to included my audacity WAV sound files from a basic diesel engine idle to 200% idle speed.    Unfortunately, I could not post the WAV files so I made a youtube vid of each. Sounds better live. Had to record on vid for youtube as my vid editor would not import WAV file into blank video. And my desk is dusty.. :(

Another important point is overlap. Overlap in idle and throttle up, revving to throttle down, throttle down to idle, etc.....The issues regarding sound card multi track playback have been discussed.

No change in pitch:


Chnage in pitch:



14
Show and Tell / Re: XRAD'S Elefant
« on: July 27, 2018, 11:35:02 AM »
Thx, Luke!  Finished the major details including zimmerit (DAP plastic wood filler). One coat rustoleum primer. Over the build hump, but still have a few bits to go....

Smoothed up the recoil a bit:

15
Show and Tell / Re: XRAD'S Elefant
« on: July 23, 2018, 07:39:10 PM »
Casting a 'ball' for the mount allowed much freedom of gun movement, but created a challenge for development of the side-to-side movement. Next time, I will just make a standard mount like the OEM one. I 3D printed my design for the gun recoil and servo mounts. works pretty well but could be smoother with a better design. Plenty of barrel travel in the up-down direction and the necessary few degrees in the left-right direction. Spektrum s500 servos work well.

Vids:



Pages: [1] 2 3