|
|
|
08-09-2012, 09:02 AM
|
#1
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Simple JS mono synth
While playing around with the new REAPER v4.25+ JSFX functions I have created a simple free (GPL) mono/poly synth in JSFX. It features ADSR, several bandlimited waveforms, a zero-delay feedback low-pass filter, a LFO modulating pulse width or frequency, and supports MIDI Note On/Off, Sustain, and Pitch Wheel.
New since 12 December 2014: Poly mode (16 notes max).
Download/mini website/documentation: http://www.taletn.com/reaper/mono_synth/
Lame audio demo: http://www.taletn.com/reaper/mono_synth/mono_synth.mp3
Slighty less lame audio demo: http://www.taletn.com/reaper/mono_synth/poly_blep.mp3
New poly demo: http://www.taletn.com/reaper/mono_sy...ynth_Blues.mp3
JS mono_synth uses these included JSFX libraries:
- adsr.jsfx-inc: ADSR envelope.
- midi_queue.jsfx-inc: Sample accurate MIDI queue.
- noise_generator.jsfx-inc: Noise generator.
- poly_blep.jsfx-inc: PolyBLEP quasi-bandlimited tone generator.
- rc_filter.jsfx-inc: 1st order RC filter.
- sine_oscillator.jsfx-inc: Efficient sine/cosine wave oscillator.
- zdf_filter.jsfx-inc: 2nd order zero-delay feedback state variable filter.
Also included (but not used by JS mono_synth) are:
- lfo.jsfx-inc: Naive (non-bandlimited) low-frequency oscillator.
- rbj_filter.jsfx-inc: 2nd order RBJ filter.
Other included JSFX plug-ins:
- ab_mono: A/B two mono channels.
- colored_noise: Coloured noise generator.
- midi_sustain: MIDI sustain emulator.
- poly_mono_midi_router: Dynamic poly/mono MIDI router.
- random_midi_notes: Random MIDI note generator.
Last edited by Tale; 12-20-2014 at 02:58 PM.
Reason: Updated to v20141220
|
|
|
08-09-2012, 02:14 PM
|
#2
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Thanks Tale!
|
|
|
08-10-2012, 02:00 PM
|
#3
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
You are welcome.
I have just updated the download, it now generates less aliases (but uses more CPU).
|
|
|
08-10-2012, 02:10 PM
|
#4
|
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
Quote:
Originally Posted by IXix
Thanks Tale!
|
++1. not much time at preset to explore this, but big thanks Tale. code sharing like this is a big win from the new Js bits. /dan
|
|
|
08-11-2012, 11:10 AM
|
#5
|
Human being with feelings
Join Date: Jan 2011
Location: Finger Lakes, NY
Posts: 54
|
Also, what bang said, too.
|
|
|
08-13-2012, 12:25 AM
|
#6
|
Human being with feelings
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
|
very cool tale!
|
|
|
08-13-2012, 06:46 AM
|
#7
|
Human being with feelings
Join Date: Nov 2009
Location: Italy
Posts: 99
|
midi_queue looks just what I was looking for! Huge thanks!
|
|
|
08-17-2012, 03:36 AM
|
#8
|
Human being with feelings
Join Date: Nov 2009
Location: Italy
Posts: 99
|
Theo, I have a doubt regarding the function midiq_remove() in midi_queue.jsfx-inc. Line 108 increments ofs, and it's in the else branch of the test in line 103. Shouldn't ofs be incremented also when the test succeeds?
Anyway, I still can't get my plugin to be sample-aligned. Seems Reaper sends MIDI notes with poorly timed offsets...
|
|
|
08-17-2012, 06:02 AM
|
#9
|
Human being with feelings
Join Date: Nov 2009
Location: Italy
Posts: 99
|
midiq_remove has a bug in the test, too (reversed condition). I fixed it in this way, and I finally have a sample-accurate plug-in:
Code:
function midiq_remove()
instance(head, tail, ofs, msg1, msg23)
(
(head < tail) && (head[0] <= ofs) ?
(
msg1 = head[1];
msg23 = head[2];
head += 3;
ofs += 1;
1;
) : (
ofs += 1;
0;
);
);
|
|
|
08-17-2012, 07:07 AM
|
#10
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Quote:
Originally Posted by fabrizio benedetti
midiq_remove has a bug in the test, too (reversed condition).
|
Oops, you are right. Thanks for spotting that. Fixing...
Quote:
Originally Posted by fabrizio benedetti
Theo, I have a doubt regarding the function midiq_remove() in midi_queue.jsfx-inc. Line 108 increments ofs, and it's in the else branch of the test in line 103. Shouldn't ofs be incremented also when the test succeeds?
|
No, I don't think so. When there is a MIDI message in the queue midiq_remove() is called twice:
1. midiq_remove() spots the MIDI message, and because its offset is equal to the current offset, it removes the message. It returns true to let you know you should call midiq_remove() again.
2. There are no more MIDI messages, so now midiq_remove() increases the current offset. It returns false to let you know you shouldn't call midiq_remove() again until the next @sample iteration.
For multiple MIDI messages with the same offset step 1 is repeated. If there are no MIDI messages, then step 1 is skipped.
Notice how this way the offset is incremented only once every @sample call. If you would increment it also during step 1, then the offset could be incremented twice during one @sample call, which would not be correct.
|
|
|
08-17-2012, 08:57 AM
|
#11
|
Human being with feelings
Join Date: Nov 2009
Location: Italy
Posts: 99
|
Quote:
Originally Posted by Tale
When there is a MIDI message in the queue midiq_remove() is called twice
|
Uh, yes, I see!
Thanks again for the great JS code: I'm going to publish soon a plugin which makes uses of it
Ciao
Fabrizio
|
|
|
08-17-2012, 01:01 PM
|
#12
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Quote:
Originally Posted by fabrizio benedetti
Thanks again for the great JS code: I'm going to publish soon a plugin which makes uses of it
|
I am looking forward to it.
I have just uploaded an update with your fix, and I have optimized mono_synth by treating a 50% pulse as a square wave.
|
|
|
08-18-2012, 05:22 PM
|
#13
|
Human being with feelings
Join Date: Sep 2007
Location: The Reflection Free Zone
Posts: 3,026
|
lead sound with 4 instances
Hi, I was interested in how it sounded and the oscillators really do sound fine, also the adsr envelopes are nice.
I messed around with the sine triangle and saw, made a bass, snare and kick drum plus made an ensemble lead with 4 saw + detune. [Edit = new tune, improved sounds. Has 1 real guitar part and five or six mono synth parts, all up eleven instances of the JS synth plugin]
https://www.box.com/shared/static/1f...9a19dca3c0.mp3
Thanks for sharing Theo, it makes a good addition to the JS effects
This thing is growing on me! I got a quite good electric bass sound with a sine + pulse.
Last edited by hamish; 08-21-2012 at 05:43 AM.
|
|
|
08-28-2012, 02:48 PM
|
#14
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Quote:
Originally Posted by hamish
I messed around with the sine triangle and saw, made a bass, snare and kick drum plus made an ensemble lead with 4 saw + detune. [Edit = new tune, improved sounds. Has 1 real guitar part and five or six mono synth parts, all up eleven instances of the JS synth plugin]
https://www.box.com/shared/static/1f...9a19dca3c0.mp3
|
That sounds amazing! Thanks for sharing.
Meanwhile I have updated mono_synth + JS libs:
- mono_synth: Added Pitch Wheel Range slider.
- tg/lfo: Fixed overflow on very high frequencies.
- tg/lfo: Added sync to negative time values.
|
|
|
09-05-2012, 03:10 PM
|
#15
|
Human being with feelings
Join Date: May 2011
Location: Shaolin => NJ
Posts: 1,213
|
Im not a programmer at all, but I'd like to use this synth. I downloaded the zip file. Do I need to put ALL the included files in the JS directory?
|
|
|
09-05-2012, 07:27 PM
|
#16
|
Human being with feelings
Join Date: Sep 2007
Location: The Reflection Free Zone
Posts: 3,026
|
that's right, make a folder in REAPER/effects (I called it tale)
then copy ALL 6 files from the .zip into that folder. Next time you start REAPER filter 'tale' in JS plugins at the FX add window. Only tale/mono_synth should appear.
If you make some good patches with it maybe you could post them here as track templates? I'm sure you'll have fun with it anyway.
I'll kick it off...
|
|
|
09-06-2012, 11:58 PM
|
#17
|
Human being with feelings
Join Date: Sep 2007
Location: The Reflection Free Zone
Posts: 3,026
|
I messed around with the latest version today.
I'm into the idea of creating patches using only the ReaPlugs and JS that come in the REAPER installer, as this should give maximum portability.
Here is another rough sketch, using the bass and an arp (the swept pulse arp) https://www.box.com/shared/static/q6...99tvkobvkf.mp3
And 3 new patches:
Last edited by hamish; 10-30-2012 at 03:25 PM.
Reason: improvement
|
|
|
09-07-2012, 02:37 AM
|
#18
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Awesome!
|
|
|
09-07-2012, 05:50 AM
|
#19
|
Human being with feelings
Join Date: Sep 2007
Location: The Reflection Free Zone
Posts: 3,026
|
Sorry! just can't help myself!!! Someone else make some better tunes, please!
Here's another scrappy unfinished demo, this one is from a sequence made in MuseScore, and it's missing the drum part.
I had to do it because I came up with this bass patch that uses parameter modulated ReaEQ. I'm calling the 'wah beast'
The chords here are from the very cool Combo Model V organ also by tale
https://www.box.com/shared/static/pp...rz4ck8zcpg.mp3
Last edited by hamish; 09-09-2012 at 05:13 AM.
|
|
|
09-14-2012, 07:08 PM
|
#20
|
Human being with feelings
Join Date: Sep 2007
Location: The Reflection Free Zone
Posts: 3,026
|
Well I'm still into this patch design project, and I'm making it strictly JS and ReaPlugs.
New Tune: https://www.box.com/shared/static/kn...en7i5dj9kl.mp3
The patches:
|
|
|
10-02-2012, 03:07 PM
|
#21
|
Human being with feelings
Join Date: Sep 2007
Location: The Reflection Free Zone
Posts: 3,026
|
Congrats Martinic
Woo hoo !!
http://beta.musicradar.com/tuition/t...today-277953/6
Congrats on getting into the musicradar top 27 freewares list!!
(BTW my daughter says I act a lot more cheerful on the forum than I really am - a grumpy old dad. I won't let her keep a pet, not even a cute little rat.. )
|
|
|
10-04-2012, 12:26 PM
|
#22
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Quote:
Originally Posted by hamish
|
Thanks.
Quote:
Originally Posted by hamish
(BTW my daughter says I act a lot more cheerful on the forum than I really am - a grumpy old dad. I won't let her keep a pet, not even a cute little rat.. )
|
You are right not to let her keep a cute little rat... Rats are social animals, so you should let her keep at least two.
|
|
|
10-17-2012, 08:31 PM
|
#23
|
Human being with feelings
Join Date: Sep 2007
Location: The Reflection Free Zone
Posts: 3,026
|
Hi again, I have been working on an indaba remix, wonder girls 'like money'.
As a preparation sketch I copped the main lines using JS mono.
https://www.box.com/shared/static/26...8ob9hv95lz.mp3
There is also one sample, but beside that all tones are from the JS mono_synth, enjoy...
|
|
|
01-24-2013, 02:01 PM
|
#24
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
I have uploaded an updated version of my libs (Tale_20120829.zip), with just one change:
- tg/lfo: Fixed overflow on very high freqs, part 2.
|
|
|
02-10-2013, 01:07 PM
|
#25
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
20130210
I have just uploaded an update (Tale_20130210.zip, see OP) of mono_synth and libs.
Changes:
- mono_synth: Replaced Fourier series with faster polyBLEP tone generator (poly_blep.jfx-inc)
- mono_synth: Added new waveforms (modified triangle, triangular pulse, Hammond, staircase)
- mono_synth: Added white noise mix
- mono_synth: Added low-pass filter with decay
- lfo/tg: Added new waveforms
- lfo/tg: Minor changes (added lfo_setdt/tg_setdt)
- rc: Slightly more efficient frequency setting
I have also made a new audio demo, in which all sounds are generated by mono_synth (using 8 instances), no other audio effects were used:
MP3: http://www.taletn.com/reaper/mono_synth/poly_blep.mp3
RPP: http://www.taletn.com/reaper/mono_synth/poly_blep.rpp
Last edited by Tale; 03-17-2013 at 03:51 PM.
Reason: Updated URLs
|
|
|
02-10-2013, 01:20 PM
|
#26
|
Human being with feelings
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
|
wow. that is really cool
|
|
|
02-10-2013, 07:12 PM
|
#27
|
Human being with feelings
Join Date: Sep 2007
Location: The Reflection Free Zone
Posts: 3,026
|
+1 Great stuff! The demo is good.
The addition of the white noise generator with filter works well for making a quick and dirty drum patch.
The 'Hammond' oscillator is interesting, sounds nice.
|
|
|
02-14-2013, 04:44 PM
|
#28
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
20130214
You're welcome.
Meanwhile I have updated mono_synth & co again (to Tale_20130214.zip, see OP).
Changes:
- zdf: Added zero-delay feedback state variable filter (zdf_filter.jsfx-inc)
- mono_synth: Replaced RBJ with ZDF filter
- mono_synth: Added Filter Q slider
- lfo: Fixed rectangular wave, oops!
- rbj: Automatically limit corner frequency
|
|
|
02-18-2013, 09:01 AM
|
#29
|
Human being with feelings
Join Date: Apr 2007
Posts: 372
|
Great stuff, thank you very much Tale !
Now if we could get more features that would be amazing
But as a basic synth to throw ideas at, its quite good as is
|
|
|
03-17-2013, 02:44 PM
|
#30
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
20130317
I have just updated mono_synth & libs to 20130317, see OP.
Changes:
- Added documentation to .jsfx-inc libraries
- lfo/poly/tg: Changed phase and pulse width range to 0..1
- lfo/poly/tg: Rewrote waveform functions
- poly: Rewritten waveform functions are ~30% faster on average
- lfo: Added DC offset functions
- poly2: Added 2x oversampled polyBLEP tone generator
- ab_mono: Added A/B mono plug-in
- mono_synth: Fixed waveform when changing to half-wave rectified sine, Hammond, or staircase
- poly: Fixed triangle leaky integrator not initialising to current phase
- poly: Fixed initialisers resetting leaky integrator feedback coefficient
|
|
|
03-21-2013, 01:59 PM
|
#31
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
20130321
Spring v20130321 is here.
Changes:
- lcg: Added noise generator (noise_generator.jsfx-inc)
- mono_synth: Implemented new noise generator
- zdf: Fixed denormals in high-pass output
Last edited by Tale; 03-22-2013 at 12:12 AM.
|
|
|
03-22-2013, 01:43 AM
|
#32
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Thanks Tale!
|
|
|
03-22-2013, 06:38 AM
|
#33
|
Human being with feelings
Join Date: Apr 2007
Posts: 372
|
thanks !
|
|
|
03-22-2013, 11:36 AM
|
#34
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
You are welcome.
Meanwhile I have uploaded v20130322. Change:
- zdf: Prevent denormals, part deux
EDIT: Updated to v20130323. Changes:
- lfo/poly/poly2: Added variable pulse width to tripulse
- lfo/poly/poly2/tg: Automatically set default pulse width
- poly/poly2: Merged trapezoid and tripulse integrators
Last edited by Tale; 03-23-2013 at 11:30 AM.
Reason: Updated to 20130323
|
|
|
03-31-2013, 04:06 PM
|
#35
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
20130401
I have updated mono_synth & libs to 20130401. The most important change is that mono_synth is now based on mono_synth.jsfx-inc, a semi-modular mono synth template lib. You can also reuse this lib to build your own mono synth, e.g.:
Code:
desc:Mono synth featuring Note On/Off, Pitch Wheel and Sustain
import mono_synth.jsfx-inc
import poly_blep.jsfx-inc
@sample
synth.synth_midi() ? (
synth.synth_pitch() || synth.synth_note() ? osc.poly_setf(synth.freq);
spl0 = spl1 = 0.5 * synth.velocity * osc.poly_tri();
);
A slightly more advanced example featuring ADSR is included with adsr.jsfx-inc.
Other changes:
- adsr: Added ADSR envelope (adsr.jsfx-inc)
- mono_synth: Fixed sample drift in ADSR
- mono_synth: Fixed retriggering filter decay
- tg: Added cacheless rectangle and circle (slow!)
- tg: Fixed rectangle init not clearing cache
- Documentation nitpicks
|
|
|
04-01-2013, 11:00 AM
|
#36
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
v20130401a
This afternoon I have been playing around with a random MIDI note generator JS plug-in I had never quite finished until now. You can use this plug-in to test soft synths, or generate instant experimental "music", e.g.:
http://www.taletn.com/reaper/mono_sy...ndom_noise.mp3
(random_midi_notes > mono_synth)
http://www.taletn.com/reaper/mono_sy...ndom_notes.mp3
(random_midi_notes > mono_synth > very wet ReaVerbate)
Anyway, I have added the plug-in to my JS mono_synth & libs collection, and updated the whole shebang to v20130401a.
Changes:
- random_midi_notes: Added random MIDI note generator plug-in
- lcg: Added rng.lcg_rand2(x) that uses rng.seed
- Windows NSIS installer
I have also reworked the mini website a bit, so you can now also download all previous versions (click on "Earlier versions...").
Last edited by Tale; 04-01-2013 at 11:16 AM.
|
|
|
04-01-2013, 12:47 PM
|
#37
|
Human being with feelings
Join Date: Dec 2012
Posts: 13,333
|
Quote:
Originally Posted by Tale
Changes: - random_midi_notes: Added random MIDI note generator plug-in
- lcg: Added rng.lcg_rand2(x) that uses rng.seed
- Windows NSIS installer
|
Great plugin! Thanks. But you should add multivoice input, it will be better. And, if you can, please, add to your synth pan knob. IT will be perfectly!
|
|
|
04-01-2013, 02:34 PM
|
#38
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Quote:
Originally Posted by vitalker
But you should add multivoice input, it will be better.
|
Well, I do plan to make a polyphonic JS synth in the (near?) future, but I'm not really sure if I should implement polyphony in mono_synth...
Quote:
Originally Posted by vitalker
And, if you can, please, add to your synth pan knob. IT will be perfectly!
|
Sure, I can add a simple pan slider.
|
|
|
04-01-2013, 08:38 PM
|
#39
|
Human being with feelings
Join Date: Sep 2007
Location: The Reflection Free Zone
Posts: 3,026
|
Polyphonic?!? Wow!!
Wow!!, I for one would be very happy to see a polyphonic JS synth with these same oscillators and envelopes, but I wholeheartedly agree that it would be better if it was a separate plugin. 'Simple JS poly synth' perhaps?
The possibilites for modular synthesis with tale JS xxxxsynth and various other JS effects (liteon filters etc) with REAPERS flagship parameter modulation are huge. To be able to go polyphonic would be really exciting.
So no pressure man... ; )
|
|
|
04-02-2013, 04:05 AM
|
#40
|
Human being with feelings
Join Date: Dec 2012
Posts: 13,333
|
Quote:
Originally Posted by Tale
Well, I do plan to make a polyphonic JS synth in the (near?) future, but I'm not really sure if I should implement polyphony in mono_synth...
Sure, I can add a simple pan slider.
|
Thank you! You are the best . It better than ReaSynth
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:43 PM.
|