Jump to content

SD card polyphonic sample player


Lee

Recommended Posts

  • 1 month later...

Hey Lee,

 

I know you're not familiar with the STM32 Core but I was curious. Could I wire up a rotary switch like yours or a few buttons on J5a/b/c of the STM32 to do the program changes? Maybe TK would know better. I've got an LPC Esspresso board coming shortly so I'll upgrade my sampler when that gets here BUT I do have this STM32 board just laying around... I don't like haveing to switch between banks via program change. I'd rather use buttons or a rotary switch. Thanks for any info!

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

The sample player is now also working on the STM32F4DISCOVERY board, which is probably the cheapest solution for this project, because it has an on-board Audio DAC! :)

 

More about this topic soon.

 

A refreshed all precompiled binaries:

http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fsynthesizers%2FSD+card+sample+player%2F

under release/*

 

NOTE: I changed the MIDI channel assignment, now "midichannel 1" really assigns to the first MIDI channel, and not to channel 2 (previously it was counted from 0, which wasn't obvious)

 
Best Regards, Thorsten.
 
Link to comment
Share on other sites

  • 5 months later...

Hey,

 

I have a problem getting the Sample Player to work with the new STM32F4. I uploaded the project.hex and connected my sdcard  with some samples, and they seem to load fine, BUT I can't hear anything?!

 

When I connect my headphones I can hear a bit of white noise after the application is loaded, so that tells me that the audio out is (somehow?) initialized. 

 

My hardware config:

- just the STM32F4-Discovery (no MBHP_CORE_STM32F4) with the additional jumper cable for 5V and an sdcard-reader directly connected 

- I tried two different sdcards, one 4gb with FAT32 (I know I should use FAT16) and one 4GB with 2x2GB FAT16 partitions

- I know that these samples worked with a LPC17 based core

- I tried uploading MB_NG and it also seems to work fine, also with the sdcard file browser

- I connected the Audio-Out to headphones and to a mixer line-input as well, still nothing

- according to MIOS Studio terminal output, everything is configured and loads up fine (see screenshots)

 

What I am doing wrong? 

 

(If anybody wants to try my sdcard-files, they are here)

post-6075-0-38158800-1396389283_thumb.pn

post-6075-0-04463700-1396389285_thumb.pn

Link to comment
Share on other sites

It's working now!

 

But I noticed a strange behavior with the release phase of a sample: I always get a crispy/crackling sound when I release a key, no matter what I set the release parameter to. With no release phase (value 0) I just get a short klick (which I think is normal), but with longer release times (say up to 1000) the whole release phase of a sample is distorted/crackling. 

 

When I press a key till the sample ends everything is fine btw. I already tried different samples and different volumes, but the problem remains.

 

I tried a LPC17 core with the sample player app a few months ago, and as far as I can remember there wasn't such a problem, but I'm not 100% sure.

Could that be STM32F4-related? I could try my external DAC (TDA1543 based) that I used with the LPC17 if there is a way to connect that to the STM32F4.

Link to comment
Share on other sites

That's mellotron cello, isn't it! :-)

 

I've used the sample player for playing mellotron samples for a few years, and when I read your message from 8 April about distortion, I thought the problem was much bigger than it turned out to be when I now listened to your attached sample: for me the sample player has always behaved like this, i.e. I've noticed that it breaks down a bit, or there's some little crackle like in your attached sample, but I've never thought it's that much of a problem.

Link to comment
Share on other sites

Thanks for your feedback, guys!

 

Yep, a mellotron sample ;) 

You're right, it is definitely a usable signal, for sure (though I have to say when you play/change chords it's much more obvious than in my example).

I just wanted to make sure that there's nothing wrong with my setup, and I still wonder why it's only in the release phase while the rest of the sample plays back fine.. 

 

It's just a wild guess but maybe we hear some kind of bit-crushing when the sample fades out (saying: volume gets turned down digitally and the bit-resolution gets lower). I remember the audio-output from my macbook makes all kinds of weird noises when set to a low volume. 

 

However I know It's not high-end DAC but I find it quite ok, and it comes for free with the STM32, so I won't complain  :shifty:

 

BTW does anybody know if we are still able to connect an external DAC to the STM32F4? On the new MBHP_CORE_STM32F4 the pins should be at J10B but I have no idea how to active that.

Link to comment
Share on other sites

Thanks Thorsten.

 

I connected my TDA1543 board (built one according to mbhp_i2s_tda1543.pdf) like this:

 

STM32DISCOVERY -> TDA1543

PA4 (LRCK)               -> Pin#2 (WS)

PB9 (SDA)                 -> Pin#3 (DAT)

PC10 (SCLK)             -> Pin#1 (SCK)

 

...and 5V, GND and audio outputs of course.

 

but I couldn't get any sound out of it. Don't know if this is supposed to work like that. I mean connecting a second DAC in parallel..

Link to comment
Share on other sites

You're right, it is definitely a usable signal, for sure (though I have to say when you play/change chords it's much more obvious than in my example).

I just wanted to make sure that there's nothing wrong with my setup, and I still wonder why it's only in the release phase while the rest of the sample plays back fine..

 

Just to follow up quickly on setup, I'm using LPC17 and an external DCA based on TDA1543.

Link to comment
Share on other sites

  • 2 weeks later...

Hi guys,

 

I played with my newly arrived STM32F4DISCOVERY board, the sample player is the ideal app, because it doesn't need any external component. I also noticed the distorted tails and even the "pops" when changing notes or retrigger them. So I made some changes in the app, and I hope it was worst for the work.

 

- I relocated the "decay" routine to the buffer filling function, modifying each sample volume to smooth the envelope

- added a small release phase to the 0 release value voices also, to eliminate the pops

- modified the retrigger behavior, so when you retrigger an already played note, it restrats after a small release phase

 

As I tested after the above mods all the distorts was gone!

 

I also made it work with stereo samples! The only drawback is that I had to set back the polyphony to 7, but it works good.

 

It would be glad, if somebody could test my changes.

 

TK, is it OK to post hex files here, or there are other rules?

 

Link to comment
Share on other sites

Actually I made a separate app for stereo samples, so all the voice files must be stereo in this case, they can not be both. The raw format is the same except that this is stereo, so two times 16 bit for every sample. This gets to an other limitation: because of the file size limit the max voice length is smaller.

Link to comment
Share on other sites

My version was added to the repo "playground". Many thanks TK for the access.

 

In the mean time I've noticed a small pitch mismatch on the played sounds (STM32F4Discovery). The pitch was approx a half note lower than it should be. It was due to the stm32F4 not correct I2S PLL divider settings. I corrected it also for the 44.1kHz sample rate.

Link to comment
Share on other sites

Yess, I got this to work, It plays my own samples!

But how hard would it be to add some pushbuttons to trigger samples?

In midiboxNG it's really easy to add a button creating a note on/off event, with the MIOS filebrowser. But MIOS Filebrowser is not implemented by this application, so I don't know where to start.

Cheers and thanx again for a wonderfull application!

Roel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...