Simple JS mono synth [Archive] 您所在的位置:网站首页 IXIX08 Simple JS mono synth [Archive]

Simple JS mono synth [Archive]

2024-01-11 04:37| 来源: 网络整理| 查看: 265

Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum > Simple JS mono synth PDA

View Full Version : Simple JS mono synth

Tale08-09-2012, 09:02 AMWhile 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_synth/Bleepin_Monosynth_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. http://www.taletn.com/reaper/mono_synth/mono_synth.png IXix08-09-2012, 02:14 PMThanks Tale! Tale08-10-2012, 02:00 PMYou are welcome. :) I have just updated the download, it now generates less aliases (but uses more CPU). bang08-10-2012, 02:10 PMThanks 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 groundhum08-11-2012, 11:10 AMAlso, what bang said, too. olilarkin08-13-2012, 12:25 AMvery cool tale! fabrizio benedetti08-13-2012, 06:46 AMmidi_queue looks just what I was looking for! Huge thanks! fabrizio benedetti08-17-2012, 03:36 AMTheo, 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... fabrizio benedetti08-17-2012, 06:02 AMmidiq_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: function midiq_remove() instance(head, tail, ofs, msg1, msg23) ( (head < tail) && (head[0] > 8; // Note On status == 0x90 && velocity ? ( i = 0; while( i < 16 ? ( !buf[i] ? ( buf[i] = note; msg1 = status | i; n += 1; 0; ) : ( i += 1; ); ) : ( msg1 = 0; ); ); ) : // Note Off status == 0x80 || (status == 0x90 && !velocity) ? ( i = 0; while( i < 16 ? ( buf[i] == note ? ( buf[i] = 0; msg1 = status | i; n -= 1; 0; ) : ( i += 1; ); ) : ( msg1 = 0; ); ); ) : // All Notes Off status == 0xB0 && cc == 123 & n ? ( i = 0; loop(16, buf[i] = 0; midisend(ofs, status | i, msg23); i += 1; ); msg1 = n = 0; ); msg1 ? midisend(ofs, msg1, msg23) : 1; ); ); I guess this would need some more thought for things like Sustain (CC#64) and Pitch Wheel... Tale04-08-2013, 04:32 PMI guess this would need some more thought for things like Sustain (CC#64) and Pitch Wheel... Having thought some more: It should probably broadcast CCs and Pitch Wheel messages on all 16 channels. hamish04-08-2013, 08:19 PMYikes! That may just be one of the smartest MIDI tools I've seen! Hope I can get time to test drive soon. groundhum04-09-2013, 03:58 AMHaving thought some more: It should probably broadcast CCs and Pitch Wheel messages on all 16 channels. And aftertouch, too, while you're at it. ;) Tale04-09-2013, 06:38 AMYeah, pretty much everything except Note On and Note Off. The only problem is that REAPER already broadcasts All Notes Off and Pitch Wheel reset on all 16 channels, so some special handling is required to prevent excessive broadcasting. hamish04-09-2013, 07:45 PMThe basic router is working fine for step editing or live. I messed around with live today 'Hammond Jam' - https://www.box.com/shared/static/10zs2rbfpv1myholc7nh.mp3 All effects are stock JS and ReaPlugs, except the MIDI router. http://forum.cockos.com/showpost.php?p=1156875&postcount=44 someFactor) applyBLEP(sampleA, sampleB, dt); or something. That's how you would do hard sync? Instead of having all these individual wave BLEP functions, why not just do everything like this? Take care of all possible discontinuities in one smack. I know this is an ancient thread, but I was struggling with this a bit recently - the polyblep magic depends on knowing exactly *where* in-between the two samples the discontinuity actually occurs, so that approach isn't practical. For something like a naive square wave, it's easy - discontinuity is at transition points i.e. phase = 0 and pi. Things get very gnarly with more complex waves though. beerzel02-13-2019, 03:43 AMHello Tale I love your concept, because I need a synth that is clean-pure digital, that doesn't try to emulate an analog one with modeling, keeps the simple GUI and isn't CPU hungry. Would it be possible to add these features to a second version of your simple mono/poly synth? - second oscilator with tuning (for sub or for fine detune) - the LP filter should react to the main ADSR with an amount control, like on the Roland Juno-6, no need for me to have a seperate ADSR - keytrack follower slider for the LP filter And I have a question about working on 96kHz Sample rate: Does it use the higher samplerate in the processing? Cheers Beerzel Tale02-14-2019, 02:46 AMI love your concept, because I need a synth that is clean-pure digital, that doesn't try to emulate an analog one with modeling, keeps the simple GUI and isn't CPU hungry. Thanks! Well, it is pure digital, but not entirely clean (there is some aliasing). Also, JSFX is not as CPU efficient as C/C++ (i.e. VST/AU), but nowadays it is pretty decent. Would it be possible to add these features to a second version of your simple mono/poly synth? - second oscilator with tuning (for sub or for fine detune) - the LP filter should react to the main ADSR with an amount control, like on the Roland Juno-6, no need for me to have a seperate ADSR - keytrack follower slider for the LP filter It would be possible, but I'm not sure I'm up to it ATM... But I will think about it. And I have a question about working on 96kHz Sample rate: Does it use the higher samplerate in the processing? It doesn't use oversampling, if that's what you mean. beerzel02-15-2019, 12:09 PMI mean if I work at 96khz, do I get a higher resolution, like for example with ReaEQ? I noticed that the CPU efficency wasn't great when I tried ReaRack - ModularSynth. The possibilities are so amazing and the oscillators are so cool. So I tried to do a polyphonic 8-voice synth combination but it used just way to much CPU, because it needed then 8 oscillator, envelope and filter modules. So then I found your JSFX Pack which is better suited for my digital polyphonic synth research. Before I even got to all these JSFX, I just created a polyphonic 8-voice synth with ReaSynth and ReaEQ. The trick was to use for each voice a ReaSynth for the oscillator, ReaEQ for LP Filter and then another ReaSynth (set to a squarewave) that is sent via parameter modulation to the filter cutoff frequency of ReaEQ. This gives a very musical ADSR and it is possible to tweak then each voice at the same time via midi controller. I also used Robert Randolphs Keytrack generator and Malcom Smiths Poly Splitter (changed release to 5s to match the release of ReaSynth) for the midi routing. I have attached the project here, with the additional JS Plugins. It works really well and is very CPU efficient! But...the only problem is that ReaSynth has no option for a monophonic oscillator...so when you increase the release time, it creates a mess :-( Ivannn Bennnettt02-16-2019, 01:43 AM@beerzel Did you try this one? https://www.kvraudio.com/product/modulair-by-full-bucket-music beerzel02-19-2019, 01:18 AMThanx Ivannn I didn't know that one. I tried it this weekend. Really cool...but what didn't work for me is: - ModulAir can't produce a pure sine wave, the one that is selectable has already some harmonics in it (I also checked it with an analyzer) - it crackles each time when you adjust a knob Here some infos on my hardware: I use Lynx AES16 with Aurora16 at home which is solid in latency and performance. For my mobile rig I use a Sound Devices MixPre 10M, which is great in sound and flexibility, just the USB interface isn't the best at latency. The synth plugin I'm looking for has to perform well on this rig, which would be the proof of its lightness. So I always test the synth on this one. All on Windows 7 32Bit (If it works, don't touch anything :-) ) For example Synth1 was almost the solution but it doesn't use the higher resolution of 96kHz, it cuts all off above ~22kHz, so it must be stuck internally at 44.1kHz Phutura is also a good example for what I'm looking for, but it's buggy in Reaper (5.63) when you save presets and reload the session and you can't deactivate the filter which tames a little bit the highend at his highest setting. Tunefish4 is the best in its performance, never crackels and has a really creative wavetable oscilator. I use it a lot. The only thing it can't do is a pure sine, saw square or pulse wave... The best solution would be: ReaSynth with a monophonic option so you can create what you want, as in my example REASYNTH POLY 8 (...or Tale is going to be the hero ;-) ) (...or perhaps there is a plugin outhere that I didn't find yet, curious for suggestions) Time Waster02-19-2019, 01:46 AMI noticed that the CPU efficency wasn't great when I tried ReaRack - ModularSynth. The possibilities are so amazing and the oscillators are so cool. So I tried to do a polyphonic 8-voice synth combination but it used just way to much CPU... Which version of ReaRack were you using? I recently made some changes to the version 3 trapezoidal oscillator which should make it more efficient. I would also recommend using audio rather than MIDI CC for control signals between modules, if you weren't already, as audio uses significantly less CPU. beerzel02-24-2019, 09:23 AMHey Time Waster, I don't think you do :-) I tried your ReaRack3 Beta, better performance with audio for control signals. But unfortunately still to CPU hungry when used with 8-voices. Perhaps there is a way to make the envelope ,oscillator and filter module polyphonic to save CPU? The oscillator sounds really great I love it! Time Waster02-24-2019, 06:57 PMHey Time Waster, I don't think you do :-) Depends who you ask :-) I tried your ReaRack3 Beta, better performance with audio for control signals. But unfortunately still to CPU hungry when used with 8-voices. Perhaps there is a way to make the envelope ,oscillator and filter module polyphonic to save CPU? I tried this setup here (8 x oscillator, EG and filter + poly splitter). On a 3.5 GHz 6 core machine I get a peak of about 7% CPU usage. It may be possible to get more efficiency by adding polyphony to the EG and Osc modules, but it is a bit of a redesign and is outside the current scope of this project (ReaRack). It is something to think about though. I suspect that true modularity and efficiency may be mutually exclusive, hence all in one synths. Tale, apologies for the thread hijack. vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有