electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Arduino
Pursuing Karplus-Strong
Post new topic   Reply to topic
Page 2 of 2 [34 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2
Author Message
Grumble



Joined: Nov 23, 2015
Posts: 903
Location: Netherlands
Audio files: 27

PostPosted: Thu Dec 06, 2018 2:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

Very Happy I learned machine code on a self made "machine" built around the HD64180
I even had it sampling audio under dma, a video interface, a soundboard with a AY38910 all written in machine code.
Then I got the Junior computer around the 6502 and then a REAL computer: the Acorn Atom (also 6502 based)
Yup, same age as you salut

_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
JovianPyx



Joined: Nov 20, 2007
Posts: 1767
Location: West Red Spot, Jupiter
Audio files: 212

PostPosted: Thu Dec 06, 2018 2:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

As an addendum - There is a way to possibly speed up the low pass IIR filter which also eliminates the need for the b1 variable:

The formula can be rewritten algebraically as:
Code:

z = z + a0 * ( in - z )

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JLS



Joined: Nov 05, 2005
Posts: 445
Location: Czech
Audio files: 27
G2 patch files: 279

PostPosted: Sat Dec 29, 2018 3:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Update Arduino Karplus-Strong.

- better triggering
- better timers (PWM PIN 11)

Example Simple Karplus-Strong and duophonic Karplus-Automata cellular automata sequencer Smile


Karplus_Strong.ino
 Description:

Download
 Filename:  Karplus_Strong.ino
 Filesize:  1.74 KB
 Downloaded:  34 Time(s)


Karplus_Automata.ino
 Description:

Download
 Filename:  Karplus_Automata.ino
 Filesize:  2.86 KB
 Downloaded:  26 Time(s)


_________________
Sorry my bad English Smile
Back to top
View user's profile Send private message
MapacheRaper



Joined: Feb 15, 2018
Posts: 142
Location: Spain

PostPosted: Sat Dec 29, 2018 4:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

Cool! I´ll be testing it in no time. Thanks!!
Back to top
View user's profile Send private message
JLS



Joined: Nov 05, 2005
Posts: 445
Location: Czech
Audio files: 27
G2 patch files: 279

PostPosted: Sun Dec 30, 2018 7:37 am    Post subject: Reply with quote  Mark this post and the followings unread

Floating point version Arduino Karplus-Strong.

- better sound
- better lowpass filtering
- but needs more memory and cpu resources


Karplus_Float.ino
 Description:

Download
 Filename:  Karplus_Float.ino
 Filesize:  2.64 KB
 Downloaded:  25 Time(s)


_________________
Sorry my bad English Smile
Back to top
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1767
Location: West Red Spot, Jupiter
Audio files: 212

PostPosted: Sun Dec 30, 2018 8:50 am    Post subject: Reply with quote  Mark this post and the followings unread

JLS wrote:
Floating point version Arduino Karplus-Strong.

- better sound
- better lowpass filtering
- but needs more memory and cpu resources


This is why I use STM32 ARMs. The better ones have single cycle float multiply and float add (from a hardware FPU), they have a lot more SRAM and they are a lot faster. There are also several DSP instructions including square root and MAC. Still can use C, but the environment is different if you move away from the arduino compatible chips. If gcc is given the correct optimization strings, it will use DSP instructions where possible (which speeds things up). STM32H7 for example runs at 400 MHz and has 1 megabyte of internal SRAM (though not all of it is contiguous, there is a 512 kbyte contiguous piece).

I use a completely free set of tools, though there's some initial angst in setting it all up. gcc needs to have stuff added so that it can cross compile. There are also GUI based environments (like Eclipse), but I found those to be confusing, tedious and non-intuitive. My typical work cycle is
1) edit source with my favorite text editor
2) issue a make command to compile the code
3) send the binary to the ARM and test.
4) repeat as necessary.

The arduino platform is great for learning about microcontrollers, but while it does things that might make coding easier - they also make the code slower. Those constrictions go away when you leave the arduino world and once you learn how to do things the non-arduino way, you'll be able to use any processor out there not just those in the arduino developer world.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
MapacheRaper



Joined: Feb 15, 2018
Posts: 142
Location: Spain

PostPosted: Mon Dec 31, 2018 7:35 am    Post subject: Reply with quote  Mark this post and the followings unread

That floating point version seems really cool JLS. Im diying to test it. Thanks for sharing!

@Jovian, yepp, after some weeks playing with the arduino I see you are totally right. It is more intended for gating/triggering, sequencing, etc, but for DSP it needs way more meat (even if you can do some cool tricks too, even complete oscillators)

Jovian, has you taken a peek at the ESP8266 and ESP32 chips?. It packs a lot of power and bang for the buck. Definitively I think we will see some next gen O_C and mutable type of things coming from this chips
Back to top
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1767
Location: West Red Spot, Jupiter
Audio files: 212

PostPosted: Mon Dec 31, 2018 12:45 pm    Post subject: Reply with quote  Mark this post and the followings unread

I had not seen the ESP chips. I don't need the wifi tho. I've had really good experience with the STM32 stuff, so I'll stick with that. Dual core is nice, but troublesome to get 2 cores cooperating usefully (parallel processing). For synth projects, a fast single core CPU is far less bother IMO. I've written multithreaded polysynths for a raspberry pi3 and that code still has issues regarding coordination of threads and memory sharing.
_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
MapacheRaper



Joined: Feb 15, 2018
Posts: 142
Location: Spain

PostPosted: Mon Dec 31, 2018 1:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

I have never done multithread, but I have meditate about it and it looks like a pain in the ass, yes. But we like it or not it´s what the future brings. It seems like 3-4GHz is the max speed that silicon does and the current state of the art chips are growing in parallel giving more and more multitreads.

So I guess somehow code will adapt to that, maybe facilitating or even completely inmaskaring in in the framework (so the framework do all the heavylifting transparently for the coder)

Regarding ESP, I see it with a lot of potential. Imagine the Ornament and Crime. Probable the more succesful open source module in existence. All people using it. A ESP version could use the wifi to connect with the smartphone/computer, so suddenly you have snapshots of the patches (infinite patches memory) plus you can control the secuencers and whatnot from the phone. And run different algoridms in every channel, something that most users ask but is quite difficult to implement in the module now.

And all this in a chip that costs 2-3USD instead of the 20-30 of the teensy.

Interesting times, for sure. I guess we will have a new wave of completely new functions in modules, no seen yet, in no time, as people start to hack with the ESP and find his treasoures

With that said, I have some SMT32 arriving in the next days too. Yumm
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic
Page 2 of 2 [34 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Arduino
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use