Search results

  1. B

    Sound for model railroading scale 1/32

    Thanks, I try to have the same hardware for different types of engine (Diesel, Steam, Electric). Moreover, I need to generate special sounds (horn, bell, coupling, brake, . . . ). I tried to use only one Teensy 3.2 to command both : Sound and DCC protocol decoding. But, in fact, Sound...
  2. B

    Sound for model railroading scale 1/32

    Hi, I try now to mix in "one" code on Teensy 3.2 the following functions : 1) DCC frame decoding function + engine commands+ Leds commands (works well separatly) 2) Sound function (works well separatly) As result (code hereafter) and when I command a sound (duration 5 seconds) : - DCC frame...
  3. B

    Sound for model railroading scale 1/32

    Ok, Thanks. I will define 2 functions : PlayFile1 and PlayFile2. And I will use for instance this type of mechanism : Setup mixer1 (0, 0.5) mixer1 (1, 0.5) void PlayFile1() void PlayFile2() Loop 1) Readserial 2) Switch ... Case 'a', 'z' ',e' 3) PlayFile1 4) Switch ... Case 'r'...
  4. B

    Sound for model railroading scale 1/32

    Hi, my "simply" code goes well. Now, I would like to mix two sounds together. Here is my "simply"code but without using "mixer". #include <Audio.h> #include <Wire.h> #include <SPI.h> #include <SD.h> #include <SerialFlash.h> //'*' Type on Serial Monitor //A0A8B14.TRW = 'a' Engine start...
  5. B

    Sound for model railroading scale 1/32

    In short : You cancelled the "println" and "Serial.read" in order to avoid percussion between flux coming from Python script and flux coming from serial monitor. I tried to load 4,9 Mo, but it crashes. It's not really very important because, I can do with several soundfiles under 4 Mo. Perhaps...
  6. B

    Sound for model railroading scale 1/32

    I apologize because : Ko = Kilo octets = Kilo bytes So, W25Q64 = 64 Kilobits = 8 Kilobytes I try : ser = serial.Serial(sys.argv[1], 9600, timeout=0, writeTimeout=None) But no effect ! This breaks the thermometer but not the fever ! any ideas...??? Check the wires and connections and Write...
  7. B

    Sound for model railroading scale 1/32

    I use a windows10 + laptop (ASUS 550). I followed your procedure and your codes (CopyFromSerialMC and rawfile-uploader-mc.py). It works well except for files over 4000 Ko (???) (about 45 seconds sound). I think I can do it with this limitation for my application. C:\Python27>python -c "import...
  8. B

    Sound for model railroading scale 1/32

    1) I tried to load some soundfiles together : 3758 Ko + 2441 Ko + 248 Ko ---> It works But when I want to load just a soundfile over 4000 Ko ---> It doesn't work ? 2) When I try to load only a soundfile over 4000 Ko, the time-out message appears at the beginning (after...
  9. B

    Sound for model railroading scale 1/32

    I think that the soundfiles was not correctly loaded in Flash memory. But now, with your code modification, the sounfile is well loaded and the DAC works correctly? I tried to upload to SPI Flash : 15 Ko ----------> Ok 250 Ko --------> Ok 1 Mo -----------> Ok 2 Mo -----------> Ok 4 Mo...
  10. B

    Sound for model railroading scale 1/32

    I tried on with CopyFromSerialMC and rawfile-uploader-mc.py. It works very well with "WHISTM1.TRW". Now, I will try to manage and to mix some soundfiles. Thank you very much. :)
  11. B

    Sound for model railroading scale 1/32

    Have you a mean to read the data (byte) which are in the SPI Flash ? Thanks.
  12. B

    Sound for model railroading scale 1/32

    In order to know when starting Python script (and when it's too late), I propose to put the LED solid during this time. ............... digitalWrite(13, HIGH);// Start Python script "Rawfile-uploader.py" // xxxx .... DELAY FOR 10 SECONDS ADDED ...
  13. B

    Sound for model railroading scale 1/32

    This is this version : /* SerialFlash Library - for filesystem-like access to SPI Serial Flash memory * https://github.com/PaulStoffregen/SerialFlash * Copyright (C) 2015, Paul Stoffregen, paul@pjrc.com and CopyFromSerial : /* * This is free and unencumbered software released into the public...
  14. B

    Sound for model railroading scale 1/32

    Result on monitor : Playing file: 1 14852 32768 Playing file: 1 14852 32768 Playing file: 1 14852 32768 ................... No "WHISTM1.TRW" ! ! !
  15. B

    Sound for model railroading scale 1/32

    I tried on many soundfiles : yours and mine. I loaded them in SPI Flash (check with ReadBenchmark) But I get no sound even with your files. 1) I wonder if there is an error in the code ? 2) how can I tune the volume or gain ? Have you a preference for using TRW files are they in common use in...
  16. B

    Sound for model railroading scale 1/32

    I am using your file : "WHISTM1.TRW" This file is in SPI Flash : ReadBenchmark --> All Files on SPI Flash chip: WHISTM1.TRW = 14852 bytes Read in = 7811 usbegin = 2233148 usend = 2240959 us, speed = 1901.42 kbytes/sec with following code : #include <Audio.h> #include <Wire.h> #include <SPI.h>...
  17. B

    Sound for model railroading scale 1/32

    I checked that my soundfile is in SPI Flash (ReadBenchmark). But, with my sketch, I get only a very weak signal and it's not my soundfile (it's just a very weak tone). It seems that Dac1 is opened but the soundfile is not read (soundfile is not sent to it?).
  18. B

    Sound for model railroading scale 1/32

    There are two kinds of soundfiles to play: Type 1) Basic soundfiles related to the engine (steam, electric or diesel) which depends on the speed (stop, start -> full speed), but also on the deceleration (soft braking, strong braking to stop). These files can last each last 1 minute. Type 2)...
  19. B

    Sound for model railroading scale 1/32

    What is the best soundfile extension (easy to manage in sketch, no glitch, no stop when reading soundfiles) to deal with Audio.h (for switching, for mixing, . . .) via Audio GUI tools ? 1) SOUNDFILE.RAW (direct from Audacity) or 2) SOUNDFILE.TRW ( Audacity - 44000 Hz/16 bit) + (wav2trw -16)
  20. B

    Sound for model railroading scale 1/32

    Have you try on another PC? Because, we call some Windows ressources and I am not sure of the compatibility with certain Python procedures. I thought that the PC USB (seen from Windows) link protocols were differents when : 1) uploading with Python rawfile-uploader.py 2) uploading SPI Flash...
  21. B

    Sound for model railroading scale 1/32

    Yessssssssss, now, that works (without "while(!Serial)").;) But why it doesn't work with "while(!Serial)"?:confused:
  22. B

    Sound for model railroading scale 1/32

    So, I don't understand why my sketch don't work. Is there a difference between a Teensy without audioshield and a Teensy with a disable audioshield ? I shall try on your solutions from your last post. Thanks you.
  23. B

    Sound for model railroading scale 1/32

    Ok, this process seems to be very touchy. Can you send the soundfile from the SPI Flash to the DAC - A14 (without audioshield) ?
  24. B

    Sound for model railroading scale 1/32

    About CopyFromSerial, hereafter the comments : * This is example code to 1) format an SPI Flash chip, and 2) copy raw * audio files (mono channel, 16 bit signed, 44100Hz) to it using the * SerialFlash library. The audio can then be played back using the * AudioPlaySerialflashRaw object...
  25. B

    Sound for model railroading scale 1/32

    No, I don't get sound playing. It's a mystery ! Have test the dialog between Teensy and SPI Flash with "ReadBenchmark" (after launching "EraseEverything") ?
  26. B

    Sound for model railroading scale 1/32

    I installed Python2 (2.7), not Python 3. Don't forget to just unplug and replug between CopyFromSerial and C:\Python34>python "rawfile-uploader.py" "COM5" "LOCO201.RAW" COM1, COM5 ? It is the same port than the port used to upload the CopyFromSerial in the Teensy (see in Windows tools, the port...
  27. B

    Sound for model railroading scale 1/32

    I installed Python2 (2.7), not Python 3. Don't forget to just unplug and replug between CopyFromSerial and C:\Python34>python "rawfile-uploader.py" "COM5" "LOCO201.RAW" COM1, COM5 ? It is the same port than the port used to upload the CopyFromSerial in the Teensy (see in Windows tools, the port...
  28. B

    Sound for model railroading scale 1/32

    I have not use PIP. Manual installation INSTALL PYSERIAL under WINDOWS 1) Check that windows knows the path of the executable python / Open a command window (in "Accessories") and type "python". If it appears a line with the python version, and the command prompt, everything is fine. Otherwise...
  29. B

    Sound for model railroading scale 1/32

    I work with Python 2.7 Have you install Pyserial ?
  30. B

    Sound for model railroading scale 1/32

    About the Python script : 1) Launch CopyFromSerial (Which also erases SPI Flash) 2) Wait for fix Led on Teensy 3.2 3) Unplug USB :confused: 4) Plug USB :confused: 5) Launch Python script with Command line : Python "rawfile-uploader.py" "COM4" "WHISTM1.TRW" - WHISTM1.TRW is in the same...
  31. B

    Sound for model railroading scale 1/32

    This sketch works : IntervalTimer myTimer; const int StandbyLokBR99[] PROGMEM = { // from EncodeAudio 130, 134, 135, 131, 124, 121, 122, 125, 129, 131, 132, 133, 130, 123, 123, 128, 126, 129, 134, 129, 121, 124, 130, 124, 120, 128, 141, 141, 129, 123, 129, 133, 132, 128, 124, 123, 125, 122...
  32. B

    Sound for model railroading scale 1/32

    With "WHISTM1.TRW", the result on the monitor terminal is : Playing file: 1 14852 32768 Playing file: 1 14852 32768 ....... I have tried with both configurations 1) #define FLASH_CHIP_SELECT 6 SPI.setMOSI(7); SPI.setMISO(12); SPI.setSCK(14); 2) and (same pins as pinout done on the pinout...
  33. B

    Sound for model railroading scale 1/32

    I have loaded "WHISTM1.TRW" from PC to SPI Flash with CopyFromSerial and the command : Python "rawfile-uploader.py" "COM4" "WHISTM1.TRW"(I have no SDCard reader) --> "WHISTM1.TRW" is in the SPI Flash : ReadBenchmark gives : All Files on SPI Flash chip: WHISTM1.TRW = 14852 bytes Read in = 7814...
  34. B

    Sound for model railroading scale 1/32

    "I am a wee bit confused about the header info....50 4B 03 04 14 00 00 00 08 00....etc" You are right :I think I did a mistake because I read the zip file!!! I have encoded your file in "trw" but it was not possible to upload with this extension, so I send it with "txt" extension. My code...
  35. B

    Sound for model railroading scale 1/32

    "The common header for your files seems to be : 50 4B 03 04 14 00 00 00 08 00 ? " don't know what this is , what files is it in ??. 50 4B 03 04 14 00 00 00 08 00 : This pattern is common at the beginning of your 3 files :Wavtrw1, AudRaw1, File1 There are some Zero after the byte that is last of...
  36. B

    Sound for model railroading scale 1/32

    The common header for your files seems to be : 50 4B 03 04 14 00 00 00 08 00 ? I don't know the header and end structure for TRW files. I thought that the filename was included in the header in order to be called by the program or there is a light systemfile somewhere in the SPIFlash in order to...
  37. B

    Sound for model railroading scale 1/32

    In order to get a 16 bits file.trw, you have to add parameter : wav2trw -16. see :https://forum.pjrc.com/threads/27409-Play-RAW-from-Serial-Flash. I have a PC Windows 10 and I use the wav2trw.exe given on this link : the...
  38. B

    Sound for model railroading scale 1/32

    Yes, it's my A2RBR99.TRW file (with a simplified file system: the filename is described in the header?). You are right : the signal seems to be a square one. In another hand, it's not a symphony of Beethoven. I will check the sound generated by my soundfile. I will try on your example on my...
  39. B

    Sound for model railroading scale 1/32

    Thanks for the example . 1) The raw file has the following form (with a light header): "['(~)', 'A', 'R','2', 'B', 'R', '9', '9', '.', 'T', 'R', 'W', '|', '\\x00', '\\\\', 'û', '\\x04', '|', 125, 125, 46, 129, 255, 255, 2, 0, 254, 255, 3, 0, 253, 255, 2, 0, 255, 255, 0, 0, 0, 0, 255, 255, 255...
  40. B

    Sound for model railroading scale 1/32

    Yes, It's a soundfile done with "wav2trw _16" I have already write a programm based on : analogwrite() + IntervalTimer (sample reading synchronization) + EncodeAudio. There is no problem, but the size of soundfiles are very small (-> PROGMEM). For my application (locomotive sound), there is...
  41. B

    Sound for model railroading scale 1/32

    I have no Audio Adaptator (only a Teensy 3.2) I just want to output the soundfile "AR2BR99.TRW" (loaded in SPI Flash which is connected directly on the Teensy) From : - the SPI Flash (Winbond 25Q64BVSIG) (CS 10, Dout 11, Din 12, SCK 14) To : - DAC (pin A14) of the Teensy.
  42. B

    Sound for model railroading scale 1/32

    I have the impression that it should not be possible (without audio card) to output the sound from the SPI Flash directly to the Teensy DAC (pin A14) by using "playFlashRaw1.play(filename). On the PRJC website: https://www.pjrc.com/store/teensy3_audio.html, the Teensy is coupled to an audio...
  43. B

    Sound for model railroading scale 1/32

    Hi, My configuration is Teensy 3.2 + SPI Flash Winbond 25Q64BVSIG (without audioshield) Pins used are 11(DOUT),12(DIN),14(SCK),10(CS). AR2BR99.TRW has been loaded in the SPI Flash. I would like to send this file to the DAC (A14). But, there is no sound. Do I forget something ? Thanks #include...
  44. B

    Sound for model railroading scale 1/32

    Hi, My configuration is Teensy 3.2 + SPI Flash Winbond 25Q64BVSIG (without audioshield) Pins used are 11(DOUT),12(DIN),14(SCK),10(CS). One File.trw has been loaded in the SPI Flash. In order to read the File and send it to DAC, do I need the following data (blacken number)? EG: const unsigned...
  45. B

    Sound for model railroading scale 1/32

    Hi, Do you know if "Raw-uploader.py" goes with Python 2 ou Python 3? Thanks
  46. B

    Sound for model railroading scale 1/32

    Hi, I am trying to load rawsoundfile (AABR99.trw) from PC (ASUS 550C - Windows10) to Spi Flash Memory (25Q64BVSIG) with a teensy 3.2. Memory <-> Teensy connection WP/IO2......................none DO/IO1 (MISO).......... pin 12 HOLD/IO3...................3,3 V DI/IO0 (MOSI).............pin7...
  47. B

    Sound for model railroading scale 1/32

    Hello, I try to use only one teensy 3.2 with SPI Flash 64 M to deal with all the functions (motor, lights and sound). 1) But, I wonder what is the signification of "0xF8A00" in "const unsigned int AudioSampleStandby = 0xF8A00;" #include <Audio.h> #include <Wire.h> #include <SPI.h> #include...
  48. B

    Sound for model railroading scale 1/32

    Ok, Thanks. Attached, the complete library's source NmraDcc from Github : https://github.com/mrrwa/NmraDcc
  49. B

    Sound for model railroading scale 1/32

    In the library NmraDcc on Github, there is the following function in NmraDcc.cpp : NmraDcc::NmraDcc() { } void NmraDcc::pin( uint8_t ExtIntNum, uint8_t ExtIntPinNum, uint8_t EnablePullup) { #if defined ( __STM32F1__ ) // with STM32F1 the interuptnumber is equal the pin number...
  50. B

    Sound for model railroading scale 1/32

    It's Ok to generate sound. I have now to integrate sound generation in the NmraDcc code which was developed for Arduino. In this case, Arduino uses Pin 2 (Int0) as external Interruption to receive packets signal from rails. Can I use pin 2 (or others ??) on Teensy 3.2 to receive Dcc signal ? Thanks
Back
Top