electro-smith / DaisyExamples

Examples for the Daisy Platform
https://github.com/electro-smith/DaisyWiki/wiki
MIT License
361 stars 189 forks source link

Update WavPlayer to work with Daisy Patch with new libraries #266

Open OZHALL opened 2 years ago

OZHALL commented 2 years ago

This has been tested on a Patch with a clone of the Main branch as of 2/28/2022.
I have also set up "#define"s so that it can be compiled for the Patch.init(). I've tested that as well. Note that there is no encoder on the Patch.init() so I'm just commenting out that code. Stephen, I'll be happy to continue fleshing out this example for the Patch.init() with knob and pushbutton support to replace the encoder. Let me know if you'd like me to do that.

stephenhensley commented 2 years ago

Hey @OZHALL thanks for the contribution!

Overall it looks good, but I think with all of the ifdefs and the need to recompile for different platforms, this would probably benefit most from being split into discrete examples. Up to you if you want to make all of the versions, or just focus on one, but it'll simplify reading the example(s) for other users to use as a starting point.

Depending on which platform(s) you go for, it'll be best to move/add the project to the corresponding folder that matches the platform.


Also, if you want to you can convert this to a standard AudioCallback instead of an InterleavingAudioCallback if that helps clean up the self-proclaimed, "counter-intuitive" loop you're doing. The normal audio-callback is non-interleaved, and it's Buffer types are organized as arrays per-channel, which seems like it would fit better for what you're going for without requiring defines.


Let me know if you have any questions.

OZHALL commented 2 years ago

Stephen,

I hear you about the #ifdefs. I wanted to postpone splitting the file, at least until I got the Patch and Patch.init() working. I hate double maintenance. In retrospect, that was an effective path ( IMHO šŸ˜Š ).

I donā€™t have a Pod, so I canā€™t test it on that platform. Looks like https://app.slack.com/team/U01F5S9P5A7 Mariano Desivo was on the same path at the same time with the Daisy Seed ā€œbut with some features of daisy podā€. Sounds like custom hardware.

I donā€™t mind splitting those out into Patch and Patch_sm/Patch.init() versions. I donā€™t know if any changes are required for the Pod. The new version does compile with the Pod.

So ā€¦ I donā€™t know when I might be able to complete this work. Iā€™ve got some other things Iā€™m trying to get done before going out of town tomorrow. Iā€™m basically out of time until Tuesday week. You probably have more pressing business between now and then. If you do decide to do this work, just let me know before you start. Otherwise, I hope to have the two versions finished by Wed 3/9.

Iā€™ll include

ā€œconvert this to a standard AudioCallback instead of an InterleavingAudioCallbackā€ as noted below

Thx ā€“ O.Z.

From: Stephen Hensley @.> Sent: Monday, February 28, 2022 1:10 PM To: electro-smith/DaisyExamples @.> Cc: OZHALL @.>; Mention @.> Subject: Re: [electro-smith/DaisyExamples] Update WavPlayer to work with Daisy Patch with new libraries (PR #266)

Hey @OZHALL https://github.com/OZHALL thanks for the contribution!

Overall it looks good, but I think with all of the ifdefs and the need to recompile for different platforms, this would probably benefit most from being split into discrete examples. Up to you if you want to make all of the versions, or just focus on one, but it'll simplify reading the example(s) for other users to use as a starting point.

Depending on which platform(s) you go for, it'll be best to move/add the project to the corresponding folder that matches the platform.


Also, if you want to you can convert this to a standard AudioCallback instead of an InterleavingAudioCallback if that helps clean up the self-proclaimed, "counter-intuitive" loop you're doing. The normal audio-callback is non-interleaved, and it's Buffer types are organized as arrays per-channel, which seems like it would fit better for what you're going for without requiring defines.


Let me know if you have any questions.

ā€” Reply to this email directly, view it on GitHub https://github.com/electro-smith/DaisyExamples/pull/266#issuecomment-1054574262 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJHSHYB7OVIV5X2VOZYT4ADU5PB7HANCNFSM5PRSLHTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AJHSHYBMBIUJEMFE2YABE4LU5PB7HA5CNFSM5PRSLHT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOH3NYNNQ.gif Message ID: @. @.> >

-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

OZHALL commented 2 years ago

Stephen,
Here's the pull request for the new .../patch_sm/WavPlayer/WavPlayer.cpp We don't really want to commit the changes to .../seed/WavPlayer I tried to remove the .../seed changes. Still learning the fine details of git. I'm going to set this project aside after the patch_sm commit. Might get back to it later. I'd really like to figure out what's going on with the Patch version, but alas ... bigger fish to fry.