SineTone Generator (100-10k Hz, Midi)

Post Reply
Operator
Posts: 138
Joined: Mon May 06, 2013 5:52 am

SineTone Generator (100-10k Hz, Midi)

Post by Operator »

Sine tone generator made with midi, uses
own soundfont for this... Should also work
on iPads (only tested with iPad mini) :D

Download the linked Dropbox soundfont.
https://www.dropbox.com/s/cp67uvnp4wx5a ... 1.sf2?dl=0

Code: Select all

REM SineTone Generator (100-10k Hz, Midi)
REM sB 5.1 / iPhone 4 / iOS 6.1 / by Operator
REM sine-soundfont -> Audacity & Polyphone
REM  V1: 
REM  Keep note&device volume LOW to avoid
REM  harmonics
REM  Use slider to decrease button turn 
REM  increment for "fine" frequency tuning...
REM  +pitchbend to next semitone in 31 steps
REM  (0-127 -> +/- 2 semitones), so frequency
REM  resolution is limited
REM  iPad (at least iPad mini 1gen., iOS 9.2.1)
REM  run code with device in portrait orientation
REM  otherwise, END/DEBUG buttons will not work..
REM  see: http://kibernetik.pro/forum/viewtopic.php?f=28&t=1231&p=7333&hilit=Set+Portrait#p7333

'if sine soundfont is not loaded (no Dropbox)
'then instrument #67 (0-127) will run...
NOTES MIDI 0,12,67

'>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<
'load sine soundfont (uncomment next 2 lines)
'NOTES INSTRUMENTS "/midi/Sine_V1.sf2"
'NOTES MIDI 0,12,0 'load instrument(sinetone)


IF DEVICE_TYPE$() = "iPad" THEN
  cor_f1 = 1.02 ! cor_f2 = 0.91
ELSE
  cor_f1 = 1.0 ! cor_f2 = 1
END IF

SET ORIENTATION PORTRAIT
OPTION SPRITE POS CENTRAL
OPTION ANGLE DEGREES
GRAPHICS 
GRAPHICS CLEAR

'helpers
scr.w = SCREEN_WIDTH()
scr.w2 = scr.w/2
scr.h = SCREEN_HEIGHT()
scr.h2 = scr.h/2 + scr.h/40


'-----------  Start of Knob Dial -----------'
'knob: circle
FILL COLOR 0.4,0.4,0.4
circ.r = 0.4*scr.w
FILL CIRCLE scr.w2,scr.h2 SIZE circ.r*0.97

'knob: middle cross
'DRAW COLOR 0.7,0.7,0.7
'DRAW SIZE 0.5
'x1 = scr.w2-5 ! y1 = scr.h2
'x2 = scr.w2+5 ! y2 = scr.h2
'DRAW LINE x1,y1 TO x2,y2
'x1 = scr.w2 ! y1 = scr.h2-5
'x2 = scr.w2 ! y2 = scr.h2+5
'DRAW LINE x1,y1 TO x2,y2

'knob: small line
DRAW COLOR 0,0,0
DRAW SIZE 2
x1 = scr.w2 ! y1 = scr.h2 + circ.r*0.65
x2 = scr.w2 ! y2 = scr.h2 + circ.r*0.97
DRAW LINE x1,y1 TO x2,y2

'knob: scan sprite 
X = scr.w2 - circ.r*1.1
Y = scr.h2 - circ.r*1.1
W = 2*circ.r*1.1
H = 2*circ.r*1.1
SPRITE "knob" SCAN X,Y, W,H
SPRITE "knob" AT scr.w2, scr.h2
SPRITE "knob" SHOW

'scale: circle
DRAW COLOR 0,0,0
DRAW SIZE 1
DRAW CIRCLE scr.w2,scr.h2 SIZE circ.r

'scale: lines
'log scale 15-345' mapped to 100-10.000Hz
x1 = scr.w2
y1 = scr.h2
alfa_off = 90
'100 - 1000Hz scale lines
FOR i = 100 TO 1000 STEP 100
  alfa = 71.658589*LN(i) - 315
  x2 = x1+circ.r*COS(alfa + alfa_off)*1.03
  y2 = y1+circ.r*SIN(alfa + alfa_off)*1.03
  DRAW LINE x1,y1 TO x2,y2
NEXT i
'1000 - 10.000Hz scale lines
FOR i = 1000 TO 10000 STEP 1000
  alfa = 71.658589*LN(i) - 315
  x2 = x1+circ.r*COS(alfa + alfa_off)*1.03
  y2 = y1+circ.r*SIN(alfa + alfa_off)*1.03
  DRAW LINE x1,y1 TO x2,y2
NEXT i

'scale: 100Hz field
f100.w = scr.w/9
f100.h = f100.w/1.8
f100.x = scr.w2 - f100.w/0.7
f100.y = scr.h2*1.57*cor_f1
FIELD "100" TEXT "" AT f100.x,f100.y SIZE f100.w,f100.h RO
FIELD "100" BACK ALPHA 0
FIELD "100" FONT SIZE f100.h*0.8*cor_f2
FIELD "100" TEXT "100"

'scale: 1000Hz field
f1000.w = scr.w/6*cor_f2
f1000.h = f1000.w/1.8
f1000.x = scr.w2 - f1000.w/3
f1000.y = scr.h2*0.32*cor_f2
FIELD "1000" TEXT "" AT f1000.x,f1000.y SIZE f100.w,f1000.h RO
FIELD "1000" BACK ALPHA 0
FIELD "1000" FONT SIZE f1000.h*0.53*cor_f1
FIELD "1000" TEXT "1000"

'scale: 10.000Hz field
f10K.w = scr.w/9
f10K.h = f10K.w/1.8
f10K.x = scr.w2 + f10K.w/1.4
f10K.y = scr.h2*1.57*cor_f1
FIELD "10K" TEXT "" AT f10K.x,f10K.y SIZE f10K.w,f10K.h RO
FIELD "10K" BACK ALPHA 0
FIELD "10K" FONT SIZE f10K.h*0.8*cor_f2
FIELD "10K" TEXT "10k"

'------------ End of Knob Dial -------------'


'herz display: field
fi.w = scr.w/1.9
fi.h = fi.w/3
fi.x = scr.w2 - fi.w/2
fi.y = scr.h*0.005
FIELD "freq" TEXT "" AT fi.x,fi.y SIZE fi.w,fi.h RO
FIELD "freq" BACK ALPHA 0.04
FIELD "freq" FONT SIZE fi.w*0.27
FIELD "freq" TEXT "Test"

'slider: sensitivity (button increment)
sl.k = 0
sl.x = scr.w2/2
sl.y = scr.h*0.9
sl.s = scr.w*0.5
sl.a = 0
SLIDER "sens" VALUE sl.k AT sl.x,sl.y SIZE sl.s ANGLE sl.a

'slider: fine-tune-field
ft.w = scr.w/2
ft.h = ft.w/8
ft.x = scr.w2 - ft.w/2
ft.y = scr.h2*1.83
FIELD "fTune" TEXT "" AT ft.x,ft.y SIZE ft.w,ft.h RO
FIELD "fTune" BACK ALPHA 0
FIELD "fTune" FONT SIZE ft.w*0.095*cor_f2
FIELD "fTune" TEXT "  1   1/3   1/5 Fine Tune"


'knob: init position
knob_ang = 15
knob_ang_old = 15
knob_ang2 = 15
knob_incr = 1

LOOP:
'slider: slide
IF SLIDER_CHANGED("sens") THEN
  s.s = SLIDER_VALUE("sens")
  IF s.s <= 0.33 THEN
    SLIDER("sens") VALUE 0
    knob_incr = 1
  END IF 
  IF s.s > 0.33 AND s.s < 0.67 THEN
    SLIDER("sens") VALUE 0.5
    knob_incr = 0.3
  END IF 
  IF s.s >= 0.67 THEN 
    SLIDER("sens") VALUE 1
    knob_incr = 0.2
  END IF
END IF 

'knob: turn
'reset knob_ang_diff to stop the button
knob_ang_diff = 0
'reset first touch angle to last touch angle
knob_ang_new1 = knob_ang_new2
GET TOUCH 0 AS tx,ty
IF tx >-1 THEN
  dx_t = tx - scr.w2
  dy_t = ty - scr.h2
  'check if touch was in button area
  IF dx_t^2 + dy_t^2 < (0.45*scr.w)^2 THEN
    'get first angle when (re)touching
    IF first_touch = 1 THEN 
      knob_ang_new1 = ATAN2(dy_t,dx_t)
      first_touch = 0
    END IF 
    knob_ang_new2 = ATAN2(dy_t,dx_t)
    knob_ang_diff = (knob_ang_new2 - knob_ang_new1)
    'limit the max/min ang difference
    IF knob_ang_diff > +12 THEN knob_ang_diff=0
    IF knob_ang_diff < -12 THEN knob_ang_diff=0
  ELSE
    first_touch = 1
  END IF
END IF

'remember last knob position
knob_ang_old = knob_ang
knob_ang = knob_ang_old + knob_ang_diff*knob_incr

'map knob angle +/- 180' -> 0-360'
knob_ang2 = knob_ang
IF knob_ang2 < 0 THEN 
  knob_ang2 = (knob_ang2+360)
END IF
knob_ang2 = (knob_ang2)%360

'skip not defined knob_angles
IF knob_ang2 <=  15 THEN knob_ang2 =  15
IF knob_ang2 >= 346 THEN knob_ang2 = 346

'calc. dial frequency out of the knob angle
freq_1 = 81.113083079*EXP(0.0139550612*knob_ang2)

'get best midi note fit
note_old = note 
note = FLOOR(69 + 12*LOG2(freq_1/440))
note_f = 440*2^((note-69)/12)

'calc. best pitchbend value
pitchB = INT(63 +(32*12*LOG2(freq_1/note_f)))
NOTES MIDI 0,14,0,pitchB 'pitch bend

'calc. emited frequency
freq_2 = note_f*2^((pitchB-63)/(32*12))

IF note_old <> note THEN
  NOTES MIDI 0,9,note,80    'play new note
  NOTES MIDI 0,9,note_old,0 'stop old note
END IF

'update knob position
SPRITE "knob" AT scr.w2,scr.h2 ANGLE knob_ang2

'spacer for "centered" freq. display
spacer$ = ""
a = FLOOR(LOG10(freq_2*1000))
FOR i = 1 TO 7-a
  spacer$ = spacer$&" "
NEXT i

FIELD "freq" TEXT spacer$&INT(freq_2*10)/10

GOTO LOOP
Attachments
image.jpg
image.jpg (77.18 KiB) Viewed 4336 times

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: SineTone Generator (100-10k Hz, Midi)

Post by Henko »

Nice program!
I cease to hear the basic frequency between 7kH and 8kH, but a lot of lower harmonics are heard there and beyond. Any idea about filtering them out?
BTW, i used the folowing function in my morse program(s)

Code: Select all

' produce note and octave for a given frequency
'
def freq2note$(herz)
if herz<16.35 or herz>7902.13 then return ""
note=int(17.31234*ln(herz)-96.3763)
doct=floor(note/12) ! oct=4+doct ! note-=12*doct
return .notes$(note) & oct
end def

Operator
Posts: 138
Joined: Mon May 06, 2013 5:52 am

Re: SineTone Generator (100-10k Hz, Midi)

Post by Operator »

:? ... sounds like tuning an old radio..., guess it is the soundfont, highest note sample is M105 3520Hz...
and playing M106 already has some artifacts...., will try to expand the sine soundfont, meanwhile only reducing
the note and divice volume will help a bit...

Ohhh, yes, I saw your code (same used for your Toyota, right?), but then it was too cryptic, I mean, I hadn't
experimented with midi...and by the way thanks to your Toyota post I started to guess how to bring your motor
back to (sound) live... :lol: (revving sound = work in process)....

Thanks for testing the snippet...

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: SineTone Generator (100-10k Hz, Midi)

Post by rbytes »

Nice coding. Works well on my iPad Air. :mrgreen:
The only thing that gets me down is gravity...

Operator
Posts: 138
Joined: Mon May 06, 2013 5:52 am

Re: SineTone Generator (100-10k Hz, Midi)

Post by Operator »

Must look wired, BIG Knob..on an iPad, thanks for letting me know that it is usable.

Well, after several tries including an
Audacity update, without suceed (harmonics),
I searched again for a sine font and guess what ?,
yes we have it...

I still have no clue on how to create such
clean sine-soundfont, but this one knows..
http://www.flstudiomusic.com/2011/12/20 ... fonts.html

The extracted Perfect Sine.sf2 is here:
https://www.dropbox.com/s/zqa6npvsjlaii ... e.sf2?dl=0

Just replace the soundfont with the Perfect
one and that's it ... :D

User avatar
Dutchman
Posts: 851
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Re: SineTone Generator (100-10k Hz, Midi)

Post by Dutchman »

The sound was distorted until I found that I had to de-comment the load command.
Therefore I changed the start of the program to test for the existence of the soundfont.
Now it sounds perfect, at least to me :D
It runs on iPad without problems.
Thanks for the code and thanks for the link to the sound package.

Code: Select all

'SineTone Generator (100-10k Hz, Midi)
'by Operator 14 Feb 2016
'see http://kibernetik.pro/forum/viewtopic.php?f=20&t=1326#p8075
REM SineTone Generator (100-10k Hz, Midi)
REM sB 5.1 / iPhone 4 / iOS 6.1 / by Operator
REM sine-soundfont -> Audacity & Polyphone
REM  V1
REM  Keep note&device volume LOW to avoid
REM  harmonics
REM  Use slider to decrease button turn 
REM  increment for "fine" frequency tuning...
REM  +pitchbend to next semitone in 31 steps
REM  (0-127 -> +/- 2 semitones), so frequency
REM  resolution is limited
REM  iPad (at least iPad mini 1gen., iOS 9.2.1)
REM  run code with device in portrait orientation
REM  otherwise, END/DEBUG buttons will not work..
REM  see: http://kibernetik.pro/forum/viewtopic.php?f=28&t=1231&p=7333&hilit=Set+Portrait#p7333

'>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<
'if sine soundfont is not loaded (from Dropbox)
'then instrument #67 (0-127) will run...
IF FILE_EXISTS("Sine_V1.sf2") THEN Font$="Sine_V1.sf2"
IF FILE_EXISTS("Perfect Sine.sf2") THEN Font$="Perfect Sine.sf2"
IF Font$<>"" THEN
  NOTES INSTRUMENTS Font$ 'load sine soundfont
  NOTES MIDI 0,12,0 'load instrument(sinetone)
ELSE
  NOTES MIDI 0,12,67 ' load instrument 67
ENDIF

IF DEVICE_TYPE$() = "iPad" THEN
  cor_f1 = 1.02 ! cor_f2 = 0.91
ELSE
  cor_f1 = 1.0 ! cor_f2 = 1
END IF

SET ORIENTATION PORTRAIT
OPTION SPRITE POS CENTRAL
OPTION ANGLE DEGREES
GRAPHICS 
GRAPHICS CLEAR

'helpers
scr.w = SCREEN_WIDTH()
scr.w2 = scr.w/2
scr.h = SCREEN_HEIGHT()
scr.h2 = scr.h/2 + scr.h/40


'-----------  Start of Knob Dial -----------'
'knob: circle
FILL COLOR 0.4,0.4,0.4
circ.r = 0.4*scr.w
FILL CIRCLE scr.w2,scr.h2 SIZE circ.r*0.97

'knob: middle cross
'DRAW COLOR 0.7,0.7,0.7
'DRAW SIZE 0.5
'x1 = scr.w2-5 ! y1 = scr.h2
'x2 = scr.w2+5 ! y2 = scr.h2
'DRAW LINE x1,y1 TO x2,y2
'x1 = scr.w2 ! y1 = scr.h2-5
'x2 = scr.w2 ! y2 = scr.h2+5
'DRAW LINE x1,y1 TO x2,y2

'knob: small line
DRAW COLOR 0,0,0
DRAW SIZE 2
x1 = scr.w2 ! y1 = scr.h2 + circ.r*0.65
x2 = scr.w2 ! y2 = scr.h2 + circ.r*0.97
DRAW LINE x1,y1 TO x2,y2

'knob: scan sprite 
X = scr.w2 - circ.r*1.1
Y = scr.h2 - circ.r*1.1
W = 2*circ.r*1.1
H = 2*circ.r*1.1
SPRITE "knob" SCAN X,Y, W,H
SPRITE "knob" AT scr.w2, scr.h2
SPRITE "knob" SHOW

'scale: circle
DRAW COLOR 0,0,0
DRAW SIZE 1
DRAW CIRCLE scr.w2,scr.h2 SIZE circ.r

'scale: lines
'log scale 15-345' mapped to 100-10.000Hz
x1 = scr.w2
y1 = scr.h2
alfa_off = 90
'100 - 1000Hz scale lines
FOR i = 100 TO 1000 STEP 100
  alfa = 71.658589*LN(i) - 315
  x2 = x1+circ.r*COS(alfa + alfa_off)*1.03
  y2 = y1+circ.r*SIN(alfa + alfa_off)*1.03
  DRAW LINE x1,y1 TO x2,y2
NEXT i
'1000 - 10.000Hz scale lines
FOR i = 1000 TO 10000 STEP 1000
  alfa = 71.658589*LN(i) - 315
  x2 = x1+circ.r*COS(alfa + alfa_off)*1.03
  y2 = y1+circ.r*SIN(alfa + alfa_off)*1.03
  DRAW LINE x1,y1 TO x2,y2
NEXT i

'scale: 100Hz field
f100.w = scr.w/9
f100.h = f100.w/1.8
f100.x = scr.w2 - f100.w/0.7
f100.y = scr.h2*1.57*cor_f1
FIELD "100" TEXT "" AT f100.x,f100.y SIZE f100.w,f100.h RO
FIELD "100" BACK ALPHA 0
FIELD "100" FONT SIZE f100.h*0.8*cor_f2
FIELD "100" TEXT "100"

'scale: 1000Hz field
f1000.w = scr.w/6*cor_f2
f1000.h = f1000.w/1.8
f1000.x = scr.w2 - f1000.w/3
f1000.y = scr.h2*0.32*cor_f2
FIELD "1000" TEXT "" AT f1000.x,f1000.y SIZE f100.w,f1000.h RO
FIELD "1000" BACK ALPHA 0
FIELD "1000" FONT SIZE f1000.h*0.53*cor_f1
FIELD "1000" TEXT "1000"

'scale: 10.000Hz field
f10K.w = scr.w/9
f10K.h = f10K.w/1.8
f10K.x = scr.w2 + f10K.w/1.4
f10K.y = scr.h2*1.57*cor_f1
FIELD "10K" TEXT "" AT f10K.x,f10K.y SIZE f10K.w,f10K.h RO
FIELD "10K" BACK ALPHA 0
FIELD "10K" FONT SIZE f10K.h*0.8*cor_f2
FIELD "10K" TEXT "10k"

'------------ End of Knob Dial -------------'


'herz display: field
fi.w = scr.w/1.9
fi.h = fi.w/3
fi.x = scr.w2 - fi.w/2
fi.y = scr.h*0.005
FIELD "freq" TEXT "" AT fi.x,fi.y SIZE fi.w,fi.h RO
FIELD "freq" BACK ALPHA 0.04
FIELD "freq" FONT SIZE fi.w*0.27
FIELD "freq" TEXT "Test"

'slider: sensitivity (button increment)
sl.k = 0
sl.x = scr.w2/2
sl.y = scr.h*0.9
sl.s = scr.w*0.5
sl.a = 0
SLIDER "sens" VALUE sl.k AT sl.x,sl.y SIZE sl.s ANGLE sl.a

'slider: fine-tune-field
ft.w = scr.w/2
ft.h = ft.w/8
ft.x = scr.w2 - ft.w/2
ft.y = scr.h2*1.83
FIELD "fTune" TEXT "" AT ft.x,ft.y SIZE ft.w,ft.h RO
FIELD "fTune" BACK ALPHA 0
FIELD "fTune" FONT SIZE ft.w*0.095*cor_f2
FIELD "fTune" TEXT "  1   1/3   1/5 Fine Tune"


'knob: init position
knob_ang = 15
knob_ang_old = 15
knob_ang2 = 15
knob_incr = 1

LOOP:
'slider: slide
IF SLIDER_CHANGED("sens") THEN
  s.s = SLIDER_VALUE("sens")
  IF s.s <= 0.33 THEN
    SLIDER("sens") VALUE 0
    knob_incr = 1
  END IF 
  IF s.s > 0.33 AND s.s < 0.67 THEN
    SLIDER("sens") VALUE 0.5
    knob_incr = 0.3
  END IF 
  IF s.s >= 0.67 THEN 
    SLIDER("sens") VALUE 1
    knob_incr = 0.2
  END IF
END IF 

'knob: turn
'reset knob_ang_diff to stop the button
knob_ang_diff = 0
'reset first touch angle to last touch angle
knob_ang_new1 = knob_ang_new2
GET TOUCH 0 AS tx,ty
IF tx >-1 THEN
  dx_t = tx - scr.w2
  dy_t = ty - scr.h2
  'check if touch was in button area
  IF dx_t^2 + dy_t^2 < (0.45*scr.w)^2 THEN
    'get first angle when (re)touching
    IF first_touch = 1 THEN 
      knob_ang_new1 = ATAN2(dy_t,dx_t)
      first_touch = 0
    END IF 
    knob_ang_new2 = ATAN2(dy_t,dx_t)
    knob_ang_diff = (knob_ang_new2 - knob_ang_new1)
    'limit the max/min ang difference
    IF knob_ang_diff > +12 THEN knob_ang_diff=0
    IF knob_ang_diff < -12 THEN knob_ang_diff=0
  ELSE
    first_touch = 1
  END IF
END IF

'remember last knob position
knob_ang_old = knob_ang
knob_ang = knob_ang_old + knob_ang_diff*knob_incr

'map knob angle +/- 180' -> 0-360'
knob_ang2 = knob_ang
IF knob_ang2 < 0 THEN 
  knob_ang2 = (knob_ang2+360)
END IF
knob_ang2 = (knob_ang2)%360

'skip not defined knob_angles
IF knob_ang2 <=  15 THEN knob_ang2 =  15
IF knob_ang2 >= 346 THEN knob_ang2 = 346

'calc. dial frequency out of the knob angle
freq_1 = 81.113083079*EXP(0.0139550612*knob_ang2)

'get best midi note fit
note_old = note 
note = FLOOR(69 + 12*LOG2(freq_1/440))
note_f = 440*2^((note-69)/12)

'calc. best pitchbend value
pitchB = INT(63 +(32*12*LOG2(freq_1/note_f)))
NOTES MIDI 0,14,0,pitchB 'pitch bend

'calc. emited frequency
freq_2 = note_f*2^((pitchB-63)/(32*12))

IF note_old <> note THEN
  NOTES MIDI 0,9,note,80    'play new note
  NOTES MIDI 0,9,note_old,0 'stop old note
END IF

'update knob position
SPRITE "knob" AT scr.w2,scr.h2 ANGLE knob_ang2

'spacer for "centered" freq. display
spacer$ = ""
a = FLOOR(LOG10(freq_2*1000))
FOR i = 1 TO 7-a
  spacer$ = spacer$&" "
NEXT i

FIELD "freq" TEXT spacer$&INT(freq_2*10)/10

GOTO LOOP

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: SineTone Generator (100-10k Hz, Midi)

Post by rbytes »

Both sound fonts seem to work fine on my iPad without distortion.

BTW, I like the look of your slider. Would like to get the image files you use for it if that's OK.

I added a knob image that I load with a DRAW IMAGE command right at the end of the knob creation code. Screen shot and attached image are below. If I loaded the image earlier it would be grabbed and rotated by your code. Unfortunately metallic knobs don't look realistic doing this because the light reflections look unnatural, so I left it stationary and just let the indicator rotate.

Yes, the knob is huge on an iPad and could be scaled down. The image had to be expanded to SCALE 1.75 to fit, which is why it looks a bit soft. Your code for knob creation and detection would be useful in many types of programs.

Thanks for posting.
Attachments
image.png
image.png (2.57 MiB) Viewed 4301 times
image.png
image.png (185.45 KiB) Viewed 4301 times
The only thing that gets me down is gravity...

Operator
Posts: 138
Joined: Mon May 06, 2013 5:52 am

Re: SineTone Generator (100-10k Hz, Midi)

Post by Operator »

@Dutchman:
Thx. for including the error (no file) handler.
The distortion you heard was a Tenor Sax, instrument #67...

@ricardobytes:
The slider you like, is not based on an image,
the sliders look that way on my iPhone 4 with
iOS 6.1. I made some, but I can't scan them
for an .png image out of sB, so I hope the .jpg
below is of some help...

- - -
For sine tone generation, please use the Perfect sine.sf2, you will notice what Henko mentioned
if you fine tune (slow -> slider to the right) starting above 3540Hz with Sine_V1.sf2., I plugged my phone to the stereo and then to a spectrum analyzer (software) to hear and see the distortions...
Attachments
image.jpg
image.jpg (60.1 KiB) Viewed 4283 times

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: SineTone Generator (100-10k Hz, Midi)

Post by rbytes »

Thanks for the image. Yes, I am using Perfect Sine now.
The only thing that gets me down is gravity...

Post Reply