Need direction on developing VST's as DSP teaching demos
Archive · 200621 old posts
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
jcsquire ·
Hey everyone,
I teach a college course in DSP and am hoping to use Synthmaker to enliven some pretty dry theory (and maybe spawn a new generation of Synthmaker programmers in the process! 🙂 ). Some of the premade modules intuitively show great concepts that are hard to get across in conventional lectures (e.g. filtering, resonance, quantization noise, aliasing). I’d like to be able to make some .exe’s that I can distribute to the students, but lack 4 essential modules. Perhaps someone here can point me in the right direction? I need a
* scope showing updated shots of the output signal (preferably threshold-level triggered like in a real ‘scope so it’s not just random parts of the output waveform updated at 25 times/sec but rather begins drawing from the same part of the cycle so that successive cycles are redrawn on top of each other in the same phase)
* spectral magnitude decomposition (the absolute value of the fft of a Hamming-windowed portion of the signal, kind of the reverse of the Oddson/Angular Momentum Additive Wave Synth
* spectrogram (same as above, but plots the abs(fft(hamming(time signal))) as a scrolling plot vs. time, with different magnitudes corresponding to different colors).
* a GUI keyboard so students can experiment without needing midi equipment.
I know some of these things could be implemented by running a SM-created .dll inside a VST host like SAVI or minihost and using some of the excellent VST effects available as the spectrogram, etc., but I really want a single-file executable demos…these are just supplemental exercises/demos to heavy conventional homework assignments, and I don’t want to have to burden non-audiophile students with problems setting up or installing VST hosts or explaining how to hookup VSTi’s to VSTe’s.
Are my hopes pipedreams, or do you think I can implement them with Synthmaker?
skOre ·
Well, the answer would be... depends 🙂
If you want your students to check out the internals, they will have to use Synthmaker, as any .exe or .dll will only be limited to the GUI. But you can actually make .exe's! (Just to make sure you haven't overlooked that)
Those various forms of visualizations I think are not that much of a problem with what is already possible. Might need some custom fixings by the devs though.
A GUI keyboard is not really needed since they can use just the normal keyboard, right?
I have no idea where to point you to concerning your special requests, but I guess others will be quick to show you the way 😉
jcsquire ·
Thanks, skOre!
Yeah, using the computer keyboard would certainly work...it's just more intuitive for a student to double-click the .exe and then tap out notes on something that looks like a synthesizer keyboard (or maybe as a pianist I'm just biased). Would anyone else benefit from such an animal? It would prevent any confusion of whether keyboard characters should get processed as midi input or as character input (e.g. to name presets).
About the visualizations...is the concept of viewing the real-time signal that's generated in the time domain or frequency domain pretty unusual in the synth community? I'd think, after listening, this would be one of the first ways sound developers would develop new presets.
Tom7777 ·
a GUI keyboard so students can experiment without needing midi equipment.
I can't remember who but someone posted a midi keyboard example a while back i have also made my own before so i can tell you its very possible already, im guessing what you want is a high level module version though or a simple one like you get in SE. 🙂
jcsquire ·
im guessing what you want is a high level module version though or a simple one like you get in SE.
Tom, exactly. I don't want to learn another programming language like SM, but SM hides enough complexity that if there were high-level modules like a GUI keyboard, a spectral display, a spectrogram, and an oscilloscope, than even a non-synthmaker programmer like myself could quickly string together some cool demo .exe's for students.
Perhaps this is an unconventional use, but it seems like a great way to expose SynthMaker to a lot of bright potential users! BTW, for some odd reason, almost every engineer and engineering student I know is a musician. And nearly every one (me included) is a bad one. 🙂
sambean ·
Hey jc,
What you're requesting shouldn't be too difficult to piece together..
It's probably possible to have a synched wave viewer by reading 2x data points then plotting x data points starting from xstart = min|y|..
I also have several half-finished projects relating to dsp analysis, pole/zero plotter, bzt/mzt filter designer, spectrograph.. I've been meaning to bundle these together into an analysis kit.. I'll see what I can do
Sam
oddson ·
And for the virtual keyboard... here's one I've knocked together in about 2 hours.
[url=http://members.shaw.ca/oddson/keyboard.osm]
OSM[/url]
It wouldn't have taken that long but I got caught up in making in resizable 🙂
stefan ·
Resizeable? Moron 🙂
oddson ·
😊 I knew I wasn't right but it was late...
edit - Hey wait-a-minute... my Word spell checker says there's no 'e' and there are 15 times as many web hits without as with...
oddson ·
Slight bug on my keyboard... will leave an open note if the mouseUp happens after leaving the object.
I believe there's a fix for these short of using the accumulator components... I'll repost once I've got it sorted.
(edit - posted)
AngularMomentum ·
Very cool with a inner shadow overlay!
oddson ·
It looks OK but I don't think most users want a virtual keyboard...
AngularMomentum ·
Just to show you how that would look! 😈
oddson ·
Turned a bug into a feature... dragging off the keyboard will lock the note on and allow chords. Click any key to release all other on mouseUp.
A few new features... (OSM above)
stefan ·
oddson wrote: 😊 I knew I wasn't right but it was late...
edit - Hey wait-a-minute... my Word spell checker says there's no 'e' and there are 15 times as many web hits without as with...
I wasn't talking about the spelling about the word, but the meaning of the word! (that it was crazy to go for the cool resizable kind!) 🙂 Very good job on this oddson, keep it up!
jcsquire ·
You guys are absolutely amazing. Just when I thought I'd have the summer off. Sambeam, thanks for the wave viewer. I'll start with that. Oddson...that keyboard is beautiful; better than what I had hoped for, and even with a hold function! That needs to go in Skore's component bundle. AM - unless you give us a link to at least the .dll it's just cruel to post something that beautiful (or bautiful for Oddson 😉 ).
sambean ·
OK, here's a first attempt at a wave display synchronizer..
I wasn't sure about a zero crossing method as it's quite common to have multiple crossings in one wave period, so it's using an fft method. It calculates the the fundamental frequency fft bin and uses this to get the phase offset of the fundamental. The wave is then drawn from here.
Parameters can be adjusted through the properties menu.
This takes a fair chunk of cpu so probably shouldn't be used if you're looking for efficiency, but is useful for analysis purposes..
It's still a bit wobbly, I think this is partially because of a bug in the mono to graph.. It could also do with windowing, but we need array-array multiplication.. It also needs reasonably stationary waves.
Let me know what you think..
Sam
sambean ·
Just gave the zero crossing method a shot, and it seems quite stable for the basic osc's, obviously if there is more than one ZC it wont work..
Sambeam, I'm floored. This is both fantastic and really annoying because until you wrote this I hadn't planned on learning any real SM programming skills beyond just connect-the-high-level-modules. After seeing this, I have to figure out the syntax. 😀
You've documented your code well, but I need a few more pointers to understand how SM works. I think that 5 times each second you're grabbing 1,000 mono samples, and the brains is in figuring out how many initial samples to ignore so that each screen redraw begins in the same phase. A hardware oscilloscope would do this by asking "where do the samples first cross the zero axis (or some other user-set trigger threshold, often expressed as a percent of the distance between the max and min samples) in an upward direction?".
You've done this by looping through each of the samples (that I think SM auto typecasts from a graphics class to an array of floats). I know your graph switch is essential, but I can't figure out what it does. When looping through the current window array you compare each value with zero and fire a zero-crossing trigger whenever both the current sample is (greater than zero) AND (less than or equal to zero)...which means I don't understand how that part works either (unless there's a single-sample delay hidden in there that I don't see). Lastly, you use the first instance per window of the zero-crossing index to start the screen redraw.
Can you help me understand the two misunderstandings I listed above? It's probably my background, but I'd think this kind of logic would be more compactly expressed in text code. I'm looking forward to learning more and eventually contributing some code block modules!
sambean ·
You've got the bulk of it, with green connectors, which are calculated 'offline' in the background, the order you make the connections are the order they will be calculated. The black dots at the beggining or the end of the connection show the order they will be calculated, no dots first, 1 dot - second, 2 dots - third etc etc.
So in the module if you look at the output trigger of the array sample you can trace the order, first sample the new value and compare with the old value, second send a trigger, this will pass if we have a zero crossing, third sample the value and store it for the next calculation.. The other trigger connections are for setting the initial conditions..
It shouldn't be to hard to set it up so you can set the crossing as a ratio of the max/min, there is a graph norm module which you could normalize the signal first, then all you need to do is put the crossing point float value into the comparator modules.. I'll see what I can do..
Cheers
Sam
stefan ·
I must say, very nice and useful stuff here sambean! Sooner or later we will have to add similar things to the toolbox I guess 🙂
Wrote something here? To have a post removed or your name hidden, write to [email protected].