You are not logged in.

vpr

Beginner

  • "vpr" is male
  • "vpr" started this thread

Posts: 30

Date of registration: May 21st 2014

  • Send private message

1

Wednesday, May 21st 2014, 11:55pm

JSyn Audio Synthesis in Jabaco (Help Request)

Hi,

Apologies if this is a duplicate post but my earlier attempt to begin a thread seem to have been unsuccessful.

I'm a hobbyist VB6 developer who is attempting to use Jabaco in combination with the JSyn Audio Synthesis library:

http://www.softsynth.com/jsyn/


I have no real experience in Java (save for some experiments in Processing).

I am looking for some help with a basic hello world (playing a tone with SineOscillator for example), to help get me started.

I am able to reference the JSyn .jar file and do the necessary imports but I am a bit lost trying to adapt something like this: http://music.columbia.edu/pipermail/jsyn/2011-January/011525.html (a simple example of JSyn in Processing) to Jabaco.

Any help/example source code would be greatly appreciated.

Thanks to Manuel for Jabaco, which is a great project and one that I would like to see grow and grow :)

Thank you,
Benjamin

maXim

Trainee

  • "maXim" is male

Posts: 53

Date of registration: Jan 5th 2009

Location: Sesto Fiorentino, Florence (ITALY)

Occupation: design & development (HW, SW & FW)

Hobbies: chess, fly fishing, good wine and beautiful women!

  • Send private message

2

Tuesday, May 27th 2014, 2:37pm

Hi Benjamin,

thank you :), did not know about this library...
this is my modest contribution:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Option Explicit

Import com#jsyn#engine#SynthesisEngine
Import com#jsyn#unitgen#LineOut
Import com#jsyn#unitgen#SineOscillator

Dim synth As New SynthesisEngine()
Dim osc As New SineOscillator()
Dim jsynRunning As Boolean = False
Dim mouseClicked As Boolean = False

Public Sub Form_Load()
   Picture1.Left = 10Picture1.Top = 10
   Picture1.Height = 100Picture1.Width = 1000
   Me.Height = Picture1.Height + 60
   Me.Width = Picture1.Width + 40
   Me.Top = (Screen.Height - Me.Height) / 2
   Me.Left = (Screen.Width - Me.Width) / 2
   setup
End Sub

Public Sub setup()
   synth.add(osc) ' add a tone generator
   Dim lnOUT As New LineOut() ' add an output mixer
   synth.add(lnOUT)
   osc.output.connect(0, lnOUT.input,0) ' connect the oscillator to the output
   synth.start() ' start synthesizer using default stereo output at 44100 Hz
   ' we only need to start the lnOUT
   ' It will pull data from the oscillator
   lnOUT.start()
   jsynRunning = True
End Sub

Public Sub Picture1_Click()
   mouseClicked = Not mouseClicked
End Sub

Public Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
   If mouseClicked = True Then
      Picture1.Circle(X, Y, 20, vbBlack)
   Else
      Picture1.Circle (X, Y, 20, vbRed)
   End If
   osc.frequency.set(X)
End Sub


for graphics and for better control of the events I suggest you do some research in the forum where you can find everything and more...

Best regards,

Massimo

This post has been edited 4 times, last edit by "maXim" (May 29th 2014, 5:49pm)


vpr

Beginner

  • "vpr" is male
  • "vpr" started this thread

Posts: 30

Date of registration: May 21st 2014

  • Send private message

3

Sunday, June 1st 2014, 5:48pm

Thank you kindly Massimo.

I managed to get some identical code up and running just after I posted my question but your response is very much appreciated.

I do have some more questions regarding this library which I'll post soon.

Rate this thread
WoltLab Burning Board