Shop OBEX P1 Docs P2 Docs Learn Events
Controlling a Wav Trigger (Spark Fun) Board (16 bit Audio ) with the Propeller Chip — Parallax Forums

Controlling a Wav Trigger (Spark Fun) Board (16 bit Audio ) with the Propeller Chip

Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
edited 2016-02-21 02:58 in Propeller 1
I had a Wav Trigger board that I ordered show up . The wave trigger allows you to play 16 bit Wave sounds and trigger them with buttons or in my case the Propeller chip

I just mounted it in a bigger plastic box and downloaded some sample files to try.

The interface :

1. Select a Pin for output on the Propeller and connect it to the RX connection on the Wave trigger board
2. Ground output on the Propeller to Ground input on the (Wave Trigger Board)

(Prop Pin) 23
>>> Rx (Wave Trigger)
(Prop GND)
>>> GND (Wave Trigger

3. Audio output from the Wave Trigger can go to any audio amp(stereo)

Simple command test:

Sending a command:

You can use the Full Serial Duplex Serial Object.

Set the Baud Rate
serial.Start(22,23,%0000,57_600) ' Baud Rate 57.600Kbps

Simple test to send a command to the Propeller Chip and play a track on the Wave Trigger:

The DOC show's sample commands in Hex .
i.e
Send start of message (2 Bytes)
SOM1 = 0x10
SOM2 = 0xaa

Length - the number of bytes for the complete message

Length = 0x08

Control track Command = 0x03 (put it in the command mode to control the track)

Track Control Option

Track Command example: Play a single track:

Play Polly = 0x01 (Play multiple track at once) , 0x00 is no Polly - single track

Track Number = 0x06 - ' Track 6

End of message = 0x55



I think that's it . Now lets send it out to the Propeller Chip via the Full Duplex Serial Object and see if it works :)

Comments

  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2016-02-21 02:59
    Simple Test Code

    1. I just used a piano note to trigger
    2. I added a repeat to the code to loop while I was looking at the scope output.
    3. I added generic delays to the code so I could watch the output on the scope
    4. The spaces between the lines of code are only there to make it more readable.

    Note: Remove repeat from the code before you try to play a long wave file or it may drive you crazy because in Polly mode it will start a copy of the wave file each time it loops.
    Note 2: Remove the delay's for regular mode when you don't need to scope it. You may need 1 or 2 delays to slow down the message a bit but I haven't tested that yet.

    So far it working fine looping and playing the same note over and over.
    {Object_Title_and_Purpose}
    
    
    CON
            _clkmode = xtal1 + pll16x   'Standard clock mode * crystal frequency = 80 MHz           
            _xinfreq = 5_000_000       ' 5 MHz Xtal
    
    VAR
      'None Used
       
    OBJ
    
    serial : "FullDuplexSerial"
    
    PUB WavTriggerTest
    
    repeat
      serial.Start(22,23,%0000,57_600) ' Set Baud Rate 57_600       
    
      serial.tx($f0) ' SOM1 , Start of Message 1
      waitcnt(cnt + (1 * clkfreq)) ' Delay for scope patterns
    
      serial.tx($aa) 'SOM2, Start of message 2
      waitcnt(cnt + (1 * clkfreq)) ' Delay for scope patterns      
    
      serial.tx($07) 'Length of message
      waitcnt(cnt + (1 * clkfreq)) ' Delay for scope patterns   
    
      serial.tx($03) ' CMD 0x03 Track Control
      waitcnt(cnt + (1 * clkfreq)) 'Delay for scope patterns    
    
      serial.tx($00) ' Code 0x00 no Polly
      waitcnt(cnt + (1 * clkfreq)) 'Delay for scope patterns    
    
      serial.tx($05) ' Track # 6, 0x06
      waitcnt(cnt + (1 * clkfreq)) 'Delay for scope patterns      
        
      serial.tx($55) ' End of message
      waitcnt(cnt + (1 * clkfreq)) ' Delay for scope patterns
    
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2016-02-20 23:58
    Wave Trigger Board

    12897-02.jpg
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2016-02-20 23:58
    PWAV Trigger
    WIG-13660 ROHS Open Source Hardware
    4
    Description: The WAV Trigger is a unique high-fidelity polyphonic audio player with surprising capabilities. Supporting up to 2048 uncompressed 16-bit, 44.1kHz wav files – the same quality as an audio CD – the WAV Trigger can play and mix up to 14 stereo tracks simultaneously and independently, with very low latency. Tracks can be controlled via 16 programmable trigger inputs, or by using a native serial control protocol or even MIDI.

    Trigger inputs can be connected directly to switches and buttons, or to digital outputs from sensors or another microcontroller. Alternate functions can be specified using a free cross-platform GUI application, and allow triggers to play sequential or random tracks, pause and resume groups of tracks and even control volume. An Arduino library allows for complex serial control like real-time mixing, starting multiple tracks in sample-sync and smooth cross-fading between tracks.

    On-board sample rate conversion allows for smoothly changing playback speed/pitch from 0.5x to 2x. in real-time.

    MIDI allows you to use the WAV Trigger as a polyphonic sampling synthesizer to play your own sounds from any MIDI keyboard controller. MIDI Channels and Note numbers are mapped to track numbers, and MIDI Controllers adjust volume as well as attack and release times. MIDI Program Change is supported to switch between up to 16 banks of 128 sounds. The WAV Trigger audio engine even implements, pitch bending, voice stealing (oldest playing voices are used for new MIDI Notes when all 14 voices are being used), note attack (fade-in), note release (fade-out) and latency averages 8 ms.

    The WAV Trigger supports both SDSC (up to 2GB) and SDHC (up to 32GB) type microSD cards.

    Check the link in the documents below to keep up with the latest Firmware updates!

    Note: This product is a collaboration with Robertsonics. A portion of each sales goes back to them for product support and continued development.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2016-02-21 02:53
    The Designer of the Wave trigger is Jamie Robertson .

    Website:
    http://robertsonics.com/

  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2016-02-21 02:57
    Sample File to play with:

    Piano samples (zip)
    http://robertsonics.com/resources/wavtrigger/PianoDemo.zip

    Mellotron Violin samples (zip)
    http://robertsonics.com/resources/wavtrigger/MellotronDemo.zip

    Various Downloads:
    http://robertsonics.com/wav-trigger-downloads/


    Demo of the Wav Trigger in use:



  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2016-02-21 01:02
    Wiring:

    Green is Ground
    Yellow is output form the Propeller Chip
    Black (closest to the Yellow and Black Wire) is the audio out.
    The black wire on the bottom(near the SD card) is the power cable

    The white wire is only used to manually trigger a Channel.

    Note:Yesterday I I mounted it in a generic plastic box because it's small I didn't want to damage it.

    1040 x 585 - 1003K
  • Testing 1 Manual Triggering:

    Download the Sample wave files or use a program such as Audacity http://www.audacityteam.org/ to make some sample wave files. I made a few and they should be 10 to 15 seconds long and 16 bit Wave files (not MP3)


    With a few sample files loaded on the SD card I can use the white wire (as per the picture above) to select a track. The Wave file plays immediately.
    note; All samples go in the root dir.
    note 2: Naming , use 001,002 etc you can also do 001Country, oo2Rock etc . As long as the 001 ,002 is in front of the text.

    Sounds great but like always " Garbage in and you will get garbage out. LOL Therefore you need high quality recordings and a high quality play back system (amp , speakers etc) to get a high quality sound.

    So far it's working great!
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2016-02-21 02:02
    Scope output on Pin 23

    980 x 581 - 1014K
  • test code added to the top thread.
  • If I have a WAV sample of an oboe being played, a loop in the middle and then a release, if I trigger it with MIDI as listed above, will it loop and then on MIDI NOTE OFF play the release?

    Appreciate any advice! Thanks.
Sign In or Register to comment.